#156472 - mca - Sat May 10, 2008 10:13 am
Hi,
I'm new to this forum and to DS development. I read Patater's great manual, in which he explains sprite handling in detail.
In my first project I need to display a maximum of 63 different sprites.
Each sprite is 16 color and 16x16 pixels in size.
I use
for holding the sprite data (tiles,palette,...).
With each sprite displayed I assign a new SpriteBuffer in the OAM.
I calculate a new TileStartingAdress (address aligned to the standard 32 byte) and a new palette adress.
As long as I display fewer than 16 sprites all works fine.
Displaying any more than 15 sprites results in strange artifacts, corrupted tiledata and palette data. After placing 48 sprites it even comes to an error in the palette of the main background. I don't understand the things happening here.
Can someone shed light on this?
Is there any code example handlig with this amount of sprites?
Thanks in advance...
mca
I'm new to this forum and to DS development. I read Patater's great manual, in which he explains sprite handling in detail.
In my first project I need to display a maximum of 63 different sprites.
Each sprite is 16 color and 16x16 pixels in size.
I use
Code: |
vramSetBankE(VRAM_E_MAIN_SPRITE); |
for holding the sprite data (tiles,palette,...).
With each sprite displayed I assign a new SpriteBuffer in the OAM.
I calculate a new TileStartingAdress (address aligned to the standard 32 byte) and a new palette adress.
As long as I display fewer than 16 sprites all works fine.
Displaying any more than 15 sprites results in strange artifacts, corrupted tiledata and palette data. After placing 48 sprites it even comes to an error in the palette of the main background. I don't understand the things happening here.
Can someone shed light on this?
Is there any code example handlig with this amount of sprites?
Thanks in advance...
mca