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 > Sprite memory issue?

#68517 - knight0fdragon - Wed Jan 25, 2006 8:28 am

OK now reading some of the examples I come across this in an example

vramSetMainBanks( VRAM_A_MAIN_SPRITE, //A and B maped consecutivly as sprite memory
VRAM_B_MAIN_SPRITE, //this gives us 256KB which is the max
VRAM_C_MAIN_BG_0x6000000, //map C to background memory
VRAM_D_LCD //not using D
);


now from what I am understanding, this is 256KBytes of RAM.

but if I were to use the SPRITE+GFX, i cannot go past 32k with the OAM.




I would still like a way to use some more memory, this way i can make my card game

How were i go do this. because I need 212992 bytes for sprite memory

my formula (W33 * H49) * Spr52 .. (becomes (W64 * H64) * Spr52
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206

#68546 - nmain - Wed Jan 25, 2006 4:54 pm

knight0fdragon wrote:
OK now reading some of the examples I come across this in an example

vramSetMainBanks( VRAM_A_MAIN_SPRITE, //A and B maped consecutivly as sprite memory
VRAM_B_MAIN_SPRITE, //this gives us 256KB which is the max
VRAM_C_MAIN_BG_0x6000000, //map C to background memory
VRAM_D_LCD //not using D
);


now from what I am understanding, this is 256KBytes of RAM.

but if I were to use the SPRITE+GFX, i cannot go past 32k with the OAM.




I would still like a way to use some more memory, this way i can make my card game

How were i go do this. because I need 212992 bytes for sprite memory

my formula (W33 * H49) * Spr52 .. (becomes (W64 * H64) * Spr52


Make each card 32 x 48 and use two OAM entries to draw it; one 32x32 and one 32x16. total vram needed for sprite tiles becomes 78K at 8bpp or 39K at 4bpp. If you need to get it down more you probably can; put on the thinking cap ;)

#68552 - knight0fdragon - Wed Jan 25, 2006 5:39 pm

yea, i have been thinkin about doing stuff like that, I was just hoping that i was able to have more then the 32K that the OAM has to offer, like perhaps theres another OAM or something that points to a different set of memory( and i do not mean the Sub one). Oh well though back to the drawing board. I will have to pull some fancy manuvering to reduce it to 32K, like drawing only half the diamonds and what not
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206

#68558 - nmain - Wed Jan 25, 2006 6:20 pm

knight0fdragon wrote:
yea, i have been thinkin about doing stuff like that, I was just hoping that i was able to have more then the 32K that the OAM has to offer, like perhaps theres another OAM or something that points to a different set of memory( and i do not mean the Sub one). Oh well though back to the drawing board. I will have to pull some fancy manuvering to reduce it to 32K, like drawing only half the diamonds and what not


Well my point was expanding to 64x64 is extremely excessive, with less than half of the used vram actually displaying anything. The dispcnt register lets you select larger amounts of vram than 32K for sprite tiles:

http://nocash.emubase.de/gbatek.htm#dsvideo

#68562 - knight0fdragon - Wed Jan 25, 2006 6:38 pm

ok i got it to do some more cards now using DISPLAY_SPR_1D_SIZE_256

all i got to do now is prob trim the cards to 31x47 (32x48) and ill have all the cards showing, im just worried about having 104 sprites used of the 128, but thats ok I will make it work if neccessary
_________________
http://www.myspace.com/knight0fdragonds

MK DS FC: Dragon 330772 075464
AC WW FC: Anthony SamsClub 1933-3433-9458
MPFH: Dragon 0215 4231 1206