I am new and currently programming something.
Currently i have to problems:
First i want to start a nds file but i dont know the code for that. Can somebody give me a simple nds starting code?
And the second one is to open an image file from the filesystem and set it as Background.
Currently code to open an image file:
Code: Select all
consoleInit ( 0, 1, BgType_Text4bpp, BgSize_T_256x256, 0, 6, false, true); //für das untere Bildschirm
FILE *pFile=fopen ("TTMenu/Starter/Down.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 Datei kann nicht gelesen werden\n"); //File could not be read
//copy from buffer
//dmaCopy(buffer, BG_GFX_SUB, lSize);
decompress(buffer, BG_GFX_SUB, LZ77Vram);
//close file and clean buffer
fclose (pFile);
free (buffer);
}
else printf("\n Datei wurde nicht gefunden!\n"); //File not found
please help