I've got a question about some background issues, as my first step in developing nds apps I have create a code to colour both of nds screen in particular colour using this code:
Code: Select all
#include <nds.h>
#include <stdio.h>
int main(void)
{
videoSetMode(MODE_5_2D | DISPLAY_BG3_ACTIVE);
videoSetModeSub(MODE_5_2D | DISPLAY_BG3_ACTIVE);
vramSetBankA(VRAM_A_MAIN_BG);
vramSetBankC(VRAM_C_SUB_BG);
u16* video_buffer_main = (u16*)BG_BMP_RAM(0);
u16* video_buffer_sub = (u16*)BG_BMP_RAM_SUB(0);
BACKGROUND.control[3] = BG_BMP16_256x256 | BG_BMP_BASE(0);
BACKGROUND_SUB.control[3] = BG_BMP16_256x256 | BG_BMP_BASE(0);
for(int i=0; i<256*256; i++)
{
video_buffer_main[i] = RGB15(31, 0, 0) | BIT(15);
video_buffer_sub[i] = RGB15(31, 0, 0) | BIT(15);
}
BG_PALETTE_SUB[255] = RGB15(31,31,31);
consoleInit(0, 1, BgType_Text4bpp, BgSize_T_256x256, 0, 6, false, true);
printf("\n\n\tNDS\n");
while(1)
{
swiWaitForVBlank();
}
return 0;
}