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 > Bitmap BG access Problem

#63460 - dieudunet - Tue Dec 13, 2005 10:11 am

Hi guys,

i got a problem while trying to draw a circle on a 256 color bitmap BG

I use mode 5, and i got the first background as Txt background mapped into VRAM_A

I have the BG 3 mapped into the VRAM_B as a 256 color bitmap BG
i also map the second half of the VRAM_B to be use as a backbuffer for this background

So i see my BG3 on the screen, and i draw a circle on the backbuffer , then i switch the backbuffer on the Screen ( by changing the BG_MAP_BASE of the BG 3 ), then i use the first part of the VRAM_B as backbuffer...and so on

This work well on all emulator like Ensata , Ideas .... but on the real hardware with a Supercard and Superpass i see my bg but not my circle....

Does the NDS block the screen and do not authorize me to access it ???
I put a WaitForVBlank just before to be sure that the screen has just finish...
but i can see my circle..................

Does anyone know why this don't work on real hardware but is ok on ensata ????

thank a lot

#63465 - Tobin - Tue Dec 13, 2005 10:51 am

Maybe you have forgotton to reset the rotation of the background:
Code:

   BG3_XDY = 0;
   BG3_YDX = 0;
   BG3_XDX = (u16)(1 << 8);
   BG3_YDY = (u16)(1 << 8);
   BG3_CX = 0;
   BG3_CY = 0;

#63472 - dieudunet - Tue Dec 13, 2005 12:59 pm

Tobin wrote:
Maybe you have forgotton to reset the rotation of the background:
Code:

   BG3_XDY = 0;
   BG3_YDX = 0;
   BG3_XDX = (u16)(1 << 8);
   BG3_YDY = (u16)(1 << 8);
   BG3_CX = 0;
   BG3_CY = 0;


i do the change but this do not work, i see the BG0 but the BG3 is not update

#63473 - dieudunet - Tue Dec 13, 2005 1:27 pm

I precise a few things because i can't find

it seems that my NDS ( real hardware ) can't write directly in VRAM while using a BITMAP bg of 256Color ( so 8bit value )

it works well if i switch it into a True Color ( so 16 bit value )

Does anyone know Why ?

#63476 - Tobin - Tue Dec 13, 2005 2:06 pm

I have another idea. You have to write 2 bytes at once to the vram. If you just write one byte, it will not display correct. That's the reason it is displayed if you use true color.
Look here for some details (it is the same on the gba):
http://user.chem.tue.nl/jakvijn/tonc/bitmaps.htm

Hope that helps

#63478 - dieudunet - Tue Dec 13, 2005 2:41 pm

Tobin wrote:
I have another idea. You have to write 2 bytes at once to the vram. If you just write one byte, it will not display correct. That's the reason it is displayed if you use true color.
Look here for some details (it is the same on the gba):
http://user.chem.tue.nl/jakvijn/tonc/bitmaps.htm

Hope that helps


YEAH you're totally right
i love you guys

know i return to my aquarium simulation :P

Tanks a lot