Question

The documentation implies that you can either have 3D rendering or framebuffer mode, and each only to the active display. Is there any way to render 3D to one screen and framebuffer to the other?

Was it helpful?

Solution

Well I've heard that there is display capture functionality that lets you draw 3D on the sub engine (bottom screen) so I looked it up and I found an example.

Sadly the DCAP macros doesn't seem to be documented, so I had a look at the real defines nds/arm9/video.h:

// Display capture control

#define REG_DISPCAPCNT        (*(vu32*)0x04000064)
#define REG_DISP_MMEM_FIFO  (*(vu32*)0x04000068)

#define DCAP_ENABLE    BIT(31)
#define DCAP_MODE(n)   (((n) & 3) << 29)
#define DCAP_DST(n)    (((n) & 3) << 26)
#define DCAP_SRC(n)    (((n) & 3) << 24)
#define DCAP_SIZE(n)   (((n) & 3) << 20)
#define DCAP_OFFSET(n) (((n) & 3) << 18)
#define DCAP_BANK(n)   (((n) & 3) << 16)
#define DCAP_B(n)      (((n) & 0x1F) << 8)
#define DCAP_A(n)      (((n) & 0x1F) << 0)

To my feeble mind it looks like you can capture 3D, draw it on the sub and use the frame buffer on the main if you want to. To be able to use the framebuffer on the sub engine you'll need to swap the screens with lcdSwap().

OTHER TIPS

Not entirely certain what your need is but utilizing 3D on the main display engine still leaves the entire sub engine to do framebuffer (or any other 2D) type graphics (using an extended rotation background for instance).

If you mean to use the framebuffer mode to capture output from the 3D engine so you can render 3D to both screens then there is an example in the libnds examples folder which does just this:

http://libnds.devkitpro.org/a00035.html

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top