#107538 - ollhak - Mon Oct 30, 2006 5:49 pm
First of all, greetings to all on this board! I'm new to the DS but I've done some GBA work in the past - and now I'm hoping for some help to clear up some details I haven't been able to grasp by myself. I basicly need as much sprite memory (VRAM - I guess I could do some swapping from the DS-card if that is fast enough, though) as possible - how would I have to set up the memory banks?
As far as I've understood, the maximum amount of sprite memory I can get is 256kb by using both bank A and B for it. Do anyone know of any tricks to increase this limit? About BG-memory, I don't think I'll need more than 128kb so one bank should be enough.
Thanks in advance for any help!
#107584 - ProblemBaby - Tue Oct 31, 2006 3:53 am
you can use 3d hardware.. 2048 sprites and up to 512kb of data
#107585 - tepples - Tue Oct 31, 2006 3:58 am
You can load sprite cels into main RAM (the EWRAM is now sixteen times as big as it was on the GBA, although it contains the running code just as it did for GBA multiboot) and then swap those into VRAM.
What kind of game are you talking about, so that we can figure out how much sprite cel VRAM you'll really need? How many sprites do you expect to have on the screen at once, and how big?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#107624 - ollhak - Tue Oct 31, 2006 5:47 pm
I've heard about using the 3d hardware that way before, sounds like an interesting last resort if I can't get all the data to fit.
About the game, I can't go into any details but its a port of a previous project so I'm pretty sure about the limitations. The most VRAM-usage comes from animations and a wide variety of units that might be displayed at the same time - a pretty lousy situation while working with the GBA/DS-hardware because of the sprite system :/
#107629 - tepples - Tue Oct 31, 2006 6:20 pm
Are the units about 16x16 pixels in size? If so, you can fit 16-color sprite cels for each of 128 on-screen units into 16 KB.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.
#107660 - ollhak - Tue Oct 31, 2006 11:36 pm
Well, they still need their animations - and the more space for animations, the easier the port will be (starting with about 5MB worth of objectgfx-data). Besides, I think I've figured out the limitations a bit better now - 256kb vram still only gives 1024 maximum sprite tiles (though in 16 bit color) right? If so, the 3d-hardware option seems even more interesting.. I can't think of any obvious disadvantages - except for slower drawing. I'll probably need around 600 textured quads or so for some scenes (200 for sprites, about 400 for drawing the background with 16x8-tiles) - anyone have even a vague idea on how much slower this will be to render than the 2d alternative?
#107661 - Lick - Tue Oct 31, 2006 11:41 pm
You can cleverly copy them from Main RAM to VRAM when you need them. I don't think it's necessary to have all the sprites in the VRAM at once, since the screen won't fit them all.
This method requires some more code, though.
_________________
http://licklick.wordpress.com
#107677 - tepples - Wed Nov 01, 2006 3:20 am
ollhak wrote: |
Well, they still need their animations |
Lick is right: these can live mostly in DS EWRAM. See my white paper about sprite cel swapping, which was written about the GBA but applies equally well to the DS.
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.