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 > Noob question : 2 Screens

#121461 - Robthar - Mon Mar 12, 2007 3:47 pm

How can i use both main and sub screens to draw onto them?
All my attempts ended in screens filled with one color

#121463 - Lick - Mon Mar 12, 2007 4:08 pm

Show your code. NOW!
_________________
http://licklick.wordpress.com

#121466 - Robthar - Mon Mar 12, 2007 4:23 pm

Code:

videoSetModeSub(MODE_5_2D | DISPLAY_BG2_ACTIVE);
vramSetBankC(VRAM_C_SUB_BG);
BG2_CR = BG_BMP16_256x256;
...
BG_GFX_SUB[x+(y*256)]=RGB(15,15,15)|BIT(15);

#121467 - Lick - Mon Mar 12, 2007 4:30 pm

Try using these:
Code:
    SUB_BG2_CR = BG_BMP16_256x256;
    SUB_BG2_XDX = 256;
    SUB_BG2_XDY = 0;
    SUB_BG2_YDX = 0;
    SUB_BG2_YDY = 256;
    SUB_BG2_CX = 0;
    SUB_BG2_CY = 0;

_________________
http://licklick.wordpress.com

#121468 - Robthar - Mon Mar 12, 2007 4:32 pm

thanks, now it works