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 > Modes of framebuffer

#126971 - Phantaseur - Sat Apr 28, 2007 4:24 pm

http://www.dev-scene.com/NDS/Tutorials_Day_3#Frame_buffer...finally
http://www.double.co.nz/nintendo_ds/nds_develop2.html
In both of these tutorials videooutput through framebuffer is described, but there is examples only for one screen and I need get output to both screens.. For example VRAM_A for the first and VRAM_B for the second.
How can I do this?

#126975 - dovoto - Sat Apr 28, 2007 5:53 pm

Framebuffer mode only works for the main engine so only one screen. To get framebuffer like access on both screens you need to use a bitmap background. I know the dev scene tutorials go into this and likely the other does as well.

There are very few good reasons to use the frame buffer mode as using a bitmap background is much more flexible and only slightly more to set up.
_________________
www.drunkencoders.com

#127022 - Dark Knight ez - Sun Apr 29, 2007 9:36 am

A bit later on he describes how to do it for the 2nd screen as well.
http://www.double.co.nz/nintendo_ds/nds_develop10.html
_________________
AmplituDS website

#127034 - Phantaseur - Sun Apr 29, 2007 1:30 pm

Oh... How I hate change code that works...

I just copied next from tutorial:
Code:
u16* video_buffer1;
video_buffer1 = (u16*)BG_BMP_RAM(0);
videoSetMode(MODE_5_2D | DISPLAY_BG3_ACTIVE);
vramSetBankA(VRAM_A_MAIN_BG_0x6000000);
BG3_CR = BG_BMP16_256x256 | BG_BMP_BASE(0);

BG3_XDX = 0;
BG3_XDY = 1 << 8;
BG3_YDY = 0;
BG3_YDX = 1 << 8;
And as I expected problem appeared at moment, I cannot compile it. It writes again:
Code:
error: 'VRAM_A_MAIN_BG_0x6000000' was not declared in this scope
So, what value has VRAM_A_MAIN_BG_0x6000000?

I tried search google but there was no definition....

#127035 - Lick - Sun Apr 29, 2007 1:34 pm

Try digging in "video.h", the header file that holds most of the graphic definitions. Anyway, try VRAM_A_MAIN_BG_0x06000000.

Remember to set bit15 for each pixel, otherwise they will be transparent.
_________________
http://licklick.wordpress.com

#127038 - Phantaseur - Sun Apr 29, 2007 2:12 pm

Thanks, that zero helped, but now next problem: I don't know what values I have to set for BG3_XDX, BG3_YDX, BG3_XDY, BG3_YDY to get same effect as using framebuffer. Whith values which I wrote in my previous message (and which I took from tutorial) I have picture which is reflected relatively Y axis and rotated 90 degrees left.
Effect is the same as X & Y axises are swaped.

#127040 - Lick - Sun Apr 29, 2007 2:28 pm

Code:
   BG3_XDX = 1 << 8;
    BG3_XDY = 0;
    BG3_YDX = 0;
    BG3_YDY = 1 << 8;

_________________
http://licklick.wordpress.com