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 > Console font with multiple backgrounds???

#69824 - knight0fdragon - Thu Feb 02, 2006 5:49 am

I am trying to use console printing on top of my background but i cant seem to get it to work, i enable both backgrounds 0 and 3, set the VRAM to whats needed, and set the registers like this

Code:

BG_PALETTE_SUB[0]=RGB15(31,0,0);

SUB_BG0_CR = BG_MAP_BASE(31) | BG_PRIORITY_2;//use bg0 for the text
   
BG_PALETTE_SUB[255] = RGB15(31,31,31);//by default font rendered with color 255
   
//consoleInit() is a lot more flexible but this gets you up and running quick
consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31) , (u16*)CHAR_BASE_BLOCK_SUB(0) , 16);



SUB_BG3_CR = BG_BMP8_256x256  | BG_PRIORITY_3;
SUB_BG3_XDX = 1 << 8;
SUB_BG3_XDY = 0;
SUB_BG3_YDX = 0;
SUB_BG3_YDY = 1 << 8;
SUB_BG3_CX = 0;
SUB_BG3_CY = 0 << 8;

dmaCopy(pitchbg2_bin, BG_GFX_SUB, 256*192);



now ive tried other things like changeing the BMP Base and pointing to something other then BG_GFX_SUB, but for some reason, i cannot get the 2 to work
_________________
http://www.myspace.com/knight0fdragonds

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

#96312 - psycorpse - Wed Aug 02, 2006 3:09 pm

Did you ever figure this out?

#96330 - knight0fdragon - Wed Aug 02, 2006 5:01 pm

yup, have map at 0, tile at 1, and add |BG_BMP_RAM(2) to BG3_CR
_________________
http://www.myspace.com/knight0fdragonds

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

#98427 - jonezer4 - Tue Aug 15, 2006 5:03 am

I'm having a similar problem, if you could post your corrected code I'd appreciate it.