#99124 - Lupi - Sat Aug 19, 2006 5:19 pm
Hi, newbie here, while I was learning some libnds with the examples in devkitPro and the orange spaceship example of the pdf guide, I got myself a bit confused by NDS Hardware and the way to load sprites and bg:
1) VRAM banks... they are used to load backgrounds and sprites, but do I need to use one of the VRAM banks for one background, or I can use for several different type of data(sprites and backgrounds)?
2) When starting a background, I have seen something like this:
BG3_CR = BG_BMP16_256x256 | BG_BMP_BASE(0) | BG_PRIORITY(3);
I know that BG_BMP_BASE(base) is used to later load the background with BG_BMP_RAM(base) in the dmaCopy function, but what does that 'base' variable represent, I don't get it :S:S
3) To load sprites..., first I load the palette, with this:
dmaCopy(test_pal_bin, SPRITE_PALETTE, test_pal_bin_size);
Then I load the sprite with this:
dmaCopy(test_bin, &SPRITE_GFX[64 * 16], test_bin_size);
Why is it loading at 64*16, and by the way, somehow it load the sprite at the position 0 of the OAM, but what if I want to load it on a different position...
And SPRITE_GFX, what part of VRam does it represent?, what's its memory limit?
4) Last one, it's about palettes, i have read you can have 1 big palette of 256 colours or 16 palettes of 16 colours, I don't quite get this palette thing, where are they stored?, in SPRITE_PALETTE, what about the BG_MAIN_PALETTE?, if I want to load several sprites that uses several palettes (converted with git I must add), how do I load a new sprite if that SPRITE_PALETTE is covered by a different one?
Sorry, too many questions here, I just can't find what do those macros mean, or loading multiple sprites without a .pcx file. You don't have to answer all of course ^_^
Thanks in advance
1) VRAM banks... they are used to load backgrounds and sprites, but do I need to use one of the VRAM banks for one background, or I can use for several different type of data(sprites and backgrounds)?
2) When starting a background, I have seen something like this:
BG3_CR = BG_BMP16_256x256 | BG_BMP_BASE(0) | BG_PRIORITY(3);
I know that BG_BMP_BASE(base) is used to later load the background with BG_BMP_RAM(base) in the dmaCopy function, but what does that 'base' variable represent, I don't get it :S:S
3) To load sprites..., first I load the palette, with this:
dmaCopy(test_pal_bin, SPRITE_PALETTE, test_pal_bin_size);
Then I load the sprite with this:
dmaCopy(test_bin, &SPRITE_GFX[64 * 16], test_bin_size);
Why is it loading at 64*16, and by the way, somehow it load the sprite at the position 0 of the OAM, but what if I want to load it on a different position...
And SPRITE_GFX, what part of VRam does it represent?, what's its memory limit?
4) Last one, it's about palettes, i have read you can have 1 big palette of 256 colours or 16 palettes of 16 colours, I don't quite get this palette thing, where are they stored?, in SPRITE_PALETTE, what about the BG_MAIN_PALETTE?, if I want to load several sprites that uses several palettes (converted with git I must add), how do I load a new sprite if that SPRITE_PALETTE is covered by a different one?
Sorry, too many questions here, I just can't find what do those macros mean, or loading multiple sprites without a .pcx file. You don't have to answer all of course ^_^
Thanks in advance