gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

DS development > VRAM 16bit sprite

#139148 - ghuldan - Sun Sep 02, 2007 8:43 pm

How much 32x32 16bits sprite can i store in VRAM ?

96000 / (32x32 x (2bytes) = 46 ?

is that right ?

#139157 - Dwedit - Sun Sep 02, 2007 10:41 pm

1k = 1024, not 1000.

Replace 96000 with 98304.
_________________
"We are merely sprites that dance at the beck and call of our button pressing overlord."

#139161 - tepples - Mon Sep 03, 2007 12:22 am

It depends on which VRAM mapping you are using. If you're using the typical 2D mapping (A main bg, B main sprite, C sub bg, D sub sprite), you have 131,072 bytes, or a 256x256 pixel high-color sprite sheet, for each screen. With a more 3D-oriented mapping (A-D textures, E main bg, F texture palettes, G main sprite, H sub bg, I sub sprite), you have only 16,384 bytes, or a 256x32 pixel sprite sheet, per screen. You can make the most of limited memory by rewriting the sprite sheet during vertical blanking, just as was done on the GBA.

But is there a reason for using 16-bit high-color sprite cels rather than 4-bit or 8-bit sprite cels in indexed color?
_________________
-- Where is he?
-- Who?
-- You know, the human.
-- I think he moved to Tilwick.

#139162 - ghuldan - Mon Sep 03, 2007 1:07 am

There is a very good reason : i want to code specials effects which are impossible to implement on indexed sprites.