Page 1 of 1

setting graphics engines to different screens

Posted: Tue Aug 07, 2012 9:19 pm
by DayTripperID
OK, so I just finished this DS programming tutorial at http://static.patater.com/files/project ... #id2612797.

I got everything working-- the BG's, the OAM, button and touchscreen input, and sound. Very cool.

The linked tutorial states:
By default, libnds tells the main engine to operate the top physical screen and the sub screen the bottom physical screen.
However, everything I mapped to the main engine shows up on the bottom screen, and everything mapped to the sub engine shows up on the top screen. Apparently this is correct, since the screenshots in the tutorial look just like what I compiled.

Is the above quoted text from the tutorial just a typo?

Also, does libnds have a function that lets me specify which screen I want each engine to operate on? I pored through the docs but didn't turn anything up.

Here is the code that shows where I mapped the different VRAM banks:

Code: Select all

vramSetMainBanks(VRAM_A_MAIN_BG_0x06000000,
                     VRAM_B_MAIN_BG_0x06020000,
                     VRAM_C_SUB_BG_0x06200000,
                     VRAM_D_LCD);
The main BG's showed up on the bottom screen, and the sub BG on the top, not the other way around! Any insight?

Re: setting graphics engines to different screens

Posted: Thu Aug 09, 2012 10:30 pm
by mtheall
There is a main and sub "engine" not "screen". I forget what the defaults are, but you can map the main engine to either the top or bottom screen, and the sub engine will map to the opposite. Look at these functions:

Code: Select all

lcdMainOnTop()
lcdMainOnBottom()
lcdSwap()

Re: setting graphics engines to different screens

Posted: Mon Aug 13, 2012 4:01 pm
by DayTripperID
Thanks-- I found it briefly after I created the thread. I guess I needed to check the code more carefully! :oops: