# HG changeset patch # User Mychaela Falconia # Date 1516482013 0 # Node ID 81641d82ccc6fc0a86d8ecfc581d56c6daf21bc2 # Parent f233f0a012c9f63fec37076da5978df455e6387c fbdump2ppm: adjust for R2D's extra 32-bit word diff -r f233f0a012c9 -r 81641d82ccc6 miscprog/fbdump2ppm.c --- a/miscprog/fbdump2ppm.c Sat Jan 20 20:46:08 2018 +0000 +++ b/miscprog/fbdump2ppm.c Sat Jan 20 21:00:13 2018 +0000 @@ -1,13 +1,18 @@ /* * This program converts a dump of TI's R2D framebuffer (176x220 pix, 16-bit) * captured via fc-memdump into PPM format for viewing. + * + * TI's R2D code adds an extra 32-bit word to each horizontal line in its + * framebuffer representation, hence one needs to capture 0x131F0 bytes + * (178*2*220 instead of 176*2*220), and we treat the image as being + * 178x220 pixels for simplicity. */ #include #include #include -#define NPIX (176*220) +#define NPIX (178*220) FILE *inf, *outf; @@ -53,7 +58,7 @@ perror(argv[2]); exit(1); } - fprintf(outf, "P6\n176 220\n255\n"); + fprintf(outf, "P6\n178 220\n255\n"); for (n = 0; n < NPIX; n++) convert_pixel(); exit(0);