#92957 - Valmond - Sat Jul 15, 2006 11:19 pm
Hi everybody !
I'v run into this problem, and after well a whole day of checking & controling
I thought it was maybe time to ask the experts :)
BTW, the code is run in Dualis and on a real DSlite.
Well, I have written this VRam manager for sprites, I "register" all images
I want to use (once) and every frame I ask it to draw sprites on screen.
If the image is loaded in VRAM it "draws" it with a sprite, otherwise
it loads it and then draws it (frees up non used mem and so on).
So the problem is that when I draws more than 32 different images, the
33:d shows up like the first one.
I use 32*32 256color sprites for testing so those 32 images should just eat 32kb out of the 128kb in bank B...
I use
vramSetBankB(VRAM_B_MAIN_SPRITE); // 128kb
but if I change to
vramSetBankF(VRAM_F_MAIN_SPRITE); // 64kb
then it wraps around on a 16kb boundary.
I have tried to disable the VRam manager, just write the first image
to the first 32*32byte space and so on, but this doesnt change anything.
I also tried to write everything 2048 bytes further up but it just eated up
two sprites... (they became invisible, like if I hadn't written anything to them)
So it is like i have a short somewhere that wraps around... but I don't :-(
(except that with VRAM_F, it wraps on 14 bits)
I'v checked my code quite much, the defines in libnds too :p
but I'm stuck.
Does Sprite mem have special behaviour or should I go back
continuing searching my code ?
thanks for the time :)
/Valmond
I'v run into this problem, and after well a whole day of checking & controling
I thought it was maybe time to ask the experts :)
BTW, the code is run in Dualis and on a real DSlite.
Well, I have written this VRam manager for sprites, I "register" all images
I want to use (once) and every frame I ask it to draw sprites on screen.
If the image is loaded in VRAM it "draws" it with a sprite, otherwise
it loads it and then draws it (frees up non used mem and so on).
So the problem is that when I draws more than 32 different images, the
33:d shows up like the first one.
I use 32*32 256color sprites for testing so those 32 images should just eat 32kb out of the 128kb in bank B...
I use
vramSetBankB(VRAM_B_MAIN_SPRITE); // 128kb
but if I change to
vramSetBankF(VRAM_F_MAIN_SPRITE); // 64kb
then it wraps around on a 16kb boundary.
I have tried to disable the VRam manager, just write the first image
to the first 32*32byte space and so on, but this doesnt change anything.
I also tried to write everything 2048 bytes further up but it just eated up
two sprites... (they became invisible, like if I hadn't written anything to them)
So it is like i have a short somewhere that wraps around... but I don't :-(
(except that with VRAM_F, it wraps on 14 bits)
I'v checked my code quite much, the defines in libnds too :p
but I'm stuck.
Does Sprite mem have special behaviour or should I go back
continuing searching my code ?
thanks for the time :)
/Valmond