-
Notifications
You must be signed in to change notification settings - Fork 3
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
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Hey PK! Thanks for the kind response and suggestions. Right now I've
jettisoned the save-state stuff which saved about 300kb and moved the
"fast" 16-bit memory space (128K) into Video Memory to save enough room
that everything is okay for both DS and DSi. So the pressure is off
temporarily :)
My new big concern is trying to read in a .BMP and display on the lower
screen which is in 8bpp 16-bit tiled mode. I can read the .BMP but I don't
yet understand tiled formats so it's not rendering right (lots of spotches
of the right colors... but looks a mess). I tried to re-init the bottom
screen in 8bpp BMP mode and got an assertion from libnds at run-time.
Dave
…On Thu, Sep 9, 2021 at 4:24 PM Pk11 ***@***.***> wrote:
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
<https://github.com/DS-Homebrew/TWiLightMenu/blob/master/romsel_dsimenutheme/arm9/source/common/nitrofs.c>,
nitrofs.h
<https://github.com/DS-Homebrew/TWiLightMenu/blob/master/romsel_dsimenutheme/arm9/source/common/nitrofs.h>,
and it also needs tonccpy.c
<https://github.com/DS-Homebrew/TWiLightMenu/blob/master/romsel_dsimenutheme/arm9/source/common/tonccpy.c>,
tonccpy.h
<https://github.com/DS-Homebrew/TWiLightMenu/blob/master/romsel_dsimenutheme/arm9/source/common/tonccpy.h>)
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 😄
------------------------------
You can view, comment on, or merge this pull request online at:
#2
Commit Summary
- Move overlay images to NitroFS
File Changes
- *M* Makefile
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-76ed074a9305c04054cdebb9e9aad2d818052b07091de1f20cad0bbac34ffb52>
(12)
- *M* arm9/Makefile
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-9265af7c0b8078c14149f19fb152a490691c055a1c20ae46e29e9a931075b99b>
(2)
- *M* arm9/source/ds_tools.cpp
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-b94428ec1f68ee416388048743e393de32d1486f0337c988c843ac3021dcf86d>
(147)
- *M* arm9/source/main.cpp
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-6e11e0ddedbbc710bfddee81f19bad2acf078fe4415d5af105c4bd3c8b56dd9b>
(21)
- *A* overlays/Makefile
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-9f71170c3f6d7ab99bebd4ae1d43d58623f367a15f0482629b90b31673d05354>
(21)
- *R* overlays/bgBottom-astro.png
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-f3dd9a4f688d76d869f60109397811ee40f8d63f06b1b3ab312798d6468688d1>
(0)
- *R* overlays/bgBottom-atlantis.png
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-d27b298a55a6f7b936ce64e5d1d8546662c9a313f9a4afcc8cc7239a4f43fac1>
(0)
- *R* overlays/bgBottom-b17.png
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-1bfff7342e108777e8818fe63eed3b4c1c1dd95f504224d8e968d42c947bfc71>
(0)
- *R* overlays/bgBottom-bombsquad.png
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-00924424cc2615d4bba64a0c1b1f196ae176e951adb5fd14050a6ac119ed8fc9>
(0)
- *R* overlays/bgBottom-cloudy.png
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-040ebf4f50c6cc8aa1503b1a2429ec6fe4b0876aa2602176bda040066af35da9>
(0)
- *R* overlays/bgBottom-empty.png
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-7e7772dbac45809282268e406bfa476135a580ff18b9610a9687bcaf6508f8fe>
(0)
- *R* overlays/bgBottom-spartans.png
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-a8c6b5fb1cf07b8a42248023335de933ae33aab9b2d9ce96716b89a460f8d313>
(0)
- *R* overlays/bgBottom-swords.png
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-f220cc0bc3f6cd46f0ee03e10baf936524c2575e660eb884e2577bed80e8d484>
(0)
- *R* overlays/bgBottom-treasure.png
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-571f11b04ec84ab56728e2c562998f644a275bbc2f0358539dd3f83e3578da1a>
(0)
- *R* overlays/bgBottom-utopia.png
<https://github.com/wavemotion-dave/NINTV-DS/pull/2/files#diff-11275ea1353b4364a6d9a417ab06f4a6b43e76a31de86c7c73b89c51573caae5>
(0)
Patch Links:
- https://github.com/wavemotion-dave/NINTV-DS/pull/2.patch
- https://github.com/wavemotion-dave/NINTV-DS/pull/2.diff
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AR4QIXPLCXHIQHIGY76LZVLUBEJWPANCNFSM5DX5KDXA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
|
Closing as this has been implemented differently now. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 😄