d0k3 / GodMode9

GodMode9 Explorer - A full access file browser for the Nintendo 3DS console :godmode:
GNU General Public License v3.0
2.16k stars 194 forks source link

[FEATURE REQUEST] usability SD card free lookup/display in scripting? #691

Closed clach04 closed 3 years ago

clach04 commented 3 years ago

Describe the feature you'd like

Support to display:

Megascript for backing up sysnand https://github.com/d0k3/GodMode9/blob/master/resources/gm9/scripts/GM9Megascript.gm9#L28 recommends having enough free storage space on the SD card. But no concrete specifics.

Describe alternatives you've considered

clach04 commented 3 years ago

I'm very new to 3DS and HomeBrew, I posted a quick PR that attempts the later option rather than the feature request.

This would have helped me greatly if it had been present.

Thanks for making gm9 available!

d0k3 commented 3 years ago

Thanks! I'll look into it later and will merge or get back about any issues!

d0k3 commented 3 years ago

Okay, I've got something for you. Scripting now has $[SDSIZE], $[SDFREE] and $[NANDSIZE] global variables. I guess you could improve on your commit using these. Take not, however, that on large SD cards, calculating the free space can take some time. You need to test and account for this.

Here's the build with the new possibilities: https://f.secretalgorithm.com/12cbfv/godmode9.firm

clach04 commented 3 years ago

@d0k3 Works great! 👍 Thanks for doing this.

Managed to grab a few mins to play with it. On my 64Gb card, I did not notice any speed penalties. :)

I posted a comment on https://github.com/d0k3/GodMode9/commit/0825139cb2fcda3ec6de13b3b7590eabd517ad54#commitcomment-49067727

I have a dumb test at https://github.com/clach04/GodMode9/commit/d5ae9839bb0d878dbdea26c8a1833f645765c4bb which works for me (but the previous dialog question is still the same, will try and find time to clean this up)

clach04 commented 3 years ago

My 3ds died (screen, unrelated to this) so not sure when I can get back to this :(

d0k3 commented 3 years ago

Oh well, that's bad. After all the 3DS is not as solid a piece of hardware as f.e. the DMG Gameboy was. Feel free to do a pull request one you're able to continue on this.