#123122 - nimaranjbar - Sun Mar 25, 2007 9:40 am
Hello guys,
I am trying to display a tiled background.
I have 16color paletted tiles and map.
I use this code but the result is an ugly background with corrupted tiles (every thing is green and I dont know why):
I'll appreciate your support.
I am trying to display a tiled background.
I have 16color paletted tiles and map.
I use this code but the result is an ugly background with corrupted tiles (every thing is green and I dont know why):
Code: |
#include<nds.h> #include<bmpTiles_bin.h> #include<bmpMap_bin.h> #include<bmpPalette_bin.h> int main() { u8* tileMemory = (u8*)BG_TILE_RAM(1); u16* mapMemory = (u16*)BG_MAP_RAM(0); u16* thePalette= (u16*)BG_PALETTE; videoSetMode(MODE_0_2D|DISPLAY_BG0_ACTIVE); vramSetBankA(VRAM_A_MAIN_BG_0x06000000); BG0_CR=BG_32x32|BG_COLOR_16|BG_MAP_BASE(0)|BG_TILE_BASE(1); memcpy(tileMemory,bmpTiles_bin,bmpTiles_bin_size); memcpy(mapMemory,bmpMap_bin,bmpMap_bin_size); memcpy(thePalette,bmpPalette_bin,bmpPalette_bin_size); while(1) { } } |
I'll appreciate your support.