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 > Main screen disappears when sub screen appears

#118960 - Massif - Sun Feb 18, 2007 5:03 pm

I'm trying to get graphics to display on the main screen and text on the sub screen. I got it working in Dualis last night. However, I tried running it on my DSLite this morning and the graphics appear for a split second, but then disappear when the text on the sub screen shows up. I was using the touch screen as main and top screen as sub. However, when I removed the lcdSwap() line, the graphics displayed on the top and stayed there, but the text never even showed up on the bottom.

*EDIT*

Forgot to post the code. It's a 512x512 image

Code:
videoSetMode(MODE_5_2D | DISPLAY_BG2_ACTIVE);
   vramSetBankA(VRAM_A_MAIN_BG);
   vramSetBankB(VRAM_B_MAIN_BG);
   BG2_CR = BG_BMP8_512x512 | BG_BMP_BASE(0) | BG_PRIORITY(2);
   BG2_XDX = 1 << 8;
   BG2_XDY = 0;
   BG2_YDX = 0;
   BG2_YDY = 1 << 8;
   BG2_CY = 0;
   BG2_CX = 0;
   
   // Copy image and palette to main screen
   dmaCopy(cards512Bitmap, BG_GFX, cards512BitmapLen);
   dmaCopy(cards512Pal, BG_PALETTE, cards512PalLen);

   // Use the sub screen for text output
   videoSetModeSub(MODE_0_2D | DISPLAY_BG0_ACTIVE);
   vramSetBankC(VRAM_C_SUB_BG);
   SUB_BG0_CR = BG_MAP_BASE(31);
   
   // Set the colour of the font to White.
   BG_PALETTE_SUB[255] = RGB15(31,31,31);
   consoleInitDefault((u16*)SCREEN_BASE_BLOCK_SUB(31), (u16*)CHAR_BASE_BLOCK_SUB(0), 16);

#121885 - FRuMMaGe - Thu Mar 15, 2007 1:24 pm

I have the same problem :(

#121936 - HyperHacker - Thu Mar 15, 2007 9:15 pm

You could step through the code by adding wait loops that will spin until you press and release a button. That'd tell you which line is causing problems.
_________________
I'm a PSP hacker now, but I still <3 DS.