Memory banks example

The use of Video and Screens in combination with memory pointers like BG_BMP_RAM(0)  , BG_MAP_BASE(0) and vramSetBankA is often unclear when starting with the nds.

I made an example which illustrates the use of the memorybanks and the vramSetBank setting, touching with the stylus on the lower screen.

You can use the HelloWorld example Makefile.

You can experiment commenting out vramSetBankC(VRAM_C_MAIN_BG_0x06040000);
etc
and see what happens.

The prog writes the memory for a screen in one color and then a screen in the next color and a third part of memory in a third color. We steer the “viewing” screen using the touch.px, we “see” the colored memory pass the real screen.

the code in a textfile for a single screen steered by the stylus

the code in a textfile for a double screen: move stylus in x and in y direction

links for vram video and memory:

http://dev-scene.com/NDS/NDS_Tutorials_VramTable

http://www.devkitpro.org/libnds/a00110.html

http://nocash.emubase.de/gbatek.htm#dsvideobgmodescontrol

Advertisements

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: