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 > How do you set the memory used for a background?

#108332 - thegamefreak0134 - Tue Nov 07, 2006 9:19 pm

Having found no way to use sprites from the VRAM_B only, I need to cause my extended rotration background to show up on the mainscreen from bank A.

The code I have to do this is found here:

Code:

videoSetMode(MODE_5_2D | DISPLAY_SPR_ACTIVE | DISPLAY_SPR_1D | DISPLAY_BG3_ACTIVE);
vramSetBankA(VRAM_A_MAIN_SPRITE);
   
   
videoSetModeSub(MODE_5_2D | DISPLAY_BG2_ACTIVE);
   
vramSetBankB(VRAM_B_MAIN_BG_0x6000000);
vramSetBankC(VRAM_C_SUB_BG_0x6200000);
BG3_CR = BG_BMP16_256x256;
   
BG3_XDX = (1<<8);
BG3_XDY = 0;
BG3_YDX = 0;
BG3_YDY = (1<<8);
BG3_CY = 0;
BG3_CX = 0;
... more stuff for setting up the subscreen.


Now, the subscreen stuff works fine. My problem is that writing to memory addrerss 0x6000000 displays nothing on the screen, whereas writing to memory address 0x6200000 displays stuff on the subscreen like I expected it to.

Am I just totally missing some initialization here? Bank C appears to be working, bank A appears to be working, bank B does nothing. (ie, I can draw an the bottom screen and my sprites show up on the top screen, but the background on the top screen, which is drawn to later in the code, has no effect.)

This really causes grief on my part in many respects. Any help at all (a reply at all would work) would make me excessively happy.

-thegamefreak
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]

#108336 - Lick - Tue Nov 07, 2006 9:23 pm

"Now, the subscreen stuff works fine. My problem is that writing to memory addrerss 0x6000000 displays nothing on the screen, .."

Show us this piece of code. I suspect that you aren't setting BIT(15) which is the Alpha bit.
_________________
http://licklick.wordpress.com

#108337 - thegamefreak0134 - Tue Nov 07, 2006 9:24 pm

... I feel... Really stupid... When I was converting from framebuffer mode to extended rotational background mode, I forgot to set bit 15. Everything was working fine, and drawing a transparent background that I could not see. Gee dont I feel stupid for panicking over the course of two class periods.

I appologize for posting this, its no longer relavent (although I still need help on the whole sprites thing) so could a mod please remove? Thanks...

-gamefreak - no longer freaking out

EDIT: Darn you and your ninja skills. I figured the problem out right after I posted, but thanks. You nailed it.
_________________
What if the hokey-pokey really is what it's all about?

[url=http:/www.darknovagames.com/index.php?action=recruit&clanid=1]Support Zeta on DarkNova![/url]