Git Product home page Git Product logo

nton's Introduction

NTON

Build status PyPI version Python versions License (GPLv3)

NTON is a Nintendo Switch NRO to NSP Forwarder for firmware 12.0.0 and newer.

A forwarder lets you open Homebrew files from your SD card through the Nintendo Switch Home Screen instead of the Homebrew Launcher.

Features

  • ⚙ Firmware 12.0.0+ Support
  • 🛡️ Title ID Conflict Checks
  • 🤖 Automatically Extracts Title Information and Icon from NRO
  • 🕹️ Direct Game Forwarding
  • 🎥 Enable or Disable Video Capture and Screenshots
  • 💾 1MB NSP Install Size
  • 🖼️ Custom Icons
  • 🧩 Plug-and-play
  • ✨ GUI and CLI Interfaces
  • ❤️ Forever FOSS!

Installation

Windows Installers for the GUI version is available on the Releases page.

Alternatively you can download and install NTON from PIP/PyPI:

$ pip install nton[gui]

(Exclude [gui] if you do not plan on using the GUI)

Note If pip gives you a warning about a path not being in your PATH environment variable then promptly add that path then close all open command prompt Windows, or running nton won't work as it will not be recognized as a program.

You now have the nton package installed - Voilà 🎉!
Launch the GUI by running nton without another subcommand in your Terminal or Windows Run.
Otherwise, use the CLI by checking out nton --help.

Keys

Proprietary Keys known as prod.keys are required. You can obtain them from your own personal Switch using Lockpick_RCM.

It must be placed at C:\Users\<User>\.switch\prod.keys, in your current working directory, or in NTON's installation directory for NTON to be able to find and use the keys.

Usage

NTON is quite simple, just give it the path to the NRO on your microSD card!

For example, to create a forwarder for the Daybreak Homebrew included with Atmosphere, it's as simple as:

nton build "D:/switch/daybreak.nro"

This will build a forwarder with the Title Name, Publisher, Version, and Icon automatically extracted from the NRO. The Title ID will be a randomly assigned value within generally conformed bounds. You may manually set a value with --name, --publisher, --version, --icon, and --id respectively.

The Title ID is automatically checked against a periodically updated list of pre-existing System and Software Title IDs to ensure a collision does not occur. However, you should still be cautious and verify the Title ID is not already used by other Software before using.

Note
While NTON can be used on NRO files stored on your PC, it was designed to be used directly from your Switch's microSD card. If you prefer to create forwarders with NRO files on your PC, or for batch purposes, you can specify the path that the NRO file will reside on your microSD card during generation with --sdmc.

For example, to make a forwarder for an NRO that is on your PC:

nton build "C:/Users/rlaphoenix/Downloads/haze.nro" --sdmc "/switch/haze.nro"

Direct RetroArch Game forwarding

Use a RetroArch Game Core as the NRO path and provide the path to the ROM on your Switch's microSD card with --rom.
This will then load the Core directly under RetroArch and provide the path to the ROM as a startup argument to the RetroArch Core.

Note

  • You must use a path to a RetroArch Game Core NRO, not the path to the RetroArch NRO itself.
  • Do not move, delete, or rename the ROM or the Core NRO files that are on your microSD card, or it will break.

Storage Sizes

On Installation an NSP can allocate storage for specific purposes. There's three primary types of Storage:

  • User Account Save Data: Storage allocated to each User profile. Most titles use this to save game progress.
  • Device Save Data: Storage allocated to the Device itself. Typically used for data or information that should be set to and used by all User profiles. For example, Animal Crossing: New Horizons uses this to store the Island data for all profiles to use.
  • Cache Storage: Storage allocated for temporary data. Data stored here will be wiped without warning.

The NSP can specify how much data to allocate initially, as well as the maximum amount of storage that data can occupy over time. Furthermore, the initial and maximimum size allocated for Journaling (a form of recovery and data integrity) can also be specified.

A Forwarder like the ROM NTON uses does not need any form of storage or save data. Therefore, NTON automatically sets all storage sizes to 0 to reduce storage usage.

Troubleshooting

Before continuing try running the homebrew from the Homebrew Launcher and see if it works through there. If it does not work through the Homebrew launcher either, then it was never the forwarder's fault, and you should check on your NRO or application installation.

Please note that using Forwarders others have created has a good chance of not working on your system. The location of the NRO on their system may differ from the location on your system, hence the NSP won't be able to load the homebrew. I will not provide support if you are having an issue with a Forwarder you did not build yourself.

The forwarder does not launch, "The software was closed because an error occurred."

Your "sigpatches" (signature patches) that allow unsigned titles to launch is likely outdated or not set up correctly. Sigpatches can go outdated from Horizon OS firmware updates, Atmosphere updates (as well as silent updates). It is recommended to use the sys-patch sys-module to automatically patch your system from signature checks as well as other useful patches. The default configuration is fine for the majority of systems and is a simple copy & paste to your microSD card to install.

It's also possible the prod.keys you used with NTON is outdated for your firmware. Get new ones with Lockpick_RCM and make sure you choose to get keys from the SysMMC or EmuMMC that you will be installing the forwarder on (or whichever has a newer firmware version).

The forwarder starts loading but then crashes

The NRO path set when building the forwarder is incorrect or the NRO file is currently missing (or your microSD card is not inserted). Make sure the path you choose starts with / and is an absolute path to an existing NRO file on your Switch's microSD card (not your PC).

The forwarder's icon is a '?'

This happens when the icon_AmericanEnglish.dat within the built forwarder is not to the spec that Nintendo likes, in some way. This is usually caused by the format of the image not being JPEG, or it has EXIF data or other unnecessary extra metadata.

Note
This is considered a bug if it happens to you after using NTON as it should automatically sanitize the images when building the forwarder. If this happens to you, please report what image you chose to use, or give information on what exact NRO you were making a forwarder from.

The forwarder's icon is a loading circle, opening fails

The installation of the Forwarder NSP failed in some way and the result is a corrupt title under that Title ID. This may have happened when trying to install data to the Title ID you chose or had randomly assigned to your forwarder NSP on an unsupported firmware version. This also happens when trying to install DLC to a Title without having the minimum required Game Update for that DLC (i.e. Installing the DLC Courses while on Mario Kart 8 Deluxe v1.0). However, since this happened on your Forwarder NSP you can likely rule that out.

When this happens deleting and reinstalling the same NSP likely won't fix it or do anything. You may need to reinstall the NSP via Goldleaf and hit "Proceed" when it warns yo uthat the title is already installed. Goldleaf will deal with the pre-existing files properly unlike Tinfoil (where you likely had the corruption in the first place). DBI may also help you resolve this issue as it has tools to remove partial installs and leftover files.

The forwarder randomly stopped working, I've read everything so far

You most likely updated Atmosphere or Horizon OS's Firmware and need to update your Sigpatches. If that hasn't fixed it, make sure you haven't deleted or moved the NRO on your Switch's microSD card. It cannot be moved as the built forwarder has a hardcoded file path that it loads the NRO from when launched.

If it still does not work, it's possible a firmware update has broken the forwarder ROM that is used and needs to be updated. Both Firmware 9.0.0 and 12.0.0 have previously broken different forwarder ROMs requiring updates. If you believe this to be the case then please make an Issue.

Development

The following steps are basic instructions on downloading and working on the code under a Poetry environment.

  1. Follow Poetry's Docs to Install Poetry.
  2. Download NTON's latest code, git clone https://github.com/rlaphoenix/nton
  3. Navigate to the downloaded code repository, cd nton
  4. Optionally have Poetry install the virtual-env in the project, poetry config virtualenvs.in-project true
  5. Install NTON's dependencies and development tools, poetry install -E gui
  6. Run NTON from within the Poetry venv, poetry run nton --help

Note If you plan to work on or use the GUI during development, then add -E gui during Step 5.

As shown, running the nton executable is somewhat different to a normal installation. This is because Poetry installs all dependencies and the nton shim itself within a virtual-environment, which is like a clone of your Python install stripped clean, with only NTON's dependencies installed. That way you don't mess around with any dependencies from any other installed Python applications, nor the other way around. A secluded environment.

I recommend taking a look at Poetry's Docs for further information, why not get started by reading Poetry's guide on Using Your Virtual Environment.

Credit

Licensing

This software is licensed under the terms of GNU General Public License, Version 3.0. You can find a copy of the license in the LICENSE file in the root folder

This project uses the following software:

No changes were made to any of the aforementioned software and copies of their licenses can be found next to their binaries within the bin folder.


© rlaphoenix 2022-2024

nton's People

Contributors

dependabot[bot] avatar rlaphoenix avatar threnklyn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

nton's Issues

Looking for Logo and Banner Artwork

Please note this is an Open-Source project and I do not make any money off of it therefore this is NOT a paid role. You will be added to the Contributor list if you provide me with your GitHub username.

Rules:

  1. All artwork must be newly made and pass a google-fu test before delivering to me.
  2. The Icon must be a .ai Adobe Illustrator file and the Banner artwork must be a .psd Adobe Photoshop file.
  3. The Icon must be in a Square canvas of 5000x5000px in resolution. The Banner must be 4440x910px in resolution. Both must be created under that resolution (not upscaled or downscaled to that resolution).
  4. You must give me full rights to all artwork in perpetuity. It will be considered my artwork, but the designer will be mentioned under the Credits section of the README.
  5. Therefore you also give me permission to create derivative works of the artwork for this or other projects in perpetuity. Original artwork credits may or may not be listed on derivative work.

NsTool cannot be found on MacOSX

Describe the bug
When attempting to run nton, after installing through the .whl from the releases or through pip install nton, an error shows up: !! nstool cannot be found! Please place it in the current working directory orput it's path in your PATH Environment Variable, or put the binary."

To Reproduce
Steps to reproduce the behavior:

  1. Download and install nton pip install nton or pip install nton-2.1.1-py3-none-any.whl
  2. Run nton or nton build
  3. See error

Expected behavior
nton would either build the app or show command guide. Literally anything else besides the error, I guess?

Additional context
I'm running this on MacOSX 14 Sonoma with a M1 chip.
I've tried putting the NSTool file from the repo into the bin folder of nton or path, neither was found and prompted the same errors.

NRO Icons are Compressed

Is your feature request related to a problem? Please describe.
When using this program, the icon's JPEG compression is noticeable.

Describe the solution you'd like
Add an option to not convert the user supplied image to JPEG (if the image is already an JPEG).

Describe alternatives you've considered
Make the converted icon's JPEG quality higher.

Additional context
This program that also forwards NRO files has an option like this built in but does not work anymore.
Examples:
(Taken with bitmap-printer, so there's no further JPEG compression from normal Switch screenshots.)
2024-03-17_11-16-55
Left: From Source Code - Right: From NSP Output
example

Ability to specify Required System Version to match Forwarder ROM

Is your feature request related to a problem? Please describe.
Since the current forwarder ROM only supports 9.0.0 and newer, specifying that in the NSP would be ideal.

Describe the solution you'd like
hacBrewPack is currently used to build the NSP, so modifying it to add support for specifying a system version would be great.

Describe alternatives you've considered
I cannot think of another alternative.

Additional context
This doesn't seem to be implemented in hacBrewPack as of yet, see https://github.com/The-4n/hacBrewPack/issues/16

"Downloading a list of Game Title IDs..." throws error

I believe it's because tinfoil.io is restricted in my county

PS C:\Users\gnaomo\Downloads\nsp> nton
Downloading a list of Game Title IDs...
Traceback (most recent call last):
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connection.py", line 203, in _new_conn
    sock = connection.create_connection(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\connection.py", line 85, in create_connection
    raise err
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\connection.py", line 73, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [WinError 10061] No connection could be made because the target machine actively refused it

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 790, in urlopen
    response = self._make_request(
               ^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 491, in _make_request
    raise new_e
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 467, in _make_request
    self._validate_conn(conn)
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 1092, in _validate_conn
    conn.connect()
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connection.py", line 611, in connect
    self.sock = sock = self._new_conn()
                       ^^^^^^^^^^^^^^^^
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connection.py", line 218, in _new_conn
    raise NewConnectionError(
urllib3.exceptions.NewConnectionError: <urllib3.connection.HTTPSConnection object at 0x00000200C5C45690>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 486, in send
    resp = conn.urlopen(
           ^^^^^^^^^^^^^
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\connectionpool.py", line 844, in urlopen
    retries = retries.increment(
              ^^^^^^^^^^^^^^^^^^
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\urllib3\util\retry.py", line 515, in increment
    raise MaxRetryError(_pool, url, reason) from reason  # type: ignore[arg-type]
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
urllib3.exceptions.MaxRetryError: HTTPSConnectionPool(host='tinfoil.media', port=443): Max retries exceeded with url: /Title/ApiJson/?rating_content=&language=&category=&region=ar%2Cat%2Cau%2Cbe%2Cbg%2Cbr%2Cca%2Cch%2Ccl%2Ccn%2Cco%2Ccy%2Ccz%2Cde%2Cdk%2Cee%2Ces%2Cfi%2Cfr%2Cgb%2Cgr%2Chk%2Chr%2Chu%2Cie%2Cit%2Cjp%2Ckr%2Clt%2Clu%2Clv%2Cmt%2Cmx%2Cnl%2Cno%2Cnz%2Cpe%2Cpl%2Cpt%2Cro%2Cru%2Cse%2Csi%2Csk%2Cus%2Cxx%2Cza%2Czh&rating=&_=1691236023573 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000200C5C45690>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Scripts\nton.exe\__main__.py", line 4, in <module>
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\nton\main.py", line 17, in <module>
    from nton import __version__, nstool, title_ids
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\nton\title_ids.py", line 482, in <module>
    game_title_ids = get_game_title_ids()
                     ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\nton\title_ids.py", line 437, in get_game_title_ids
    res = requests.get(
          ^^^^^^^^^^^^^
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\api.py", line 73, in get
    return request("get", url, params=params, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\api.py", line 59, in request
    return session.request(method=method, url=url, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 589, in request
    resp = self.send(prep, **send_kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\sessions.py", line 703, in send
    r = adapter.send(request, **kwargs)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\gnaomo\AppData\Local\Programs\Python\Python311\Lib\site-packages\requests\adapters.py", line 519, in send
    raise ConnectionError(e, request=request)
requests.exceptions.ConnectionError: HTTPSConnectionPool(host='tinfoil.media', port=443): Max retries exceeded with url: /Title/ApiJson/?rating_content=&language=&category=&region=ar%2Cat%2Cau%2Cbe%2Cbg%2Cbr%2Cca%2Cch%2Ccl%2Ccn%2Cco%2Ccy%2Ccz%2Cde%2Cdk%2Cee%2Ces%2Cfi%2Cfr%2Cgb%2Cgr%2Chk%2Chr%2Chu%2Cie%2Cit%2Cjp%2Ckr%2Clt%2Clu%2Clv%2Cmt%2Cmx%2Cnl%2Cno%2Cnz%2Cpe%2Cpl%2Cpt%2Cro%2Cru%2Cse%2Csi%2Csk%2Cus%2Cxx%2Cza%2Czh&rating=&_=1691236023573 (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at 0x00000200C5C45690>: Failed to establish a new connection: [WinError 10061] No connection could be made because the target machine actively refused it'))

Game Crashes

Describe the bug
When i start the installed .nsp it crashes.
To Reproduce
Place an nro with the name coolgame.nro in the switch folder on the sd card.
Mount the switch sd card as F:
Use the command:
nton build --name CoolGame --publisher ThatFinn --version 0.0.1 F:/switch/coolgame.nro
Install the nsp
Start the game
crash

Expected behavior
The application to start

Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
The working directory was C:\Users<myuser>.switch

Incorrect command error from hacbrewpack when building nro forwarder

Describe the bug
A clear and concise description of what the bug is.
hacbrewpack exits with /usr/bin/hacbrewpack: unrecognized option '--titleid' Usage: hackbrewpack [options...]

To Reproduce
Steps to reproduce the behavior:
Simply attempt to build an NRO with nton build blank.nro
Expected behavior
A clear and concise description of what you expected to happen.
For nton to use hacbrewpack correctly when building the nro.
Screenshots
If applicable, add screenshots to help explain your problem.

Additional context
Add any other context about the problem here.

Forwarder Fails to Launch - "The software was closed because an error occurred."

Describe the bug
I made a forwarder for Homebrew Menu with a clone of the latest repo to see if the new ExeFS ROM fixed the homebrew exit bug. it was created fine and installs fine on my Switch, but when I try to launch it I get the Nintendo Switch loading logo, followed by "The software was closed because an error occurred."

To Reproduce
Steps to reproduce the behavior:

  1. Clone repository
  2. Poetry Install
  3. Install hacBrewPack v3.05 (latest)
  4. Install ImageMagick (winget latest)
  5. Install NSTool v1.7.0 (latest)
  6. Install hacPackTools-NACP v1.36 r2 (latest)
  7. Dump and copy prod.keys (16.0.2)
  8. Run 'poetry run nton --build "X:/hbmenu.nro"' (where X is the path to your Switch SD card)
  9. Builds successfully
  10. Installs successfully via DBI
  11. Launch
  12. See error

Expected behavior
The Homebrew Menu should launch,

Additional context
I have read the readme several times to ensure I didn't miss anything. My prod.keys are up to date, I literally dumped them from 16.0.2 tonight. I am running AMS 1.5.2 and my sig patches are up to date, as I generated them myself with the IPS tool from my own 16.0.2 firmware dump and the AMS 1.5.2 package3 binary. I also can confirm that my sigpatches are valid and working because I can use the pre-built forwarder linked in the latest release without issue.

I also rolled back the ExeFS ROM files to see if this was an issue caused by that commit, but I still have the same issue.

Here is the crash log from AMS, and the generated NSP:
01681872573_010d6fd3b35cd000.log
Homebrew Menu v3.5.1 by switchbrew [010d6fd3b35cd000].zip

Unable to forward to roms with spaces in the filenames.

Describe the bug
When creating a forwarder to a rom with retroarch, spaces in the rom filename would cause the forwarder to boot the selected retroarch core with an error message; "File at /some/path/to/rom" not found for a rom at /some/path/to/rom\ file\ path\ with\ spaces.

To Reproduce
Steps to reproduce the behavior:
Create a forwarder with a command similar to;

nton build -n "MegaMan Zero" \
  RetroArch/retroarch/cores/mgba_libretro_libnx.nro \
  --sdmc /retroarch/cores/mgba_libretro_libnx.nro \
  --rom "/roms/gba/Megaman\ Zero\ \(USA,\ Europe\).zip" \

Expected behavior
I should be able to create forwarders for roms with spaces in the filenames.

If I just need to double-escape the spaces or something, that just needs to be in the documentation for the project somewhere.

Additional context
Love the project, super grateful you put this together.

Portable version not running

Hi, really like the idea of this app!

However, I just tried the NTON-v2.0.0-portable.exe and it is not running for me.
I'm using Windows 11
Version 22H2 Build 22621.2134

When I double click the NTON portable.exe version, I get the 'thinking' hourglass for about 1 second, then nothing, no errors, no crashes. I looked in Task Manager, NTON is not there.

I believe I'm fully updated but let me know if there is any logs I can check or anything.

I have not tried the Setup install yet. I kind of don't want to, I'd rather just run the simple portable version.

Thanks! Please let me know if you'd like me to test anything!

Unable to create NSPs on drives other than C:

When attempting to create NSPs on drives other than C:, it gives on OSError. When done with the gui portable executable, it shows no errors but no file is created.

I installed it with pip and tried again and saw the following error directly after creating the NSP:

Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\nton\gui\__init__.py", line 707, in build
    (Directories.output / f"{title_id}.nsp").rename(save_path)
  File "C:\Python311\Lib\pathlib.py", line 1175, in rename
    os.rename(self, target)
OSError: [WinError 17] The system cannot move the file to a different disk drive: 'C:\\Users\\milst\\Desktop\\NTON\\01130c41d865d000.nsp' -> 'L:\\Games\\Nintendo\\Switch\\Games\\harbo [01130C41D865D000][v0].nsp'

Here is the fill log:

2024-01-19 17:38:54 [I] nton.main : nton version 2.1.0 Copyright (c) 2022-2024 rlaphoenix
2024-01-19 17:38:54 [I] nton.main : https://github.com/rlaphoenix/nton
2024-01-19 17:39:10 [I] gui : Loading NRO: L:\Games\Nintendo\Switch\Games\soh.nro
2024-01-19 17:39:10 [I] gui : Got Randomized Title ID: 01130c41d865d000
2024-01-19 17:39:10 [I] gui : Extracted the Control NACP Partition
2024-01-19 17:39:10 [I] gui : Video Capture: 0
2024-01-19 17:39:10 [I] gui : Screenshots: 0
2024-01-19 17:39:10 [I] gui : Language Data:
2024-01-19 17:39:10 [I] gui :  - AmericanEnglish: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui :  - BritishEnglish: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui :  - Japanese: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui :  - French: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui :  - German: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui :  - LatinAmericanSpanish: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui :  - Spanish: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui :  - Italian: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui :  - Dutch: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui :  - CanadianFrench: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui :  - Portuguese: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui :  - Russian: [Name: "Ship of Harkinia", Publisher: "github.com/harbo"]
2024-01-19 17:39:10 [I] gui : Chosen NRO name and publisher from AmericanEnglish Language Data
2024-01-19 17:39:10 [I] gui : Removed all languages, set chosen data as AmericanEnglish
2024-01-19 17:39:10 [I] gui : Got the Icon from the NRO
2024-01-19 17:39:10 [I] gui : Display Version: ..
2024-01-19 17:39:17 [I] gui : Loaded NRO: L:\Games\Nintendo\Switch\Games\soh.nro
2024-01-19 17:39:20 [I] gui : NRO Integrity: OK
Traceback (most recent call last):
  File "C:\Python311\Lib\site-packages\nton\gui\__init__.py", line 707, in build
    (Directories.output / f"{title_id}.nsp").rename(save_path)
  File "C:\Python311\Lib\pathlib.py", line 1175, in rename
    os.rename(self, target)
OSError: [WinError 17] The system cannot move the file to a different disk drive: 'C:\\Users\\milst\\Desktop\\NTON\\01130c41d865d000.nsp' -> 'L:\\Games\\Nintendo\\Switch\\Games\\harbo [01130C41D865D000][v0].nsp'

TypeError

I may just be doing something wrong but I run nton D:/hbmenu.nro and get:

PS C:\Users\Chris\Documents\Switch\Apps and Homebrew> nton build "D:\hbmenu.nro"
2023-01-28 03:17:54 [I] nton.main : nton version 1.2.0 Copyright (c) 2022-2023 rlaphoenix
2023-01-28 03:17:54 [I] nton.main : https://github.com/rlaphoenix/nton
2023-01-28 03:17:54 [I] build : Building!
2023-01-28 03:17:54 [I] build : NRO checked and verified
2023-01-28 03:17:54 [I] build : Title ID: 010d6fd3b35cd000
2023-01-28 03:17:54 [I] build : Enabled Video Capture
2023-01-28 03:17:54 [I] build : Removed User Account Save Data Allocation
2023-01-28 03:17:54 [I] build : Removed User Account Save Data Journal Allocation
2023-01-28 03:17:54 [I] build : Title Name: nx-hbmenu
2023-01-28 03:17:54 [I] build : Publisher: switchbrew
2023-01-28 03:17:54 [I] build : Version: 3.5.1
Traceback (most recent call last):
  File "c:\users\chris\appdata\local\programs\python\python37\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\chris\appdata\local\programs\python\python37\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\Chris\AppData\Local\Programs\Python\Python37\Scripts\nton.exe\__main__.py", line 7, in <module>
  File "c:\users\chris\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "c:\users\chris\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "c:\users\chris\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\chris\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\chris\appdata\local\programs\python\python37\lib\site-packages\click\core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "c:\users\chris\appdata\local\programs\python\python37\lib\site-packages\nton\main.py", line 283, in build
    "-strip", str(icon_file.absolute())
  File "c:\users\chris\appdata\local\programs\python\python37\lib\subprocess.py", line 411, in check_output
    **kwargs).stdout
  File "c:\users\chris\appdata\local\programs\python\python37\lib\subprocess.py", line 488, in run
    with Popen(*popenargs, **kwargs) as process:
  File "c:\users\chris\appdata\local\programs\python\python37\lib\subprocess.py", line 800, in __init__
    restore_signals, start_new_session)
  File "c:\users\chris\appdata\local\programs\python\python37\lib\subprocess.py", line 1148, in _execute_child
    args = list2cmdline(args)
  File "c:\users\chris\appdata\local\programs\python\python37\lib\subprocess.py", line 555, in list2cmdline
    needquote = (" " in arg) or ("\t" in arg) or not arg
TypeError: argument of type 'NoneType' is not iterable
PS C:\Users\Chris\Documents\Switch\Apps and Homebrew>

Linux support

nton build -n Quake3Arena -i /home/will/Downloads/Quake-III-Arena-icon.png --sdmc /media/will/SWITCH SD/switch/Q3ArenaNX/Q3ArenaNX.nro
Downloading a list of Game Title IDs...
2023-01-26 15:56:08 [I] nton.main : nton version 1.2.0 Copyright (c) 2022-2023 rlaphoenix
2023-01-26 15:56:08 [I] nton.main : https://github.com/rlaphoenix/nton
2023-01-26 15:56:08 [I] build : Building!
2023-01-26 15:56:08 [E] build : The NRO path "SD/switch/Q3ArenaNX/Q3ArenaNX.nro" does not exist, or is not a file.

Any idea?

The ROM should have Save Data Allocation disabled to reduce unnecessary 64 MB install size to 2MB

Describe the bug
The NSP is about 2 MB when installed but has 62+1 MB allocated for save data that will never ever be used.
This leaves pointless wasted space. These 62 MBs add up quite quickly when using NSP Forwarders.

To Reproduce
Steps to reproduce the behavior:

  1. Make an NSP for Homebrew Menu or use the premade one.
  2. Install it with Goldleaf.
  3. See that it has taken up 64 MB of file space.

Expected behavior
It should take I believe 1+1MB of file space when installed. I can't quite remember what that extra 1 MB is, but it's there.

Screenshots
N/A

Additional context
This was already discussed about the ROM being currently used (technically) on GBATemp, https://gbatemp.net/threads/nsp-forwarder-tool-for-12.587936/post-9461703

Build fails for DBI forwarder

Describe the bug
A clear and concise description of what the bug is.
nstool fails to extract the ncap from a NRO and exits the process (DBI.nro)

To Reproduce
Steps to reproduce the behavior:

  1. PIP Install nton
  2. run cmd nton build --sdmc "/switch/DBI.nro" PATH/TO/NRO/DBI.nro
  3. program exits while trying to extract the ncap from nro.

Expected behavior
A clear and concise description of what you expected to happen.

Ideally the program should skip the extract and create a new ncap but it seems it's an issue with nstool and not nton.
A new cmd option should be added to skip the extract and create a new control.ncap for those troublesome nros.

Screenshots
If applicable, add screenshots to help explain your problem.
Screenshot_20221118_060601

Additional context
Add any other context about the problem here.

Looking for NTON testers on firmwares older than v12.0.0

NTON may or may not work on firmware versions older than 12.0.0, so I'm looking for testers to see which versions are currently supported.

If you are capable of using NTON and are on a firmware version older than 12.0.0, please try using NTON to create, install, and launch a forwarder. I must ask you to use NTON to create a forwarder for /hbmenu.nro just so everyone tests the same Homebrew.

Please also take a look at the Troubleshooting information on the project README if you have an issue. If there is an issue and following the Troubleshooting did not help, please mention this when posting your results.

Please report back with the following filled out:

(fill in the [ ] with X if successful, i.e., [X])

## Environment

- Firmware version: 
- Atmosphere version: 
- NTON version (or commit): 

## Results

- [ ] Installable
- [ ] Correct Icon (not a '?')
- [ ] Correct Title, Publisher, and Version
- [ ] Launchable (with sigpatches)
- [ ] Exits back to Home Menu without Crashing
- [ ] Video Capture and Screenshots are Enabled

## Conclusion

Tell me what specifically went wrong, e.g., if it failed to install, tell me what errors occurred.
If it failed to launch, tell me what happened.
Example (not a real result)

Environment

  • Firmware version: 9.0.0 (emuMMC)
  • Atmosphere version: 1.4.0
  • NTON version: 1.2.0

Results

  • Installable
  • Correct Icon (not a '?')
  • Correct Title, Publisher, and Version
  • Launchable (with sigpatches)
  • Exits back to Home Menu without Crashing
  • Video Capture and Screenshots are Enabled

Conclusion

It installed but would not launch. It states upon launch, 'Software Closed Due to an Unexpected Error'.

"é" character causing broken names

Describe the bug

When using the character "é" in titles (i.e. Pokémon FireRed Version) the character gets changed or mistranslated during the process. In NxFileViewer it appears as so:
Screenshot 2023-10-01 231728
And on the Switch:
2023100123172800
Not pictured here - sometimes the titles will corrupt and include text from other installed titles.

To Reproduce

  1. Install using pip install nton
  2. Run nton build "G:/retroarch/cores/mgba_libretro_libnx.nro" -n "Pokémon FireRed Version" -p "Nintendo" -v 1.0 -i "C:/Users/<User>/Downloads/pfr.jpg" --id 0740192E63E62000 --rom "/roms/gba/Pokemon - FireRed Version.gba"
  3. Check in NxFileViewer or install to Switch

Expected behavior

Using other forwarder generators this can be accomplished. With https://nsp-forwarder.n8.io/
Screenshot 2023-10-01 232602
image
Even doing it manually with HacBrewPack is possible, though it seems to have its own issues with including quotation marks.

prod.keys is missing, but it's not.

Describe the bug
I installed nton with pip (Python 3.10) and when I try to run it, it tells me that prod,keys is missing in my C:\Users\Name\.switch folder, but it's there with the latest keys.

I can literally copy the path it outputs and it opens my prod.keys in Notepad++ and the file was pulled using Lockpick on my own Switch.

To Reproduce

  1. Install with pip
  2. Run nton
  3. See error

Expected behavior
It should find my prod.keys file.

Pressing + or any action to exit a Homebrew, fails and reopens instead

Describe the bug
Any action that is meant to exit the Homebrew (and go back to e.g., the Homebrew Menu or Home Menu) is failing and instead just closes and reopens the Homebrew.

To Reproduce
Steps to reproduce the behavior:

  1. Make an NSP for Homebrew Menu or use the premade one.
  2. Install it with Goldleaf.
  3. Open it and press + once the menu has fully loaded.

You will see it go black and reopen, kind of like a refresh in this case.

Expected behavior
It was meant to close the homebrew and the forwarder entirely.

Screenshots
N/A.

Additional context
Some users have reported crashes when done instead of it closing and reopening.

Homebrew crashes on exit when launched through forwarder

Describe the bug
When trying to exit a homebrew app that has been launched through the HB Menu forwarder, it crashes with an error saying "The software was closed because an error occurred" instead of going back to HB Menu.

To Reproduce

  1. Install HB Menu forwarder
  2. Run a homebrew application
  3. Close application with + button or in-app exit button
  4. See error

Expected behavior
The app should return to HB Menu on exit.

Additional context
This has been a long standing issue with NSP forwarders, however I am 99.9% sure that your forwarder did not have this issue until I updated to HOS 16.0.0, AMS 1.5.1 tonight because when I found it about two months ago and tried it, it did not do this, which is why I switched to it over the other forwarder I was using before.

In the past, every other forwarder that I tried or made myself using the available tools exhibited this issue, at least after HOS 12.0.0 was released (which completely broke all NSP forwarders, and I had never used a forwarder before this version so I cannot confirm whether or not the issue existed prior to HOS 12.0.0), however like said, this issue did not appear to present on HOS 15.0.0 or 15.0.1 with Atmosphere 1.4.1 with your forwarder.

If you override the forwarder on launch by hold the right bumper, this issue doesn't happen, so a temporary fix is to set an override in the AMS config files to something like "override_key_1=!L" so that it automatically overrides the forwarder instead of just booting it normally.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.