New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ability to trim XCI files from UI #6045
base: master
Are you sure you want to change the base?
Add ability to trim XCI files from UI #6045
Conversation
Is there the possibility of adding a button to do all available XCIs ? |
Thanks for your enquiry Vaskiemaia, we could add a menu item option to process all current XCI games in the library, however, it would need a more complicated user interface I feel, as the user would want to know the progress of each file as its processed and what the outcome is, but I don't see why not. Let's see if we can get this in first and then I will look at a new menu item which can process them in bulk as a further enhancement. Cheers. |
Hey, |
Thanks for testing it for me Niwu34, and I know what you mean about the concurrent processing issue, we have a few options here:
Happy for other suggestions? |
Leaving it as it is almost seems to be the best variant for now? With the feature @Vaskiemaia suggested you could only allow one 'manual trim' at a time. |
I agree, by pressing on the Trim All it would just go through the list one by one. |
Download the artifacts for this pull request: Experimental GUI (Avalonia)GUI-less (SDL2)Only for Developers
|
I don't think it is an emulator job to do any kind of modification to the ROM files, why can't users use an external tool for this and where do we draw the line? (I can see people requesting the ability to remove the update section from XCIs, convert between NSP and XCI, create compressed ROMs, merging DLCs and updates etc in the emulator if this is accepted).
None of those are issues that can only be addressed on a emulator, someone could just create a better tool. We have a |
For what it's worth a few different emulators have similar abilities including Dolphin. Maybe it could be under tools instead of a context menu as you suggested, but I personally believe it's still something worthwhile for users |
No problem gdkchan, thanks for the feedback, so a bulk change option in the Tools menu would be supported by yourself or do you feel it’s better to just leave it out completely? |
I agree with gdkchan that this is likely better suited as an external 3rd party tool, rather than being added into the emulator itself. Personally, the issue I have with adding functionality like this is that it's often PR'ed into the emulator, and then abandoned by the original commiter weeks or months later, leaving the core Ryujinx team to support and maintain an ever growing scope of functionality, most of which is not core to the function of the emulator itself. We end up spending more time maintaining superfluous functionality of the emulator, rather than working on the core emulation technology itself. I think this is useful functionality, but why not bundle it into a 3rd party tool and release it? If you want to integrate it nicely with the emulator, you can easily detect the Ryujinx config, extract the ROM paths, and display a list of ROM's in your own UI for trimming. |
Are the trimmed files playable on other platforms like android, or is this just compatible with Ryu with the implementation? Also what about .NSP trimming? Would feel incomplete without it if it was made a feature. |
NSP's shouldn't need trimming, as they're eShop dumps. XCI's need trimming because they're a disk image format, and Nintendo Carts come in fixed sizes (ie. 8GB, 16GB etc). If a game is only 5GB but distributed on an 8GB cart, the XCI will be 8GB, with 3GB of "nothing" sitting in it. That's what trimming is designed to remove. |
it doesn't trim files with keyarea nxdumptool can trim keyarea dumps, Splatoon 3 was used for both tests i did try smb wonder just to make sure it wasn't just splatoon 3 keyarea Splatoon 3:
keyarealess Splatoon 3:
keyarea SMB Wonder:
|
Thank you @piplup55 for picking this up, shouldn't be difficult to fix. |
Hey @piplup55 , I have made some code changes for this, but have not been able to test them yet as I cannot get hold of a ROM that includes the KeyArea, so am unable to test it, will keep looking to see if I can get a hold of one. Thanks. |
enable prepend key area in nxdumptool |
I was able to use this to trim my dump of TOTK from around 32GB to 17.126GB. I can't really speak for piplup's issue since I don't have any dumps with key area. Do trimmers usually not read the whole XCI header for trimming? |
Most of them don’t as they don’t really need to, even with the key area they still don’t need to, there is no reason they can’t read it properly though.I have updated the code to support keyarea xci files, please let me know if any issues. |
46f2baf
to
ccbbadd
Compare
9ab8945
to
bf23d18
Compare
Enhancement
XCI files can take up a lot of unnecessary space if they are not trimmed, although there are third party tools to trim these files, most of them are clunky, difficult to use and slow to check the free space data.
This change adds a new menu item "Check and Trim XCI File" to the right click context menu of games in the library. The menu item is only enabled if the XCI file is compatible and has not already been trimmed. After selecting the menu item the user is informed how much data they can save, if the user decides to continue the Free Space will be scanned to make sure there is no data (only ASCII 0xFF characters) and the the file will be trimmed in place usign SetLength. This new functionality also uses parallel processing to process the free space data in order to ensure efficient execution, but is still limited by the speed of the disk.
The status progress bar will indicate the free space processing progress, if the operation fails it will be reported to the user, if it succeeds it will succeed silently.
NOTE: New Locale items have not been translated to other languages yet.
Tested in WIndows and MacOS (Ava), however, I am unable to test in Linux, I would welcome anyone who has the time to test this functionality on that platform.