Skip to content
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

Move overlay images to NitroFS #2

Closed
wants to merge 2 commits into from

Conversation

Epicpkmn11
Copy link

@Epicpkmn11 Epicpkmn11 commented Sep 9, 2021

I saw you mentioning memory trouble and I took a little look and saw you're embedding all the overlay images in the ARM9 binary which is I think is wasting somewhere around 187 KB with all of them (and will grow if you add more) so this moves them to NitroFS so that they're only loaded in when needed.

This does have the drawback of that it won't load the overlays if loaded from something without ARGV support (basically anything besides TWiLight Menu++, nds-hb-menu, and GodMode9i) since I used the official devkitPro NitroFS code, you can work around that though if you want by using the NitroFS code TWiLight Menu++ and such use (nitrofs.c, nitrofs.h, and it also needs tonccpy.c, tonccpy.h) as that code can try load from hardcoded places (such as what I did in pkmn-chest). I didn't do that though since TWiLight is GPL-3 and this doesn't have a license so I'm not sure if that would be allowed. It does still load the default fine though.

This could also be easily modified to load overlays from SD instead of bundling them in the ROM itself if you wanted, which could be useful if you make a lot and/or want easy custom overlay support, just take the GRF loading code but point it to a GRF file on the SD card instead of NitroFS, could just remove the NitroFS requirement entirely and just load from SD I suppose.

Please let me know if you want me to change anything 😄

@wavemotion-dave
Copy link
Owner

wavemotion-dave commented Sep 14, 2021 via email

@wavemotion-dave
Copy link
Owner

wavemotion-dave commented Sep 14, 2021 via email

@Epicpkmn11
Copy link
Author

Closing as this has been implemented differently now.

@Epicpkmn11 Epicpkmn11 closed this Nov 2, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants