Load Image for sdcard / socket
Posted: Mon Nov 26, 2018 9:29 am
So I'm trying to develop a streaming app for the nintendo dsi so that I can use is to controll a robot. I just wanted to know if it's possible to load at .bmp / .png at the root of the sdcard and display it on the bottom screen and still be able to modify the top screen. I don't talk about very high fps like 10-15 is good enought but the final project is to bee able to have a python script somewhere that would convert an video flux an transimit it to the nds sdcreen. After some research I stamble on this code:
But it don't really work like nothing appears. So I'm asking for a bit of help here.
Code: Select all
void displayPicture(){
fatInitDefault();
FILE *pFile=fopen("/t.bmp","rb");
if (pFile!=NULL) {
//file size
fseek (pFile, 0 , SEEK_END);
long lSize = ftell (pFile);
u8 *buffer= (u8*) malloc (sizeof(u8)*lSize);
rewind (pFile);
if (fread (buffer,1,lSize,pFile) != lSize)
printf("\n File could not be read\n"); //
//copy from buffer
dmaCopy(buffer, BG_GFX_SUB, lSize);
printf("%u",buffer);
decompress(buffer, BG_GFX_SUB, LZ77Vram);
//close file and clean buffer
fclose (pFile);
free (buffer);
}
else printf("\n FileNotFound!\n");
}