aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Phillips <david@sighup.nz>2019-06-09 15:58:38 +1200
committerDavid Phillips <david@sighup.nz>2019-06-09 15:58:38 +1200
commite3bac275e9f8ef84b4c27d8382c05416e010006a (patch)
treeda1e5968f73105dedfd28941541830aa6e4423ee
parent10d6eeb4154e5b10403a9355b02f3e927321d2a2 (diff)
downloadcasio-9850-e3bac275e9f8ef84b4c27d8382c05416e010006a.tar.xz
Correct the format of XPM outputHEADmaster
The old output was interpreted by imlib2 just fine, but imagemagick didn't like it. After a quick investigation, the output format was corrected to work in both.
-rw-r--r--screen-to-xpm.c24
1 files changed, 11 insertions, 13 deletions
diff --git a/screen-to-xpm.c b/screen-to-xpm.c
index 35a293a..cf29e01 100644
--- a/screen-to-xpm.c
+++ b/screen-to-xpm.c
@@ -77,9 +77,9 @@ int main(int argc, char **argv)
if (argc != 1)
{
fprintf(stderr,
- "Converts monochrom CASIO FX-9850 screen dumps to XPM images.\n"
- "Reads screen dump from stdin and outputs XPM to stdout\n"
- "Also prints information and warning messages to stderr when necessary\n"
+ "Converts CASIO (C)FX-9850 screen dumps to XPM images.\n"
+ "Reads raw screen dump packets from stdin and outputs XPM to stdout\n"
+ "Information and warning messages printed to stderr when necessary\n"
"\n"
"Syntax: %s < screen.dump > screen.xpm\n", argv[0]);
return 1;
@@ -122,17 +122,15 @@ int main(int argc, char **argv)
/* Tasty! A hard-coded XPM header! */
printf( "/* XPM */\n"
- "static char *Pic_colors[] = {\n"
- " \"%d %d 4 1\"\n"
- " \"B c #000033\"\n"
- " \"G c #005555\"\n"
- " \"R c #FF6633\"\n"
- " \"0 c #FFFFFF\"\n"
- "};\n"
- "static char *Pic_pixels[] = {\n",IMAGE_WIDTH,IMAGE_HEIGHT
+ "static char *casio_screenshot[] = {\n"
+ " \"%d %d 4 1\",\n"
+ " \"B c #000033\",\n"
+ " \"G c #005555\",\n"
+ " \"R c #FF6633\",\n"
+ " \"0 c #FFFFFF\",\n",
+ IMAGE_WIDTH,IMAGE_HEIGHT
);
-
for (y = 0; y < IMAGE_HEIGHT; y++)
{
printf("\""); /* XPM stuff */
@@ -145,7 +143,7 @@ int main(int argc, char **argv)
/* Hard-coded XPM footer */
- printf("\"};");
+ printf("};");
return 0;
}