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 > Text on bitmap background

#83284 - Zed0 - Mon May 15, 2006 12:30 am

I'm trying to show a image on one background and then text on another background (same screen so it is on top of the image). The text and background both display but for some reason when I do:
Code:
consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16);

A blue line comes up accross the screen (picture here).
It doesn't do this when I don't display the other background and it still does it even if I don't print any text.
Can anyone help with this?

Thanks
Zed0

Code:
   powerON(POWER_ALL);
      
   // Setup the top screen for 3D
   videoSetMode(MODE_3_3D | DISPLAY_BG3_ACTIVE);
   // Setup bottom screen
   videoSetModeSub(MODE_3_2D | DISPLAY_BG3_ACTIVE | DISPLAY_BG1_ACTIVE);

 
   vramSetMainBanks(VRAM_A_MAIN_BG_0x6000000, VRAM_B_LCD, VRAM_C_SUB_BG , VRAM_D_LCD);

   BG3_CR = BG_BMP16_256x256;
   SUB_BG3_CR = BG_BMP16_256x256;

        BG3_XDX = 1 << 8;
        BG3_XDY = 0;
        BG3_YDX = 0;
        BG3_YDY = 1 << 8;
        SUB_BG3_XDX = 1 << 8;
        SUB_BG3_XDY = 0;
        SUB_BG3_YDX = 0;
        SUB_BG3_YDY = 1 << 8;
 
        BG3_CX = 0;
        BG3_CY = 26 << 8;
        SUB_BG3_CX = 0;
        SUB_BG3_CY = 32 << 8;

   irqInit();
   irqSet(IRQ_VBLANK, 0);

// End of startup stuff

   for(int i = 0; i < 256*256; i++)
   {
      BG_GFX[i] = ((u16*)SaberTitle_img_bin)[i] | BIT(15);
      BG_GFX_SUB[i] = ((u16*)MenuBack_img_bin)[i] | BIT(15);
   }


   consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16);
   SUB_BG1_CR = BG_MAP_BASE(31);
   BG_PALETTE_SUB[255] = RGB15(31,31,31);
   // Uncomment for debugging
   iprintf("Hello World");

#83287 - knight0fdragon - Mon May 15, 2006 12:57 am

Quote:
I'm trying to show a image on one background and then text on another background


you are not doing that, right now you only have 1 background on (3)


what you need to do is enable Background 0, and have the consoleInit write to background 0
_________________
http://www.myspace.com/knight0fdragonds

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

#83311 - Zed0 - Mon May 15, 2006 8:12 am

Code:
   videoSetModeSub(MODE_3_2D | DISPLAY_BG3_ACTIVE | DISPLAY_BG1_ACTIVE);

Doesn't that enable background 3 and 1?

#83321 - knight0fdragon - Mon May 15, 2006 2:58 pm

i missed that part lol, just use 0 and use the examples to have consoleInit
print off it
_________________
http://www.myspace.com/knight0fdragonds

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

#83381 - Zed0 - Tue May 16, 2006 1:12 am

I am but so far I haven't found an example that prints the standard text on top of a background image.
If anyone could point me in that direction it would be appreciated.

Next thing I'm going to try is using a custom font.

#83395 - knight0fdragon - Tue May 16, 2006 2:56 am

make sure that your bmp is not overlapping where the text should be

ur screen fills up from 600000-602000

the text map lies at 600f800, that is why your getting lines im betting
_________________
http://www.myspace.com/knight0fdragonds

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