Auto-Trim ROM option question

Ask questions about DraStic or discuss compatibility issues here.
Post Reply
mark_k
Posts:9
Joined:Tue Sep 22, 2015 10:13 am
Auto-Trim ROM option question

Post by mark_k » Tue Sep 22, 2015 10:29 am

What exactly does the Auto-Trim ROM option do? drastic_readme.txt says
"Will only data from the ROM up to the length specified in its header. This can enable large games to be played on devices that otherwise have problems with them."

I think a word is missing. :)

Does Auto-Trim ROM mean that DraStic only loads the trimmed amount of data from the .nds file? Or does it mean that on auto-uncompressing a game, only the trimmed length is extracted from the archive? Or does it mean that DraStic trims any loaded game file, truncating its size? (I guess not for the last point since uncompressed game file sizes didn't change for me.)

Exophase
Posts:1715
Joined:Mon Aug 05, 2013 9:08 pm

Re: Auto-Trim ROM option question

Post by Exophase » Tue Sep 22, 2015 3:42 pm

Auto-trim only affects how games are loaded, it doesn't modify the ROM files, nor does it change the size of the file that's uncompressed for compressed ROMs. The ROM file is mapped to the app's address space, if auto-trim is set it'll only map the trimmed part of the file.

mark_k
Posts:9
Joined:Tue Sep 22, 2015 10:13 am

Re: Auto-Trim ROM option question

Post by mark_k » Tue Oct 06, 2015 10:14 am

Thanks for that. Perhaps that could be an enhancement for a future version:
When using zipped ROMs, have an option to only unzip the trimmed length of the ROM. That should save time and reduce wear on the SD card.

Also, I may as well use this thread to give a suggestion relating to the Enable uncompress to file option. When I tested that (it was a while ago using the trial version of DraStic), it seemed that every time I chose a new game, DraStic unzipped the archive to a temp file in its directory on the SD card, deleting the previous unzipped game file. That can take a very long time.

Apart from making loading games very slow if you switch between games a lot, that causes a lot of wear to the SD card. How about an option to do this:
- Automatically uncompress archives, but if the uncompressed file already exists in DraStic's directory use that directly instead of unzipping.
- Don't delete any uncompressed files automatically.

The use case for this would be if the user has a large-capacity SD card with plenty of free space (e.g. 128GB). They can store their games zipped, but as they play each game the already-unzipped files will be used more and more. If in future space becomes a little tight, the user can use a file manager to delete some unzipped ROMs to save space, retaining the ability to play those games in future (since DraStic would automatically unzip the game if needed).

Fefo
Posts:263
Joined:Sat Oct 26, 2013 8:59 pm

Re: Auto-Trim ROM option question

Post by Fefo » Tue Oct 06, 2015 10:08 pm

I doubt there's any time lost reading the "trimmable" space, as it should be blank, and keeping an uncompressed copy would defeat the purpose by wasting even more space with both.

Overall, unless you want to keep very large game libraries on limited spaces, compression is a waste of time. I did it once to mine, and while I saved roughly 1/3 of storage, it was a huge waste of time. Do it to a backup, but keep the main one uncompressed.
BE ATTITUDE FOR ENGRISH

Exophase
Posts:1715
Joined:Mon Aug 05, 2013 9:08 pm

Re: Auto-Trim ROM option question

Post by Exophase » Sat Oct 10, 2015 6:35 pm

mark_k wrote:Thanks for that. Perhaps that could be an enhancement for a future version:
When using zipped ROMs, have an option to only unzip the trimmed length of the ROM. That should save time and reduce wear on the SD card.
Yes, that makes sense. I'll see about getting that in.
mark_k wrote:Also, I may as well use this thread to give a suggestion relating to the Enable uncompress to file option. When I tested that (it was a while ago using the trial version of DraStic), it seemed that every time I chose a new game, DraStic unzipped the archive to a temp file in its directory on the SD card, deleting the previous unzipped game file. That can take a very long time.

Apart from making loading games very slow if you switch between games a lot, that causes a lot of wear to the SD card. How about an option to do this:
- Automatically uncompress archives, but if the uncompressed file already exists in DraStic's directory use that directly instead of unzipping.
- Don't delete any uncompressed files automatically.

The use case for this would be if the user has a large-capacity SD card with plenty of free space (e.g. 128GB). They can store their games zipped, but as they play each game the already-unzipped files will be used more and more. If in future space becomes a little tight, the user can use a file manager to delete some unzipped ROMs to save space, retaining the ability to play those games in future (since DraStic would automatically unzip the game if needed).
The thing is, if the app uncompresses every ROM it'll defeat the purpose of supporting compressed ROMs in the first place since you'll no longer be saving space. Actually, it'll be worse since you'll now have both the compressed and uncompressed files taking up space. If you have a huge SD card and don't care about wasting the space it's by far in your best interest to manually decompress the ROMs.

The best compromise may be to allow a user configurable cache size, where it'll delete previously uncompressed ROMs to make room for new ones in a least recently used fashion.

Of course, the other option is to disable uncompress to storage altogether and rely on uncompressing to RAM, but Android devices are so stingy with address space this can quickly become an issue even on devices with a lot of RAM. It's something worth trying though; recent versions should uncompress to file if uncompress to RAM fails, but sometimes memory failure isn't graceful or obvious and therefore it'll still just crash later.

mark_k
Posts:9
Joined:Tue Sep 22, 2015 10:13 am

Re: Auto-Trim ROM option question

Post by mark_k » Mon Oct 12, 2015 11:50 am

Exophase wrote:The thing is, if the app uncompresses every ROM it'll defeat the purpose of supporting compressed ROMs in the first place since you'll no longer be saving space. Actually, it'll be worse since you'll now have both the compressed and uncompressed files taking up space. If you have a huge SD card and don't care about wasting the space it's by far in your best interest to manually decompress the ROMs.

The best compromise may be to allow a user configurable cache size, where it'll delete previously uncompressed ROMs to make room for new ones in a least recently used fashion.
That would work for me (just include a never-automatically-delete-unzipped-ROMs option). At the moment my SD card has ~100GB free so I don't care if the unzipped ROMs waste space. In future when space gets tighter though, I could just delete them with a file manager (or maybe there could be an option in DraStic to delete all auto-unzipped ROMs, or e.g. delete all but the n most recently played), but still have DraStic unzip automatically.

Post Reply