Question

I'm coding in c++ for the nds with devkit pro and for the life of me, I cannot find out how to draw/display a full picture on one of the screen. Something simply for a background image of the titlescreen of a game. I've searched with no luck; only finding this, which doesn't show what "hey_typ.h" is.

Was it helpful?

Solution

DevkitPro comes with several examples for the supported targets.
If you look under examples\nds\Graphics\Backgrounds\ you'll find two examples called 16bit_color_bmp and 256_color_bmp, which show you how to display an image on the main graphics core (which screen that core is assigned to is software-switchable).

Both examples use display mode 5, with BG3 set up as a 256x256 pixel bitmap. The graphics data in 16-bit mode should be on the format 1555 (1-bit alpha, followed by 5 bits each of red, green and blue. I don't remember if the order is rgb or bgr). In 256-color mode each pixel is an 8-bit index into a palette of (up to) 256 colors where each entry is a 16-bit color value (on the 1555 format).

If you want detailed information about any part of the NDS, GBATEK is probably your best bet.

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