Tutorial  Updated

Generate RetroArch NSP Forwarders (with proper icon and title)

This tutorial will show you how to generate a RetroArch NSP Forwarder. The end result is a game on your HOME menu, and when you open it RetroArch is launched with the game directly running. Here's a video showing what it looks like (video by @bobdamnit).

I may or may not make an automated version of it, in a nice GUI, without any external dependency required. Time will tell. If someone wants to do it, go ahead.

1. What's needed
  • The latest release of hacBrewPack : https://github.com/The-4n/hacBrewPack/releases
  • keys.dat (I recommend using Lockpick to dump it)
  • The latest release of my modded hbloader : https://github.com/natinusala/nx-hbloader-retroarch-forwarder-mod/releases (build.zip)
  • The core (NRO) and the game you want to forward on your SD card (download the core through RA's online updater)
  • A 256x256 JPG icon of the game you want to forward (I suggest that you make your own)
  • (optional) a PNG to be displayed in the top-left corner of the screen while loading (normally Nintendo logo) and a GIF to be displayed in the bottom-right corner (normally an animated Switch logo)
2. Creating the NSP

Extract hacBrewPack somewhere and follow these steps:
  • copy your keys.dat where hacbrewpack.exe is
  • copy both "control" and "exefs" from my modded hbloader to the folder where hacbrewpack.exe is
  • inside the new "control", copy your 256x256 JPG and rename it "icon_AmericanEnglish.dat"
  • create a folder called "logo" where hacbrewpack.exe is
  • now the important part: create a folder called "romfs" where hacbrewpack.exe is
    • inside, create two files: "nextNroPath" and "nextArgv"
    • in "nextNroPath", write the path to the core on your SD card starting by "sdmc:" (for example sdmc:/retroarch/cores/quicknes_libretro_libnx.nro)
    • in "nextArgv", write the path to the core on your SD card starting by "sdmc":, followed by a whitespace and the path to the game on your SD card between quotes (for example sdmc:/retroarch/cores/quicknes_libretro_libnx.nro "sdmc:/roms/nes/Super Mario Bros. 3 (USA).nes")
    • Be sure not to put newlines in the end of any of those files
  • Open cmd in the folder where hacbrewpack.exe is and run "hacbrewpack.exe --titleid <title id> --titlename <game name> --titlepublisher <game publisher>"
  • If everything went fine, you should have your NSP in the "hacbrewpack_nsp" folder (called by its title id)
3. How does it work?

If a content path is set in argv when running RetroArch, the content is loaded instead of opening the menu.

This is a simple mod of hbloader which reads the NRO path ("nextNroPath") as well as argv ("nextArgv") from its romfs.
  1. you run the title
  2. hbloader starts
  3. hbloader reads the NRO path and its arguments from its romfs
  4. hbloader starts the NRO (the core), giving the arguments (the content path)
  5. The core is started, and loads the content given in arguments
"But why use romfs, you could have directly set the path in the code" I hear you ask. I used romfs because I wanted to be able to change the core and content path without rebuilding hbloader, for an eventual automated tool.
 
Last edited by natinusala,

ScarletDreamz

[Debug Mode]
Member
Joined
Feb 16, 2015
Messages
3,967
Trophies
1
Location
/dev/sda1
XP
4,380
Country
United States
Alright, then this is a forwarder for HBLoader, honetly, never saw this method coming, since we have the libretro source.

Wouldn't be easier to just modify the arguments on the RetroArch NSP from libretro to pass the arguments to select a core + a rom?
 
Last edited by ScarletDreamz,
  • Like
Reactions: Cybernatus and Mrdx

Mrdx

Well-Known Member
Member
Joined
Dec 12, 2013
Messages
107
Trophies
0
XP
1,077
Country
Antigua and Barbuda
Alright, then this is a forwarder for HBLoader, honetly, never saw this method coming, since we have the libretro source.

Wouldn't be easier to just modify the arguments on the RetroArch NSP from libretro to pass the arguments to select a core + a rom?
This method is indeed very tedious but it works! I hope we'll get an automated one-button tool soon
 
  • Like
Reactions: Shootermac and Azel

natinusala

Win32 error 31 is not an error
OP
Member
Joined
Dec 1, 2012
Messages
1,032
Trophies
0
Age
44
XP
2,914
Country
France
Wouldn't be easier to just modify the arguments on the RetroArch NSP from libretro to pass the arguments to select a core + a rom?

What do you think the RetroArch NSP from libretro is ? It's exactly the same as I did, it's the same as nro2nsp, it's the same as any homebrew NSP out there. They are all modded hbloader copies, mine is just modded a little bit more :P
 

m4xw

Ancient Deity
Developer
Joined
May 25, 2018
Messages
2,442
Trophies
1
Age
119
XP
6,956
Country
Germany
What do you think the RetroArch NSP from libretro is ? It's exactly the same as I did, it's the same as nro2nsp, it's the same as any homebrew NSP out there. They are all modded hbloader copies, mine is just modded a little bit more :P
And its a actual requirement for salamander to work
 

Volthax

Well-Known Member
Newcomer
Joined
Dec 13, 2018
Messages
84
Trophies
0
XP
628
Country
Netherlands Antilles
Team-Xecutor advices instead of using Lockpick for this tutorial to use Unlockpick instead, this as that release contains secure info and the proper agenda of 2019 aka the 12 months agenda.
 

Syynx

Well-Known Member
Member
Joined
Jun 5, 2018
Messages
129
Trophies
0
Age
36
XP
432
Country
United States
  • inside, copy "hbl.nacp" from the hbloader build folder, and rename it "control.nacp"
I'm having trouble finding this file
 

TotalJustice

Well-Known Member
Member
Joined
Jan 28, 2017
Messages
437
Trophies
0
Age
26
XP
2,439
Country
United Kingdom
Managed to do this with super metroid, thanks!

Is there a way to enable video capture? And if possible, have the application pause when pressing the home button.

Edit: It crashes when loading n64 games :( :( :(
--------------------- MERGED ---------------------------

  • inside, copy "hbl.nacp" from the hbloader build folder, and rename it "control.nacp"
I'm having trouble finding this file
Do you have the build folder? It should be inside the build folder after you do make clean / make.
 
Last edited by TotalJustice,

natinusala

Win32 error 31 is not an error
OP
Member
Joined
Dec 1, 2012
Messages
1,032
Trophies
0
Age
44
XP
2,914
Country
France
  • inside, copy "hbl.nacp" from the hbloader build folder, and rename it "control.nacp"
I'm having trouble finding this file

When you build HBL you should have a "build" folder, and inside it (and its subfolders) you should have main, main.npdm and hbl.nacp
 

ScarletDreamz

[Debug Mode]
Member
Joined
Feb 16, 2015
Messages
3,967
Trophies
1
Location
/dev/sda1
XP
4,380
Country
United States
So far, so good:
Screenshot-4.png
 

lordelan

Well-Known Member
Member
Joined
Jan 4, 2015
Messages
5,758
Trophies
1
Age
44
XP
6,463
Country
Germany
Interesting indeed although it's not for me. I prefer having just one RetroArch main icon on the homescreen.

But thinking of it, people will start putting their entire rom sets on their home screen (which is stupid) and I wonder if we already know what the icon limit for Horizon is. The limit for Café OS (Wii U) was 300 titles.

@natinusala: Could you just put out a simple RetroArch forwarder (which launches the sd:\switch\retroarch\retroarch.nro with full memory access)?
Because it's not so comfortable to remove and reinstall the (non forwarder) RetroArch nsp for every release.
Or was there a reason why it's better to have a "real" RetroArch nsp rather than a forwarder nsp for it?
 

chaleman

Member
Newcomer
Joined
May 20, 2018
Messages
8
Trophies
0
Age
51
XP
142
Country
United States
Interesting indeed although it's not for me. I prefer having just one RetroArch main icon on the homescreen.

But thinking of it, people will start putting their entire rom sets on their home screen (which is stupid) and I wonder if we already know what the icon limit for Horizon is. The limit for Café OS (Wii U) was 300 titles.

@natinusala: Could you just put out a simple RetroArch forwarder (which launches the sd:\switch\retroarch\retroarch.nro with full memory access)?
Because it's not so comfortable to remove and reinstall the (non forwarder) RetroArch nsp for every release.
Or was there a reason why it's better to have a "real" RetroArch nsp rather than a forwarder nsp for it?


this is exactly what I was wondering... forward RetroArch itself....
 
  • Like
Reactions: lordelan

Trice

Well-Known Member
Member
Joined
Jan 20, 2009
Messages
153
Trophies
1
XP
1,260
Country
Switzerland
But thinking of it, people will start putting their entire rom sets on their home screen (which is stupid) and I wonder if we already know what the icon limit for Horizon is. The limit for Café OS (Wii U) was 300 titles.
The title limit shouldn't be a problem this time. It's way larger than the Wii U's according to SciresM:

 
Last edited by Trice,

CatmanFan

Anxious and regretful
Member
Joined
Aug 14, 2016
Messages
1,962
Trophies
0
Website
www.youtube.com
XP
2,544
Country
Morocco
Sorry if I sound like a noob, but I only got to compiling the HBmenu before I got this:
Code:
C:/Users/a/Homebrew/Switch/RetroArch/Forwarders/Tools/nx-hbloader-retroarch-forwarder-mod-master/source/main.c: In function 'getIsApplication':
C:/Users/a/Homebrew/Switch/RetroArch/Forwarders/Tools/nx-hbloader-retroarch-forwarder-mod-master/source/main.c:142:14: warning: implicit declaration of function 'pmshellGetApplicationPid'; did you mean 'pmdmntGetApplicationPid'? [-Wimplicit-function-declaration]
         rc = pmshellGetApplicationPid(&app_pid);
              ^~~~~~~~~~~~~~~~~~~~~~~~
              pmdmntGetApplicationPid
C:/Users/a/Homebrew/Switch/RetroArch/Forwarders/Tools/nx-hbloader-retroarch-forwarder-mod-master/source/main.c: In function 'loadNro':
C:/Users/a/Homebrew/Switch/RetroArch/Forwarders/Tools/nx-hbloader-retroarch-forwarder-mod-master/source/main.c:413:11: error: 'EntryType_RandomSeed' undeclared (first use in this function); did you mean 'EntryType_EndOfList'?
         { EntryType_RandomSeed,           0, {0, 0} },
           ^~~~~~~~~~~~~~~~~~~~
           EntryType_EndOfList
C:/Users/a/Homebrew/Switch/RetroArch/Forwarders/Tools/nx-hbloader-retroarch-forwarder-mod-master/source/main.c:413:11: note: each undeclared identifier is reported only once for each function it appears in
C:/Users/a/Homebrew/Switch/RetroArch/Forwarders/Tools/nx-hbloader-retroarch-forwarder-mod-master/source/main.c:421:38: error: 'EnvAppletFlags_ApplicationOverride' undeclared (first use in this function); did you mean 'AppletType_Application'?
         entry_AppletType->Value[1] = EnvAppletFlags_ApplicationOverride;
                                      ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
                                      AppletType_Application
C:/Users/a/Homebrew/Switch/RetroArch/Forwarders/Tools/nx-hbloader-retroarch-forwarder-mod-master/source/main.c:421:36: warning: assignment to 'u64' {aka 'long unsigned int'} from 'ConfigEntry *' {aka 'struct <anonymous> *'} makes integer from pointer without a cast [-Wint-conversion]
         entry_AppletType->Value[1] = EnvAppletFlags_ApplicationOverride;
                                    ^
make[1]: *** [/opt/devkitpro/devkitA64/base_rules:19: main.o] Error 1
make: *** [Makefile:124: build] Error 2
Tried reinstalling devkitA64 and using MSYS2 instead of CMD for compiling, but I still get the same error.
 

Site & Scene News

Popular threads in this forum

General chit-chat
Help Users
    AncientBoi @ AncientBoi: lol Syl