RELEASE NSPsplitty(GUI form nsp split tool)

Discussion in 'Switch - ROM Hacking, Saves, Translations & Tools' started by Aionmagan, Nov 3, 2019.

  1. Aionmagan
    OP

    Aionmagan Member

    Newcomer
    1
    Dec 11, 2014
    Puerto Rico
    Ciales
    This is the first time i've ever learned about the switch hack scene,
    a friend of mine hacked his Nintendo Switch (i don't own one sadly so all test were done on his),
    he also told me about the

    splitNSP tool that is used through command prompt
    amazing work from AnalogMan151: link to his work

    so my friend asked me to make a GUI version of this, essentially i ended up writing the thing from scratch
    due to c#, but AnalogMan151's work made it that much easier;
    i'm sure a program like this already exist somewhere but may as well share it.
    a small disclaimer, this is my first program to ever share so i'm sure there are bugs to be found

    this one requires windows (.NET4.7=>)

    link to NSPsplitty (DOWNLOAD): https://github.com/Aionmagan/NSPsplitty/releases
    (link to AnalogMan151's splitNSP can also be found in the readme.md section)

    UPDATE v0.01
    the tool just does one thing, which is split a .nsp file
    that is bigger then 4gb to fit in the fat32 file system of the Nintendo Switch.
    the difference is that no command prompt is needed and neither is installing python-3

    a simple preview
    preview(1).

    UPDATE V0.02-a
    thanks to some input from this current comment section i have added
    an all file (.) extension support for split of any file of your choice (.nsp is default)

    preview2.

    UPDATE v0.02-b
    added a 'merge files' checkbox
    toggle it before you search for the files to be merged (00, 01, 02...)

    also make sure that the folder where the files are located has an extension
    i.e. gametitle_split.nsp (.nsp can be anything you wish such as .iso ect..)

    preview(5).

    after 'Merge files' is checked just browse for the file '00' to be merged

    preview(6).

    and hit the newly appearing 'Merge files' button (before named 'Split file' "name does change back and forth")

    UPDATE v0.03-a
    removed 'merge check box'
    now to merge files just browse to file '00'
    to the folder that contains it (folder must contain the extension you wish the file merge to select 'folder_split.nsp' where nsp is your choice)
    Screenshot (42).
     
    Last edited by Aionmagan, Nov 10, 2019
  2. masagrator

    masagrator The developper

    Member
    11
    Oct 14, 2018
    Poland
    I think instead of limiting it only to nsp you should allow to split any file. This method is working for every file.
     
    Andalitez likes this.
  3. Aionmagan
    OP

    Aionmagan Member

    Newcomer
    1
    Dec 11, 2014
    Puerto Rico
    Ciales
    could you elaborate a bit more ?

    my knowledge on the file extension used for the nintendo switch is very limited
    assuming that is what you mean by "this methods is working for every file"

    thank you for the feedback, Regards Aionmagan
     
  4. Clydefrosch

    Clydefrosch GBAtemp Guru

    Member
    12
    Jan 2, 2009
    Germany
    i think what he means is you could use the program to split any file, like .avi or .mp4 or .zip.
    But I honestly don't see the point in expanding this, because this, i assume, creates the split nsp in the format that tinfoil and other installers want it, i.e. split files named 00 01 02 etc. in a folder named something.nsp with the archive bit set.

    And there's other programs that do just split anything you give them in a general way, like HJ-Split.
     
    Last edited by Clydefrosch, Nov 3, 2019
  5. masagrator

    masagrator The developper

    Member
    11
    Oct 14, 2018
    Poland
    Not exactly. Splitting files, putting them to folder and assigning archive bit for this folder makes this folder read as file on Switch. I have used that f.e. to put 13GB file for Xenoblade 2 layeredfs to FAT32.

    And Tinfoil, etc. Doesn't matter.
     
    Last edited by masagrator, Nov 3, 2019
  6. Aionmagan
    OP

    Aionmagan Member

    Newcomer
    1
    Dec 11, 2014
    Puerto Rico
    Ciales
    oh thank you for the clarification, if that is so what the other user meant then yes i see no point
    and yes it does exactly what tinfoil and alike are expecting

    i will be studying other formats (file.extensions) and is if i will need to add those in as well, it would only be
    5 to 10 lines of extra code but it's good practice

    — Posts automatically merged - Please don't double post! —

    so what exactly do you mean for every file, could you elaborate a bit more ?
     
  7. masagrator

    masagrator The developper

    Member
    11
    Oct 14, 2018
    Poland
    Filesystem on Switch works as this:
    Put splitted files to one folder
    Rename files in that way they will be sorted in correct order (f.e. 00, 01, 02)
    Set archive bit for this folder

    And Switch will read this folder as file. NSP, zip, MP4 - doesn't matter.

    Tinfoil is using Switch filesystem to read files, so it's not about compability with homebrew, but compability with Switch filesystem.
     
  8. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    19
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Mar 17, 2010
    Norway
    Alola
    You could, but zip and rar already support splitting into multiple parts, and there would not be much point in splitting a video file for example, over just archiving it in multiple parts with "store" compression, as you wouldn't be able to play it while it's split up. Plus, numerous generic tools for splitting files likely already exist, no point in reinventing the wheel.
     
  9. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    12
    Apr 20, 2007
    United States
    This is great, thanks for the mention. If you want to make the app a little more friendly, consider setting the folder's archive bit so the user doesn't need to do so manually:
    Code:
    File.SetAttributes(dir, FileAttributes.Archive);
     
  10. Aionmagan
    OP

    Aionmagan Member

    Newcomer
    1
    Dec 11, 2014
    Puerto Rico
    Ciales

    oh, this is awesome information thank you, i didn't know so
    but wouldn't it be a bit confusing for a user tho ?

    the reason i limited to .nsp was because of my friend (a user) being a monkey in essence

    i could extend supported files but i first have to study standardized formats for the switch
    or if you could pain a more open scenario where having any file be supported be a good idea (other then developer testing)
     
  11. Clydefrosch

    Clydefrosch GBAtemp Guru

    Member
    12
    Jan 2, 2009
    Germany
    I guess removing the limitation to only .nsp would allow other files to be used in fat32.
    I wasn't aware layerdfs files even came in such sizes, i always assumed that stuff would be split in 4gb parts during extraction anyways.

    I guess if it ever came to that, this could be used to split, say, a large .iso file for some emulator?

    I have no idea if this is easy or hard to implement, but some programs that allow you to import files give you that dropdown menu where the inital choice is a limited standard format, like .nsp, but you also get the chance to switch to 'show all'?

    The average user would just go for the nsp then and anyone who knows this works for something else could go that way too.
     
    Last edited by Clydefrosch, Nov 3, 2019
  12. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    12
    Apr 20, 2007
    United States
    You're missing the point. The Switch's file system will take any folder that has split contents (in the form of 00, 01, 02, etc) and the archive bit set and treat it as a normal file. This is unique to the Switch. So if you had a file, any file, be it a video or LayeredFS file or anything that's over 4GB, you can split it using this same method and the Switch will read it as a regular file. Typical splitting methods that are used for ZIPs or are made to eventually recombine files are not the same.
     
  13. Aionmagan
    OP

    Aionmagan Member

    Newcomer
    1
    Dec 11, 2014
    Puerto Rico
    Ciales
    will do thank you, will take that advice
     
  14. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    19
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Mar 17, 2010
    Norway
    Alola
    No, the person I was replying to was missing the point. What I was trying to say is that making this a more general purpose tool would be kind of pointless, and it makes more sense as a Switch-unique tool ;)
    The archive bit should work for any file type on Switch, right? Although I am not sure if there is much purpose to using it for other file types right now as ROMs/ISOs for retro consoles don't get very big, there is not really a decent native video player for HOS yet, and TX have their own split XCI support.
    But I could see it being useful for splitting up video files in the future, since ExFAT is not really recommended and a movie can easily be 10-20GB big.
     
    Last edited by The Real Jdbye, Nov 3, 2019
  15. Aionmagan
    OP

    Aionmagan Member

    Newcomer
    1
    Dec 11, 2014
    Puerto Rico
    Ciales
    so by what i am understanding it could be possible to split a file of your choosing and use it normally on switch just by having an archive bit ? so like a movie a song and what not as long as it's a folder.extension with an archive bit ?
     
  16. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    12
    Apr 20, 2007
    United States
    Still missing it. They want the tool to be able to split ANY file for use exclusively WITH THE SWITCH. Since it splits files in accordance to the Switch's filesystem behavior.

    — Posts automatically merged - Please don't double post! —

    Correct. In fact, you can use this tool to split any file right now, just add '.nsp' to the end of the file name before splitting, then take the '.nsp' off from the folder name after splitting. Any file works including large romFS files for LayeredFS mods.
     
  17. The Real Jdbye

    The Real Jdbye Always Remember 30/07/08

    Member
    19
    GBAtemp Patron
    The Real Jdbye is a Patron of GBAtemp and is helping us stay independent!

    Our Patreon
    Mar 17, 2010
    Norway
    Alola
    Yeah, I just realized that was a possibility, if you read my edit. It was not really obvious from his post if he meant on the Switch, or for general use though.
     
  18. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    12
    Apr 20, 2007
    United States
    I did not see your edit, but yes. The only other thing I use it for right now is LayeredFS stuff. Some games put their romFS files inside large 13GB+ archives. To modify the game you need to extract that archive, alter the files inside, repack the archive and then place that 13GB+ archive file on your SD for LayeredFS. Since I use Fat32, I have to split the file for it to work, but it does indeed work.
     
    The Real Jdbye likes this.
  19. Aionmagan
    OP

    Aionmagan Member

    Newcomer
    1
    Dec 11, 2014
    Puerto Rico
    Ciales
    ok this is new information to me, i'll look into it, is very hard to create a useful tool without even owning the Switch system, so thank you very much for all this information, now one simple question, do you recommend it as a general switch purpose tool or have any limitations to it ?
     
  20. AnalogMan

    AnalogMan ultraSuMoFramework Dev

    Member
    12
    Apr 20, 2007
    United States
    Honestly, keep it as it is, just make it so when you click on Browse and it opens the file dialog, change openFile.Multiselect to true and add a "All files (*.*)|*.*" file filter. That'll let people select any file if they choose while still keeping NSP as the default selection.
     
    Aionmagan likes this.
Quick Reply
Draft saved Draft deleted
Loading...