setting graphics engines to different screens

Post Reply
DayTripperID
Posts: 22
Joined: Tue Aug 07, 2012 8:57 pm

setting graphics engines to different screens

Post by DayTripperID » Tue Aug 07, 2012 9:19 pm

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?

mtheall
Posts: 210
Joined: Thu Feb 03, 2011 10:47 pm

Re: setting graphics engines to different screens

Post by mtheall » Thu Aug 09, 2012 10:30 pm

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()

DayTripperID
Posts: 22
Joined: Tue Aug 07, 2012 8:57 pm

Re: setting graphics engines to different screens

Post by DayTripperID » Mon Aug 13, 2012 4:01 pm

Thanks-- I found it briefly after I created the thread. I guess I needed to check the code more carefully! :oops:

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests