Background Display Incorrect?
Posted: Fri Jun 11, 2010 10:23 am
Hi,
I am attempting to display two background images, one on main and one on sub, but I am having difficulty displaying them correctly.
Here is my current code, using the example 16-bit background that comes with devkitPro.
Here is what happens when I compile this code and run it on my R4 Ultra:
http://yfrog.com/mgpic0332j
Any help would be appreciated.
I am attempting to display two background images, one on main and one on sub, but I am having difficulty displaying them correctly.
Here is my current code, using the example 16-bit background that comes with devkitPro.
Code: Select all
#include <nds.h>
#include <stdio.h>
// git outputs a nice header to reference data
#include "frontscreen.h"
#include "bottomscreen.h"
int main(void) {
videoSetMode(MODE_5_2D);
videoSetModeSub(MODE_5_2D);
vramSetBankA(VRAM_A_MAIN_BG);
consoleDemoInit();
bgInit(3, BgType_Bmp16, BgSize_B16_256x256, 0,0);
decompress(frontscreenBitmap, BG_GFX, LZ77Vram);
vramSetBankC(VRAM_C_SUB_BG);
bgInitSub(3, BgType_Bmp16, BgSize_B16_256x256, 0,0);
decompress(bottomscreenBitmap, BG_GFX_SUB, LZ77Vram);
while(1) {
swiWaitForVBlank();
}
return 0;
}
http://yfrog.com/mgpic0332j
Any help would be appreciated.