comparison tools/lib64gfx.c @ 1488:c71b6c5204af

Factor the C64 bitmap image format info dump function to lib64gfx and use it from 64vw.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 11 May 2018 05:23:07 +0300
parents 06df2bdf5dc4
children 71e847ea9d22
comparison
equal deleted inserted replaced
1487:06df2bdf5dc4 1488:c71b6c5204af
37 #define DM_RLE_MASK 2 37 #define DM_RLE_MASK 2
38 38
39 39
40 #define DM_GET_ADDR_LO(addr) ((addr) & 0xff) 40 #define DM_GET_ADDR_LO(addr) ((addr) & 0xff)
41 #define DM_GET_ADDR_HI(addr) (((addr) >> 8) & 0xff) 41 #define DM_GET_ADDR_HI(addr) (((addr) >> 8) & 0xff)
42
43
44 void dmC64ImageDump(FILE *fh, const DMC64Image *img, const DMC64ImageFormat *fmt)
45 {
46 char typeStr[64];
47
48 dmC64GetImageTypeString(typeStr, sizeof(typeStr), img->type);
49
50 if (fmt != NULL)
51 {
52 fprintf(fh,
53 "Format : %s [%s]\n",
54 fmt->name, fmt->fext);
55 }
56
57 fprintf(fh,
58 "Type : %s\n"
59 "Banks : %d\n",
60 typeStr,
61 img->nbanks);
62
63 if (img->type & D64_FMT_ILACE)
64 {
65 char *tmps;
66 switch(img->laceType)
67 {
68 case D64_ILACE_COLOR: tmps = "color"; break;
69 case D64_ILACE_RES: tmps = "resolution"; break;
70 default: tmps = "ERROR"; break;
71 }
72 fprintf(fh,
73 "Interlace type : %s\n",
74 tmps);
75 }
76
77 fprintf(fh,
78 "Width x Height : %d x %d\n"
79 "CHwidth x CHheight : %d x %d\n",
80 img->width, img->height,
81 img->chWidth, img->chHeight);
82 }
42 83
43 84
44 void dmSetDefaultC64Palette(DMImage *img) 85 void dmSetDefaultC64Palette(DMImage *img)
45 { 86 {
46 img->constpal = TRUE; 87 img->constpal = TRUE;