rendered paste body#include <nds.h>
int main(void) {
powerON(POWER_ALL_2D);
irqInit();
irqEnable(IRQ_VBLANK);
videoSetMode(MODE_5_2D | DISPLAY_BG3_ACTIVE /*| DISPLAY_BG_EXT_PALETTE*/);
vramSetMainBanks(VRAM_A_MAIN_BG_0x6000000, VRAM_B_MAIN_BG_0x6020000, VRAM_C_SUB_BG , VRAM_D_LCD);
BG3_CR = ROTBG_SIZE_512x512 | BG_TILE_BASE(0) | BG_MAP_BASE(20) | BG_COLOR_256;
uint16 val;
// fill up the extended palette for BG3 with grayscales
// vramSetBankE(VRAM_E_LCD);
for(val = 0; val < 256; val++) {
// 0x2000*3 = 0x6000 so we start at the address for BG3's palette
// (VRAM_E+0x6000)[val] = RGB15(val%31,val%31,val%31);
(BG_PALETTE)[val] = RGB15(val%31,val%31,val%31);
}
// vramSetBankE(VRAM_E_BG_EXT_PALETTE);
// set up tile 0 and tile 1 with a striped pattern
for(val = 0; val < 64; val++) {
((uint16*)BG_TILE_RAM(0))[val] = 0x1e00;
}
// point all maps at tile 0
for(val = 0; val < (64*64); val++) {
((uint16*)BG_MAP_RAM(20))[val] = 0x0000;
}
while(1);
return 0;
}