displaying raw image
Posted: Mon Jun 22, 2009 7:39 am
hey everyone,
it try to display a raw image, but every time i get a black screen. but when i use dsorganize it displays perfect. can anyone tell me how to display a raw image. i'm doing it like this now:
Code:
it try to display a raw image, but every time i get a black screen. but when i use dsorganize it displays perfect. can anyone tell me how to display a raw image. i'm doing it like this now:
Code:
Code: Select all
#include <nds.h>
#include <fat.h>
#include <stdio.h>
int main(void) {
//---------------------------------------------------------------------------------
videoSetMode(MODE_5_2D);
vramSetBankA(VRAM_A_MAIN_BG_0x06000000);
int bg = bgInit(3, BgType_Bmp16, BgSize_B16_256x256, 0,0);
u16* backBuffer = (u16*)0x06000000;
fatInitDefault();
FILE * pfile;
pfile = fopen("decoded.raw", "rb");
fread(backBuffer, 1, 256*192*2, pfile);
fclose(pfile);
bgUpdate();
while(1) {
swiWaitForVBlank();
}
}