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.

Coding > Need more memory

#5163 - yann_p - Tue Apr 22, 2003 3:28 pm

I need some help with memory allocation.

I am currently using 170 8*8 tiles, and 128 16*16 sprites but I want to store about 30 64*64 sprites. How can I setup more memory space for this?

I would be grateful for any help, cheers.

Yann.

#5171 - DekuTree64 - Tue Apr 22, 2003 4:36 pm

Wel, seeing as how you have 32K of sprite mem, and a 64x64, 16 color sprite takes 2K, the most you can have is 16 (or 8 if they're 256 color). Sorry, but that's just how it is. You can use a 32x32 sprite and scale it to 2x if you can deal with low resolution, but then you have the problem of the hardware not being able to draw that many (like in the old SNES games where if you get too many sprites lines up horizontally you start getting blank lines). But what would you need 30 64x64 sprites for? The screen would be majorly crowded if they were all showing at once, and if they aren't, then you can just copy the data in as needed.
Another good trick (which won't help here, but might come in hany sometime, or for other people), is to use a BG layer for a large sprite. That way you can have it even bigger than 64x64, and have plenty of memory for the tiles, plus being able to reuse them. Good for super-size bosses.

#5174 - Quirky - Tue Apr 22, 2003 5:50 pm

Is that how Yoshi's Island does it's crazy-sized bosses? I haven't run it in VBA to look...

#5179 - Touchstone - Tue Apr 22, 2003 6:48 pm

Quirky wrote:
Is that how Yoshi's Island does it's crazy-sized bosses? I haven't run it in VBA to look...


A good guess would be that "crazy-sized" bosses are made with BG layers and/or multiple sprites.
_________________
You can't beat our meat