Hi,
I am struggling with reading a .sc5 file in C. I am using fgets to read the binary file, but it's not really going very well. Maybe someone has done this before? I tried a few standard things from books and from the web, but they arent meant for graphical screen data. I want to load the screendata and copy the data to vram so I can use it.
I got the following:
main() { FILE *scrfile; int c; scrfile = fopen("test.sc5","rb"); if(!scrfile) { /* if file doesnt exist */ exit(1); } while( (c = fgets(scrfile)) != EOF) { /* and here i am stuck, how do i collect the content of the sc5 file? */ /* do I treat the scrfile as a buffer and can i put this buffer somewhere to later copy it to vram? */ int i; for(i = 0;i < scrfile_size;++i) { putchar(scrfile[i]); } } fclose(scrfile); return(0); }
Aangemeld of registreer om reacties te plaatsen