/* Code by Roberto Piola, http://www.ilpiola.it/roberto/tomtom The code is provided as-is without any warranty. You can use it for whatever you want, but please give credit to the author. If you want to redistribute it or include it in some other software, you must include a link to my site in the documentation. If you want to use it on a tomtom model that has a different resolution (i.e.: 480x272), you must change the TWO lines marked as "CHANGE RESOLUTION" */ #include #include main(int argc,char**argv) { FILE*fi,*fo; char outfname[1024]; unsigned short c; int w; if(argc<3) { printf("usage: convert-from-rider dumpfile outputfile\n.ppm is automatically added to output\n"); exit(1); } fi=fopen(argv[1],"rb"); if(!fi) { printf("unable to open %s for reading\n",argv[1]); exit(1); } sprintf(outfname,"%s.ppm",argv[2]); fo=fopen(outfname,"wb"); if(!fo) { printf("unable to open %s for writing\n",outfname); exit(1); } fprintf(fo,"P3\n# dumped from TomTom\n320 240\n255\n"); /* CHANGE RESOLUTION 320 240 HERE */ for(w=0;w<320*240;w++) /* CHANGE RESOLUTION 320X240 HERE */ { fread(&c,2,1,fi); fprintf(fo,"%d %d %d\n",(c>>11)<<3,((c>>5) & 0x3f) << 2,(c& 0x1f) <<3); } fclose(fo); fclose(fi); }