Mercurial > hg > dmlib
annotate tools/lib64fmts.c @ 2630:ca617d635fce
Rename Image System type ims -> ism.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Thu, 30 Nov 2023 02:01:18 +0200 |
parents | 07c85fffd805 |
children | 17679e05c63b |
rev | line source |
---|---|
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 /* |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 * Functions for reading and converting various restricted |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 * C64/etc and/or indexed/paletted graphics formats. |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
4 * Programmed and designed by Matti 'ccr' Hamalainen |
2601 | 5 * (C) Copyright 2012-2023 Tecnic Software productions (TNSP) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
6 * |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
7 * Please read file 'COPYING' for information on license and distribution. |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
8 */ |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
9 #include "lib64gfx.h" |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
10 |
2080
7e4087e2740d
Define macros DM_MEMCMP_SIZE() and DM_MEMCMP_LEN() as helpers.
Matti Hamalainen <ccr@tnsp.org>
parents:
2056
diff
changeset
|
11 #define DM_MEMCMP_SIZE(mptr, mcmp) memcmp((mptr), (mcmp), sizeof(mcmp)) |
7e4087e2740d
Define macros DM_MEMCMP_SIZE() and DM_MEMCMP_LEN() as helpers.
Matti Hamalainen <ccr@tnsp.org>
parents:
2056
diff
changeset
|
12 #define DM_MEMCMP_LEN(mptr, mcmp) memcmp((mptr), (mcmp), strlen(mcmp)) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 |
2301
d71185584d95
Comment the necessity of fmtProbeGigapaintHires()..
Matti Hamalainen <ccr@tnsp.org>
parents:
2300
diff
changeset
|
14 |
2620
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
15 #define XX2_MIN_SIZE 4000 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
16 #define XX2_WIDTH_CH 40 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
17 #define XX2_HEIGHT_CH 10 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
18 #define XX2_SIZE (XX2_WIDTH_CH * XX2_HEIGHT_CH) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
19 #define XX2_BSIZE (XX2_SIZE * 8) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
20 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
21 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
22 static int fmtProbeFormatXX2(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
23 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
24 if (buf->len >= XX2_MIN_SIZE && |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
25 buf->len <= XX2_MIN_SIZE + 8 && |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
26 dmCompareAddr16(buf, 0, fmt->addr)) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
27 return DM_PROBE_SCORE_MAYBE; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
28 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
29 return DM_PROBE_SCORE_FALSE; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
30 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
31 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
32 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
33 static int fmtDecodeFormatXX2(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
34 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
35 int res; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
36 DMGrowBuf tmp; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
37 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
38 // If there is only data for less than XX2_MIN_SIZE bytes, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
39 // allocate a buffer of that size and copy data there. |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
40 // Otherwise allocate len bytes. |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
41 if (dmGrowBufCopy(&tmp, buf, buf->len < XX2_MIN_SIZE ? XX2_MIN_SIZE - buf->len : 0) == NULL) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
42 return DMERR_MALLOC; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
43 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
44 tmp.len = tmp.size; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
45 res = dmC64DecodeGenericBMP(img, &tmp, fmt); |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
46 dmGrowBufFree(&tmp); |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
47 return res; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
48 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
49 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
50 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
51 static const Uint8 fmtFormatXX3_MagicID_1[] = |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
52 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
53 0x01, 0x08, 0x0B, 0x08, 0xF0, 0x02, 0x9E, 0x32, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
54 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xA9, 0x14, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
55 0x8D, 0x18, 0xD0, 0xA2, 0x00, 0xA9, 0x20, 0x9D, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
56 0x00, 0x04, 0x9D, 0x00, 0x05, 0x9D, 0x00, 0x06, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
57 }; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
58 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
59 static int fmtProbeFormatXX3(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
60 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
61 if (buf->len == fmt->size && |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
62 DM_MEMCMP_SIZE(buf->data, fmtFormatXX3_MagicID_1) == 0 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
63 ) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
64 return DM_PROBE_SCORE_MAX; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
65 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
66 return DM_PROBE_SCORE_FALSE; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
67 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
68 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
69 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
70 static const Uint8 fmtFormatXX4_MagicID_1[] = |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
71 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
72 0x00, 0x1f, 0x78, 0xa9, 0x3b, 0x8d, 0x11, 0xd0, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
73 0xa9, 0x18, 0x8d, 0x16, 0xd0, 0xa9, 0x18, 0x8d, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
74 }; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
75 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
76 static int fmtProbeFormatXX4(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
77 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
78 if (buf->len >= fmt->size && |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
79 DM_MEMCMP_SIZE(buf->data, fmtFormatXX4_MagicID_1) == 0 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
80 ) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
81 return DM_PROBE_SCORE_MAX; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
82 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
83 return DM_PROBE_SCORE_FALSE; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
84 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
85 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
86 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
87 static const Uint8 fmtFormatXX5_MagicID_1[] = |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
88 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
89 0x00, 0x10, 0xa9, 0x01, 0x8d, 0x86, 0x02, 0x20, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
90 0x44, 0xe5, 0xa9, 0x16, 0x8d, 0x18, 0xd0, 0xa2, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
91 }; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
92 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
93 static int fmtProbeFormatXX5(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
94 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
95 if (buf->len >= fmt->size && |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
96 DM_MEMCMP_SIZE(buf->data, fmtFormatXX5_MagicID_1) == 0 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
97 ) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
98 return DM_PROBE_SCORE_MAX; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
99 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
100 return DM_PROBE_SCORE_FALSE; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
101 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
102 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
103 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
104 static int fmtGetPixelXX5(DMC64ScanLine *scan, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
105 const DMC64Image *img, const int rasterX, const int rasterY) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
106 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
107 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
108 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
109 #if 1 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
110 (void) vshift; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
111 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
112 return dmC64GetGenericMCPixel(scan->col, img, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
113 bmoffs, scroffs, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
114 6 - (rasterX & 6), |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
115 // (rasterY & 7) + (8 * (rasterX & 1)), |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
116 (rasterY & 7), |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
117 rasterX & 1, 0, img->bgcolor); |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
118 #else |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
119 const int vbank = rasterY & 7; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
120 Uint8 color1, color2, bgcol = img->bgcolor; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
121 int res; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
122 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
123 if ((res = dmC64GetGenericMCPixel(&color1, img, bmoffs, scroffs, vshift, vbank , rasterX & 1, 0, bgcol)) != DMERR_OK || |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
124 (res = dmC64GetGenericMCPixel(&color2, img, bmoffs, scroffs, vshift, vbank + 8, rasterX & 1, 0, bgcol)) != DMERR_OK) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
125 return res; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
126 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
127 *(scan->col) = (color1 * D64_NCOLORS) + color2; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
128 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
129 return res; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
130 #endif |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
131 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
132 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
133 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
134 static const Uint8 fmtFormatXX6_MagicID_1[] = |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
135 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
136 0x01, 0x08, 0x0b, 0x08, 0xd5, 0x07, 0x9e, 0x34, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
137 0x30, 0x39, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
138 }; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
139 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
140 static const Uint8 fmtFormatXX6_MagicID_2[] = |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
141 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
142 0x00, 0xAD, 0x10, 0x47, 0x8D, 0x21, 0xD0, 0xA9, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
143 0x00, 0x8D, 0x20, 0xD0, 0xA2, 0x00, 0xBD, 0x40, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
144 }; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
145 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
146 static int fmtProbeFormatXX6(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
147 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
148 if (buf->len == fmt->size && |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
149 DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX6_MagicID_1) == 0 && |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
150 DM_MEMCMP_SIZE(buf->data + 0x0800, fmtFormatXX6_MagicID_2) == 0 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
151 ) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
152 return DM_PROBE_SCORE_MAX; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
153 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
154 return DM_PROBE_SCORE_FALSE; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
155 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
156 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
157 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
158 static const Uint8 fmtFormatXX7_MagicID_1[] = |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
159 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
160 0x01, 0x08, 0x0b, 0x08, 0xe0, 0x02, 0x9e, 0x32, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
161 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xa2, 0x19, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
162 }; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
163 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
164 static const Uint8 fmtFormatXX7_MagicID_2[] = |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
165 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
166 0xa2, 0x60, 0xa9, 0x00, 0x20, 0x10, 0x0a, 0xa9, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
167 0x26, 0xa2, 0x0a, 0x20, 0x10, 0x0a, 0xa2, 0x1f, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
168 }; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
169 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
170 static int fmtProbeFormatXX7(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
171 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
172 if (buf->len == fmt->size && |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
173 DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX7_MagicID_1) == 0 && |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
174 DM_MEMCMP_SIZE(buf->data + 0x0100, fmtFormatXX7_MagicID_2) == 0 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
175 ) |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
176 return DM_PROBE_SCORE_MAX; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
177 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
178 return DM_PROBE_SCORE_FALSE; |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
179 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
180 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
181 |
2629
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
182 static const Uint8 fmtFormatXX9_MagicID[] = |
2627
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
183 { |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
184 0x01, 0x08, 0x0b, 0x08, 0xe0, 0x02, 0x9e, 0x32, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
185 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xa2, 0x19, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
186 0xb5, 0x02, 0x9d, 0x6f, 0x31, 0xca, 0x10, 0xf8, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
187 0xa9, 0x0e, 0x20, 0xd2, 0xff, 0xa5, 0x01, 0x48, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
188 0x29, 0xf8, 0x09, 0x06, 0x85, 0x01, 0x20, 0x65, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
189 0x08, 0x68, 0x8d, 0x8e, 0x31, 0xba, 0x8e, 0x8d, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
190 }; |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
191 |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
192 static int fmtProbeFormatXX9(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
193 { |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
194 if (buf->len == fmt->size && |
2629
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
195 DM_MEMCMP_SIZE(buf->data, fmtFormatXX9_MagicID) == 0 |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
196 ) |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
197 return DM_PROBE_SCORE_MAX; |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
198 |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
199 return DM_PROBE_SCORE_FALSE; |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
200 } |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
201 |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
202 |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
203 static const Uint8 fmtFormatXX10_MagicID[] = |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
204 { |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
205 0x01, 0x08, 0x0B, 0x08 , 0x20, 0x03, 0x9E, 0x32, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
206 0x30, 0x36, 0x31, 0x00 , 0x00, 0x00, 0xA2, 0x00, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
207 0xBD, 0x77, 0x28, 0x9D , 0x00, 0x40, 0xBD, 0x77, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
208 0x29, 0x9D, 0x00, 0x41 , 0xBD, 0x77, 0x2A, 0x9D, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
209 0x00, 0x42, 0xBD, 0x5F , 0x2B, 0x9D, 0xE8, 0x42, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
210 0xCA, 0xD0, 0xE5, 0xA2 , 0x00, 0xBD, 0x37, 0x09, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
211 0x9D, 0x00, 0x60, 0xBD , 0x37, 0x0A, 0x9D, 0x00, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
212 }; |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
213 |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
214 static int fmtProbeFormatXX10(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
215 { |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
216 if (buf->len == fmt->size && |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
217 DM_MEMCMP_SIZE(buf->data, fmtFormatXX10_MagicID) == 0 |
2627
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
218 ) |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
219 return DM_PROBE_SCORE_MAX; |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
220 |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
221 return DM_PROBE_SCORE_FALSE; |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
222 } |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
223 |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
224 |
2301
d71185584d95
Comment the necessity of fmtProbeGigapaintHires()..
Matti Hamalainen <ccr@tnsp.org>
parents:
2300
diff
changeset
|
225 // Basic probe, but return MAX score for this format |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
226 static int fmtProbeGigapaintHires(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
227 { |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
228 if (buf->len == fmt->size && |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
229 dmCompareAddr16(buf, 0, fmt->addr)) |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
230 return DM_PROBE_SCORE_MAX; |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
231 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
232 return DM_PROBE_SCORE_FALSE; |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
233 } |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
234 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
235 |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
236 // XXX TODO: Research what these values actually mean. It would seem probable |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
237 // that these may not be static values at all, as there are 8 more that change |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
238 // before actual image data, but do not seem to be used in the image itself. |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
239 static const Uint8 fmtMicroIllustrator_MagicID_1[] = |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
240 { |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
241 0xff, 0x80, 0x69, 0x67, 0x14, 0x00, |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
242 }; |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
243 |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
244 static const Uint8 fmtMicroIllustrator_MagicID_2[] = |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
245 { |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
246 0xe8, 0x03, 0xe8, 0x03, 0x40, 0x1f, |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
247 }; |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
248 |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
249 static int fmtProbeMicroIllustrator(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
250 { |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
251 if (buf->len == fmt->size && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
252 DM_MEMCMP_SIZE(buf->data + 2, fmtMicroIllustrator_MagicID_1) == 0 |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
253 && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
254 DM_MEMCMP_SIZE(buf->data + 9, fmtMicroIllustrator_MagicID_2) == 0 |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
255 ) |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
256 return DM_PROBE_SCORE_MAX; |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
257 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
258 return DM_PROBE_SCORE_FALSE; |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
259 } |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
260 |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
261 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
262 static int fmtEncodeMicroIllustrator(const DMC64EncDecOp *op, DMGrowBuf *buf, |
1985
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
263 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
264 { |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
265 (void) op; |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
266 (void) img; |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
267 (void) fmt; |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
268 |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
269 memcpy(buf->data + 2, fmtMicroIllustrator_MagicID_1, sizeof(fmtMicroIllustrator_MagicID_1)); |
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
270 memcpy(buf->data + 9, fmtMicroIllustrator_MagicID_2, sizeof(fmtMicroIllustrator_MagicID_2)); |
1985
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
271 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
272 return DMERR_OK; |
1985
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
273 } |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
274 |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
275 |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
276 static const Uint8 fmtSupeRes_MagicID_1[] = |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
277 { |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
278 0x40, 0x5c, 0x2a, |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
279 }; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
280 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
281 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
282 static int fmtProbeSupeRes(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
283 { |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
284 if (buf->len > 12 && |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
285 DM_MEMCMP_SIZE(buf->data, fmtSupeRes_MagicID_1) == 0) |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
286 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
287 if (buf->data[3] == fmt->extra) |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
288 return DM_PROBE_SCORE_MAX; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
289 } |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
290 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
291 return DM_PROBE_SCORE_FALSE; |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
292 } |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
293 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
294 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
295 typedef struct |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
296 { |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
297 DMGrowBuf src; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
298 Uint8 *dstBuf; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
299 size_t dstSize; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
300 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
301 Uint8 dbyte, repcount; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
302 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
303 size_t offs, end_offs; |
2524
5a7e2aa8fef5
Rename DMSupeResCtx to DMSupeResDecCtx.
Matti Hamalainen <ccr@tnsp.org>
parents:
2523
diff
changeset
|
304 } DMSupeResDecCtx; |
5a7e2aa8fef5
Rename DMSupeResCtx to DMSupeResDecCtx.
Matti Hamalainen <ccr@tnsp.org>
parents:
2523
diff
changeset
|
305 |
5a7e2aa8fef5
Rename DMSupeResCtx to DMSupeResDecCtx.
Matti Hamalainen <ccr@tnsp.org>
parents:
2523
diff
changeset
|
306 |
5a7e2aa8fef5
Rename DMSupeResCtx to DMSupeResDecCtx.
Matti Hamalainen <ccr@tnsp.org>
parents:
2523
diff
changeset
|
307 static int fmtSupeResGetByte(DMSupeResDecCtx *ctx, Uint8 *data, const int mode) |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
308 { |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
309 if (!dmGrowBufGetU8(&ctx->src, data)) |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
310 { |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
311 return dmError(DMERR_INVALID_DATA, |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
312 "SupeRes: Out of input data (N=%d).\n", |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
313 mode); |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
314 } |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
315 else |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
316 return DMERR_OK; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
317 } |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
318 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
319 |
2524
5a7e2aa8fef5
Rename DMSupeResCtx to DMSupeResDecCtx.
Matti Hamalainen <ccr@tnsp.org>
parents:
2523
diff
changeset
|
320 static int fmtDecodeSupeRes24_25(DMSupeResDecCtx *ctx, Uint8 tmp) |
2522
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
321 { |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
322 if (tmp == 0x24) |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
323 { |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
324 ctx->dbyte = 0xff; |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
325 } |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
326 else |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
327 { |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
328 if (tmp == 0x25) |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
329 { |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
330 int res; |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
331 if ((res = fmtSupeResGetByte(ctx, &tmp, 9)) != DMERR_OK) |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
332 return res; |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
333 |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
334 tmp = (0x26 + tmp) & 0xff; |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
335 } |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
336 |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
337 ctx->dbyte = tmp - 0x26; |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
338 } |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
339 |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
340 return DMERR_OK; |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
341 } |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
342 |
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
343 |
2524
5a7e2aa8fef5
Rename DMSupeResCtx to DMSupeResDecCtx.
Matti Hamalainen <ccr@tnsp.org>
parents:
2523
diff
changeset
|
344 static int fmtDecodeSupeResByte(DMSupeResDecCtx *ctx) |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
345 { |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
346 Uint8 tmp; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
347 int res; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
348 |
2535
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
349 do |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
350 { |
2535
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
351 if ((res = fmtSupeResGetByte(ctx, &tmp, 1)) != DMERR_OK) |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
352 break; |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
353 |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
354 if (tmp == 0x21) |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
355 { |
2535
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
356 // ???? |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
357 ctx->offs = 0xffff; |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
358 break; |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
359 } |
2535
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
360 else |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
361 if (tmp == 0x20) |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
362 { |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
363 if ((res = fmtSupeResGetByte(ctx, &tmp, 2)) != DMERR_OK) |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
364 break; |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
365 |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
366 ctx->repcount = tmp - 0x26; |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
367 |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
368 if ((res = fmtSupeResGetByte(ctx, &tmp, 3)) != DMERR_OK || |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
369 (res = fmtDecodeSupeRes24_25(ctx, tmp)) != DMERR_OK) |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
370 break; |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
371 |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
372 for (int cnt = 0; cnt < ctx->repcount; cnt++) |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
373 { |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
374 ctx->dstBuf[ctx->offs++] = ctx->dbyte; |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
375 if (ctx->offs >= ctx->end_offs) |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
376 break; |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
377 } |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
378 |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
379 if (ctx->offs >= ctx->end_offs) |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
380 { |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
381 ctx->offs--; |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
382 break; |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
383 } |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
384 } |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
385 else |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
386 { |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
387 res = fmtDecodeSupeRes24_25(ctx, tmp); |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
388 break; |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
389 } |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
390 } while (1); |
5f76cf36e5c5
Clean up SupeRES decoder loop a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2526
diff
changeset
|
391 |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
392 return res; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
393 } |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
394 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
395 |
2524
5a7e2aa8fef5
Rename DMSupeResCtx to DMSupeResDecCtx.
Matti Hamalainen <ccr@tnsp.org>
parents:
2523
diff
changeset
|
396 static int fmtDecodeSupeResSection(DMSupeResDecCtx *ctx, const size_t offs, const size_t size) |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
397 { |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
398 int res = DMERR_OK; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
399 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
400 ctx->offs = offs; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
401 ctx->end_offs = offs + size; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
402 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
403 do |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
404 { |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
405 if ((res = fmtDecodeSupeResByte(ctx)) != DMERR_OK) |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
406 goto out; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
407 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
408 if (ctx->offs < ctx->end_offs) |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
409 ctx->dstBuf[ctx->offs++] = ctx->dbyte; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
410 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
411 } while (ctx->offs < ctx->end_offs); |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
412 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
413 out: |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
414 return res; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
415 } |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
416 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
417 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
418 static int fmtDecodeSupeRes(DMC64Image *img, const DMGrowBuf *psrc, const DMC64ImageFormat *fmt) |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
419 { |
2524
5a7e2aa8fef5
Rename DMSupeResCtx to DMSupeResDecCtx.
Matti Hamalainen <ccr@tnsp.org>
parents:
2523
diff
changeset
|
420 DMSupeResDecCtx ctx; |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
421 DMGrowBuf tmp; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
422 int res; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
423 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
424 memset(&ctx, 0, sizeof(ctx)); |
2522
27271f2afa7c
Clean up the SupeRes decoder a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2521
diff
changeset
|
425 ctx.dstSize = 0x3000; |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
426 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
427 // As we need to modify the offs, etc. but not the data, |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
428 // we will just make a shallow copy of the DMGrowBuf struct |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
429 dmGrowBufConstCopyOffs(&ctx.src, psrc, 4); |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
430 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
431 // Allocate output buffer |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
432 if ((ctx.dstBuf = dmMalloc0(ctx.dstSize)) == NULL) |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
433 { |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
434 return dmError(DMERR_MALLOC, |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
435 "Could not allocate memory for decoding buffer.\n"); |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
436 } |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
437 |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
438 switch (fmt->extra) |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
439 { |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
440 case 0x23: |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
441 case 0x25: |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
442 if ((res = fmtDecodeSupeResSection(&ctx, 0x0000, 0x03e8)) != DMERR_OK || |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
443 (res = fmtDecodeSupeResSection(&ctx, 0x0400, 0x1f40)) != DMERR_OK) |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
444 goto out; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
445 break; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
446 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
447 case 0x24: |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
448 case 0x26: |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
449 if ((res = fmtDecodeSupeResByte (&ctx)) != DMERR_OK) |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
450 goto out; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
451 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
452 ctx.dstBuf[0x2710] = ctx.dbyte; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
453 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
454 if ((res = fmtDecodeSupeResSection(&ctx, 0x1f40, 0x03e8)) != DMERR_OK || |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
455 (res = fmtDecodeSupeResSection(&ctx, 0x2328, 0x03e8)) != DMERR_OK || |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
456 (res = fmtDecodeSupeResSection(&ctx, 0x0000, 0x1f40)) != DMERR_OK) |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
457 goto out; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
458 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
459 break; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
460 } |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
461 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
462 res = dmC64DecodeGenericBMP(img, |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
463 dmGrowBufConstCreateFrom(&tmp, ctx.dstBuf, ctx.dstSize), fmt); |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
464 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
465 out: |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
466 dmFree(ctx.dstBuf); |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
467 return res; |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
468 } |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
469 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
470 |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
471 typedef struct |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
472 { |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
473 DMGrowBuf *buf; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
474 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
475 int cnt1, cnt2, dbyte; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
476 } DMSupeResEncCtx; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
477 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
478 |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
479 static bool fmtEncodeSupeResRun(DMSupeResEncCtx *ctx) |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
480 { |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
481 if (ctx->cnt2 == 255) |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
482 ctx->cnt2 = 0x24; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
483 else |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
484 if (ctx->cnt2 > 216) |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
485 { |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
486 if (!dmGrowBufPutU8(ctx->buf, 0x25)) |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
487 return false; |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
488 } |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
489 else |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
490 ctx->cnt2 += 0x26; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
491 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
492 if (!dmGrowBufPutU8(ctx->buf, ctx->cnt2)) |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
493 return false; |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
494 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
495 ctx->cnt1 = ctx->cnt2 = 0; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
496 |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
497 return true; |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
498 } |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
499 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
500 |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
501 static bool fmtEncodeSupeResFlush(DMSupeResEncCtx *ctx) |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
502 { |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
503 ctx->cnt1 += 0x26; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
504 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
505 if (!dmGrowBufPutU8(ctx->buf, 0x20) || |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
506 !dmGrowBufPutU8(ctx->buf, ctx->cnt1)) |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
507 return false; |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
508 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
509 return fmtEncodeSupeResRun(ctx); |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
510 } |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
511 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
512 |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
513 static bool fmtEncodeSupeResSection(DMSupeResEncCtx *ctx, const DMC64MemBlock *blk) |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
514 { |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
515 for (size_t offs = 0; offs < blk->size; offs++) |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
516 { |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
517 ctx->dbyte = blk->data[offs]; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
518 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
519 if ((ctx->cnt1 == 0 && offs + 1 < blk->size && ctx->dbyte == blk->data[offs + 1]) || |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
520 (ctx->cnt1 != 0 && ctx->dbyte == ctx->cnt2)) |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
521 { |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
522 ctx->cnt1++; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
523 ctx->cnt2 = ctx->dbyte; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
524 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
525 if (ctx->cnt1 >= 215 && |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
526 !fmtEncodeSupeResFlush(ctx)) |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
527 return false; |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
528 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
529 continue; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
530 } |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
531 else |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
532 if (ctx->cnt1 != 0 && ctx->dbyte != ctx->cnt2) |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
533 { |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
534 if (!fmtEncodeSupeResFlush(ctx)) |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
535 return false; |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
536 } |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
537 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
538 ctx->cnt2 = ctx->dbyte; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
539 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
540 if (!fmtEncodeSupeResRun(ctx)) |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
541 return false; |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
542 } |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
543 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
544 if (ctx->cnt1 > 0) |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
545 return fmtEncodeSupeResFlush(ctx); |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
546 |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
547 return true; |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
548 } |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
549 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
550 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
551 static int fmtEncodeSupeRes(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
552 { |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
553 DMSupeResEncCtx ctx; |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
554 bool bres = false; |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
555 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
556 // Output magic header and data type |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
557 if (!dmGrowBufPut(buf, fmtSupeRes_MagicID_1, sizeof(fmtSupeRes_MagicID_1)) || |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
558 !dmGrowBufPutU8(buf, fmt->extra)) |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
559 { |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
560 return dmError(DMERR_MALLOC, |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
561 "Error outputting SupeRes magic header.\n"); |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
562 } |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
563 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
564 memset(&ctx, 0, sizeof(ctx)); |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
565 ctx.buf = buf; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
566 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
567 switch (fmt->extra) |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
568 { |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
569 case 0x23: |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
570 case 0x25: |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
571 bres = |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
572 fmtEncodeSupeResSection(&ctx, &img->screen[0]) && |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
573 fmtEncodeSupeResSection(&ctx, &img->bitmap[0]); |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
574 break; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
575 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
576 case 0x24: |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
577 case 0x26: |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
578 ctx.cnt2 = img->bgcolor; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
579 bres = |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
580 fmtEncodeSupeResRun(&ctx) && |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
581 fmtEncodeSupeResSection(&ctx, &img->screen[0]) && |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
582 fmtEncodeSupeResSection(&ctx, &img->color[0]) && |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
583 fmtEncodeSupeResSection(&ctx, &img->bitmap[0]); |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
584 break; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
585 } |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
586 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
587 return bres ? DMERR_OK : DMERR_MALLOC; |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
588 } |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
589 |
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
590 |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
591 static const Uint8 fmtMarqPETSCII_ID1[] = |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
592 { |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
593 0x01, 0x08, 0x0b, 0x08, 0xef, 0x00, 0x9e, 0x32, 0x30, 0x36, |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
594 0x31, 0x00, 0x00, 0x00, 0xa9, 0x0b, 0x8d, 0x11, 0xd0, |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
595 }; |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
596 |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
597 static const Uint8 fmtMarqPETSCII_ID2[] = |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
598 { |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
599 0xa9, 0x00, 0x8d, 0x18, 0xd0, // lda #? : sta $d018 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
600 0xa9, 0x00, 0x8d, 0x20, 0xd0, // lda #? : sta $d020 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
601 0xa9, 0x00, 0x8d, 0x21, 0xd0, // lda #? : sta $d021 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
602 }; |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
603 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
604 static const Uint8 fmtMarqPETSCII_ID3[] = |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
605 { |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
606 0xa2, 0x00, 0xa0, 0xfa, 0xbd, 0x61, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
607 0x08, 0x9d, 0x00, 0x04, 0xbd, 0x5b, 0x09, 0x9d, 0xfa, 0x04, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
608 0xbd, 0x55, 0x0a, 0x9d, 0xf4, 0x05, 0xbd, 0x4f, 0x0b, 0x9d, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
609 0xee, 0x06, 0xbd, 0x49, 0x0c, 0x9d, 0x00, 0xd8, 0xbd, 0x43, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
610 0x0d, 0x9d, 0xfa, 0xd8, 0xbd, 0x3d, 0x0e, 0x9d, 0xf4, 0xd9, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
611 0xbd, 0x37, 0x0f, 0x9d, 0xee, 0xda, 0xe8, 0x88, 0xd0, 0xcc, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
612 0xa9, 0x1b, 0x8d, 0x11, 0xd0, 0x4c, 0x5e, 0x08, |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
613 }; |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
614 |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
615 |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
616 static int fmtProbeMarqPETSCII(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
617 { |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
618 (void) fmt; |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
619 |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
620 if (buf->len == 2098 && |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
621 DM_MEMCMP_SIZE(buf->data, fmtMarqPETSCII_ID1) == 0 && |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
622 DM_MEMCMP_SIZE(buf->data + sizeof(fmtMarqPETSCII_ID1) + |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
623 sizeof(fmtMarqPETSCII_ID2), fmtMarqPETSCII_ID3) == 0 |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
624 ) |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
625 return DM_PROBE_SCORE_MAX; |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
626 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
627 return DM_PROBE_SCORE_FALSE; |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
628 } |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
629 |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
630 |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
631 static int fmtDecodeHiresPETSCIICharsetData(const DMC64EncDecOp *op, DMC64Image *img, |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
632 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
633 { |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
634 (void) fmt; |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
635 Uint8 val; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
636 |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
637 switch (buf->data[op->offs]) |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
638 { |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
639 case 0x14: val = 0; break; // upper case |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
640 case 0x17: val = 1; break; // lower case |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
641 default: |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
642 return DMERR_INVALID_DATA; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
643 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
644 |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
645 img->extraInfo[D64_EI_CHAR_CASE] = val; |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
646 img->extraInfo[D64_EI_MODE] = D64_FMT_HIRES | D64_FMT_CHAR; |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
647 img->extraInfo[D64_EI_CHAR_CUSTOM] = 0; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
648 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
649 return DMERR_OK; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
650 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
651 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
652 |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
653 static int fmtEncodeHiresPETSCIICharsetData( |
2428
09082816665d
Fix write support of Abyss Connection PETSCII-Editor 4.61 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2399
diff
changeset
|
654 const DMC64EncDecOp *op, DMGrowBuf *buf, const DMC64Image *img, |
09082816665d
Fix write support of Abyss Connection PETSCII-Editor 4.61 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2399
diff
changeset
|
655 const DMC64ImageCommonFormat *fmt) |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
656 { |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
657 Uint8 val; |
2428
09082816665d
Fix write support of Abyss Connection PETSCII-Editor 4.61 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2399
diff
changeset
|
658 (void) fmt; |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
659 |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
660 switch (img->extraInfo[D64_EI_CHAR_CASE]) |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
661 { |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
662 case 0: val = 0x14; break; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
663 case 1: val = 0x17; break; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
664 default: return DMERR_INVALID_DATA; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
665 } |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
666 |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
667 buf->data[op->offs + 2] = val; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
668 |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
669 return DMERR_OK; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
670 } |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
671 |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
672 |
2366
1e6e018b6487
Rename some functions to be more consistent with their intent.
Matti Hamalainen <ccr@tnsp.org>
parents:
2363
diff
changeset
|
673 static int fmtEncodeMarqPETSCIIData(const DMC64EncDecOp *op, DMGrowBuf *buf, |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
674 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
675 { |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
676 memcpy(buf->data, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
677 fmtMarqPETSCII_ID1, sizeof(fmtMarqPETSCII_ID1)); |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
678 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
679 memcpy(buf->data + sizeof(fmtMarqPETSCII_ID1), |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
680 fmtMarqPETSCII_ID2, sizeof(fmtMarqPETSCII_ID2)); |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
681 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
682 memcpy(buf->data + sizeof(fmtMarqPETSCII_ID1) + sizeof(fmtMarqPETSCII_ID2), |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
683 fmtMarqPETSCII_ID3, sizeof(fmtMarqPETSCII_ID3)); |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
684 |
2428
09082816665d
Fix write support of Abyss Connection PETSCII-Editor 4.61 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2399
diff
changeset
|
685 return fmtEncodeHiresPETSCIICharsetData(op, buf, img, fmt); |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
686 } |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
687 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
688 |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
689 static const Uint8 fmtPetsciiKrisszHu_ID1[] = |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
690 { |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
691 0x01, 0x08, 0x0b, 0x08, 0x0A, 0x00, 0x9E, 0x32, 0x30, 0x36, |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
692 0x31, 0x00, 0x00, 0x00, 0xA9, |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
693 }; |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
694 |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
695 static const Uint8 fmtPetsciiKrisszHu_ID2[] = |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
696 { |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
697 0x8d, 0x11, 0xd0, 0xa9, 0x80, 0x8d, 0x91, 0x02, 0xa9, 0x18, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
698 }; |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
699 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
700 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
701 static int fmtProbePetsciiKrisszHu(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
702 { |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
703 (void) fmt; |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
704 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
705 if (buf->len == 10193 && |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
706 DM_MEMCMP_SIZE(buf->data, fmtPetsciiKrisszHu_ID1) == 0 && |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
707 DM_MEMCMP_SIZE(buf->data + 0x10, fmtPetsciiKrisszHu_ID2) == 0 |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
708 ) |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
709 return DM_PROBE_SCORE_MAX; |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
710 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
711 return DM_PROBE_SCORE_FALSE; |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
712 } |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
713 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
714 |
2366
1e6e018b6487
Rename some functions to be more consistent with their intent.
Matti Hamalainen <ccr@tnsp.org>
parents:
2363
diff
changeset
|
715 static int fmtDecodePetsciiKrisszHuData(const DMC64EncDecOp *op, DMC64Image *img, |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
716 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
717 { |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
718 (void) op; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
719 (void) buf; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
720 (void) fmt; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
721 |
2596
353192a5100a
Add tiny comment about issues with ECM support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2595
diff
changeset
|
722 // XXX TODO: ECM support is buggy, see |
353192a5100a
Add tiny comment about issues with ECM support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2595
diff
changeset
|
723 // samples/64/petscii/them_balls_dont_touch_by_aomeba_ald.prg |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
724 const Uint8 *data = img->extraData[0].data; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
725 switch (data[0x0028 - 2]) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
726 { |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
727 case 0x00: |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
728 img->extraInfo[D64_EI_MODE] = D64_FMT_HIRES | D64_FMT_CHAR; |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
729 img->d020 = data[0x001e - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
730 img->bgcolor = data[0x0023 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
731 break; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
732 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
733 case 0xd8: |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
734 img->extraInfo[D64_EI_MODE] = D64_FMT_MC | D64_FMT_CHAR; |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
735 img->d020 = data[0x001e - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
736 img->bgcolor = data[0x0023 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
737 img->d022 = data[0x002d - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
738 img->d023 = data[0x0032 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
739 break; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
740 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
741 case 0x01: |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
742 img->extraInfo[D64_EI_MODE] = D64_FMT_ECM | D64_FMT_CHAR; |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
743 img->d020 = data[0x001e - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
744 img->bgcolor = data[0x0023 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
745 img->d022 = data[0x0028 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
746 img->d023 = data[0x002d - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
747 img->d024 = data[0x0032 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
748 break; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
749 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
750 default: |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
751 return DMERR_INVALID_DATA; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
752 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
753 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
754 // XXX TODO this format saves the charset data (for 256 chars) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
755 // in the PRG and there is no direct indication whether it is |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
756 // a customized one or copy of C64 ROM charset .. we could |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
757 // implement a hash-based detection at some point. |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
758 img->extraInfo[D64_EI_CHAR_CASE] = 0; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
759 img->extraInfo[D64_EI_CHAR_CUSTOM] = 1; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
760 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
761 return DMERR_OK; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
762 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
763 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
764 |
2377
d8889ff223b6
UPETSCII is actually old version of Marq's PETSCII editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
2371
diff
changeset
|
765 static int fmtDecodeMarqOldData(const DMC64EncDecOp *op, DMC64Image *img, |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
766 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
767 { |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
768 (void) op; |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
769 (void) buf; |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
770 (void) fmt; |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
771 |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
772 img->extraInfo[D64_EI_MODE] = D64_FMT_HIRES | D64_FMT_CHAR; |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
773 img->extraInfo[D64_EI_CHAR_CUSTOM] = 0; |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
774 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
775 return DMERR_OK; |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
776 } |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
777 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
778 |
2367
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
779 static const Uint8 fmtCocaPETSCII_ID1[] = |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
780 { |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
781 0x01, 0x08, 0x0b, 0x08, 0x0a, 0x00, 0x9e, 0x32, 0x30, 0x36, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
782 0x31, 0x00, 0x00, 0x00, 0x78, 0xa2, 0x00, 0xbd, 0x5a, 0x08, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
783 0x9d, 0x00, 0x04, 0xbd, 0x5a, 0x09, 0x9d, 0x00, 0x05, 0xbd, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
784 0x5a, 0x0a, 0x9d, 0x00, 0x06, 0xbd, 0x5a, 0x0b, 0x9d, 0x00, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
785 0x07, 0xbd, 0x5a, 0x0c, 0x9d, 0x00, 0xd8, 0xbd, 0x5a, 0x0d, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
786 0x9d, 0x00, 0xd9, 0xbd, 0x5a, 0x0e, 0x9d, 0x00, 0xda, 0xbd, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
787 0x5a, 0x0f, 0x9d, 0x00, 0xdb, 0xe8, 0xd0, 0xcd, 0xad, 0x42, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
788 0x0c, 0x8d, 0x20, 0xd0, 0xad, 0x43, 0x0c, 0x8d, 0x21, 0xd0, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
789 0xad, 0x44, 0x0c, 0x8d, 0x18, 0xd0, 0x4c, 0x55, 0x08 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
790 }; |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
791 |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
792 |
2367
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
793 static int fmtProbeCocaPETSCII(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
794 { |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
795 (void) fmt; |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
796 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
797 if (buf->len == 2115 && |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
798 DM_MEMCMP_SIZE(buf->data, fmtCocaPETSCII_ID1) == 0 && |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
799 buf->data[0x0c44 - 0x0801 + 2] == 0x14) |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
800 return DM_PROBE_SCORE_MAX; |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
801 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
802 return DM_PROBE_SCORE_FALSE; |
2367
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
803 } |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
804 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
805 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
806 static int fmtEncodeCocaPETSCIIData(const DMC64EncDecOp *op, DMGrowBuf *buf, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
807 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
808 { |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
809 memcpy(buf->data, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
810 fmtCocaPETSCII_ID1, sizeof(fmtCocaPETSCII_ID1)); |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
811 |
2428
09082816665d
Fix write support of Abyss Connection PETSCII-Editor 4.61 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2399
diff
changeset
|
812 return fmtEncodeHiresPETSCIICharsetData(op, buf, img, fmt); |
2367
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
813 } |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
814 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
815 |
2015
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
816 static int fmtProbeKoalaPainter(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
817 { |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
818 int score = DM_PROBE_SCORE_FALSE; |
2015
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
819 |
2591
b2c510f851dc
Adjust Koala format probing to allow for file lengths between 10002 and
Matti Hamalainen <ccr@tnsp.org>
parents:
2586
diff
changeset
|
820 if (buf->len >= 10002 && |
b2c510f851dc
Adjust Koala format probing to allow for file lengths between 10002 and
Matti Hamalainen <ccr@tnsp.org>
parents:
2586
diff
changeset
|
821 buf->len <= 10004) |
2015
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
822 score += DM_PROBE_SCORE_MAYBE; |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
823 |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
824 if (dmCompareAddr16(buf, 0, fmt->addr)) |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
825 score += DM_PROBE_SCORE_MAYBE; |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
826 |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
827 return score; |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
828 } |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
829 |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
830 |
1815
2b68b6955635
Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents:
1813
diff
changeset
|
831 static int fmtProbeKoalaPainterPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1594
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
832 { |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
833 // Attempt to prevent misprobes of unpacked Koala and Run Paint |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
834 if (buf->len > 30 && |
2112
9dc2976e9fa3
Improve probing of packed and unpacked Koala files. Many converters and
Matti Hamalainen <ccr@tnsp.org>
parents:
2080
diff
changeset
|
835 buf->len < 10002 && |
1594
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
836 dmCompareAddr16(buf, 0, fmt->addr)) |
1771 | 837 return DM_PROBE_SCORE_GOOD; |
1594
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
838 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
839 return DM_PROBE_SCORE_FALSE; |
1594
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
840 } |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
841 |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
842 |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
843 static int fmtProbeDoodle(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
844 { |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
845 if (buf->len > 32 && |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
846 (dmCompareAddr16(buf, 0, 0x1c00) || dmCompareAddr16(buf, 0, 0x5c00))) |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
847 { |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
848 // Packed variant |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
849 if (fmt->extra == 0xfe && |
1841
fc4841460fad
Attempt to avoid misprobes of "Rainbow Painter (unpacked)" as packed Doodle files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1840
diff
changeset
|
850 buf->len != 10242) // Attempt to avoid misprobes of "Rainbow Painter (unpacked)" |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
851 return DM_PROBE_SCORE_MAX; |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
852 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
853 // Unpacked variant |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
854 if (fmt->extra != 0xfe && buf->len == fmt->size) |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
855 return DM_PROBE_SCORE_MAX; |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
856 } |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
857 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
858 return DM_PROBE_SCORE_FALSE; |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
859 } |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
860 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
861 |
2161
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
862 static int fmtProbeArtStudio(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
863 { |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
864 if ((buf->len == fmt->size || buf->len == 9002) && |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
865 dmCompareAddr16(buf, 0, 0x2000)) |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
866 return DM_PROBE_SCORE_MAX; |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
867 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
868 return DM_PROBE_SCORE_FALSE; |
2161
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
869 } |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
870 |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
871 |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
872 static int fmtDecodeStaticRLEMarkerMode2(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1578
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
873 { |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
874 int res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
875 DMGrowBuf mem; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
876 DMCompParams cfg; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
877 |
1711
4fd94bf558b3
Add function name field to DMCompParams struct and set it in places where we use DMCompParams.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
878 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
879 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
880 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_2; |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
881 cfg.rleMarkerB = fmt->extra; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
882 |
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
883 if ((res = dmDecodeGenericRLEAlloc(&mem, buf, &cfg)) != DMERR_OK) |
1578
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
884 goto out; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
885 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
886 res = dmC64DecodeGenericBMP(img, &mem, fmt); |
1578
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
887 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
888 out: |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
889 dmGrowBufFree(&mem); |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
890 return res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
891 } |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
892 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
893 |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
894 static int fmtEncodeStaticRLEMarkerMode2(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) |
1578
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
895 { |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
896 int res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
897 DMGrowBuf tmp; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
898 DMCompParams cfg; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
899 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
900 // Encode the data to temp buffer |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
901 if ((res = dmC64EncodeGenericBMP(true, &tmp, img, fmt)) != DMERR_OK) |
1578
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
902 goto out; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
903 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
904 // And now RLE compress the data to the existing buffer |
1711
4fd94bf558b3
Add function name field to DMCompParams struct and set it in places where we use DMCompParams.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
905 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
906 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
907 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_2; |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
908 cfg.rleMarkerB = fmt->extra; |
1855
5e33f367bafe
Adjust the minimum byte run RLE counts from 3 to 4.
Matti Hamalainen <ccr@tnsp.org>
parents:
1854
diff
changeset
|
909 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
910 cfg.rleMaxCountB = 255; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
911 res = dmEncodeGenericRLE(buf, &tmp, &cfg); |
1578
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
912 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
913 out: |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
914 dmGrowBufFree(&tmp); |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
915 return res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
916 } |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
917 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
918 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
919 static int fmtProbeDrazPaint20Packed(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
920 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
921 const Uint8 *ident = buf->data + 2; |
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
922 if (buf->len > 22 && |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
923 dmCompareAddr16(buf, 0, fmt->addr) && |
2080
7e4087e2740d
Define macros DM_MEMCMP_SIZE() and DM_MEMCMP_LEN() as helpers.
Matti Hamalainen <ccr@tnsp.org>
parents:
2056
diff
changeset
|
924 DM_MEMCMP_LEN(ident, "DRAZPAINT ") == 0 && |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
925 ident[11] == '.' && ( |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
926 (ident[10] == '1' && ident[12] == '4') || |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
927 (ident[10] == '2' && ident[12] == '0') |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
928 )) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
929 return DM_PROBE_SCORE_MAX; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
930 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
931 return DM_PROBE_SCORE_FALSE; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
932 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
933 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
934 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
935 static int fmtDecodeDrazPaintPacked(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
936 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
937 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
938 DMGrowBuf mem, tmp; |
1505
3265175b24d2
Change the passing of RLE compression/decompression parameters to be in a dedicated struct.
Matti Hamalainen <ccr@tnsp.org>
parents:
1503
diff
changeset
|
939 DMCompParams cfg; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
940 |
1711
4fd94bf558b3
Add function name field to DMCompParams struct and set it in places where we use DMCompParams.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
941 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
942 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
943 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1; |
1712 | 944 cfg.rleMarkerB = buf->data[0x0d]; |
1505
3265175b24d2
Change the passing of RLE compression/decompression parameters to be in a dedicated struct.
Matti Hamalainen <ccr@tnsp.org>
parents:
1503
diff
changeset
|
945 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
946 if ((res = dmDecodeGenericRLEAlloc(&mem, |
1747
5e928618fdc8
Change DMGrowBuf API somewhat and implement more copy operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
1746
diff
changeset
|
947 dmGrowBufConstCopyOffs(&tmp, buf, 0x0e), &cfg)) != DMERR_OK) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
948 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
949 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
950 res = dmC64DecodeGenericBMP(img, &mem, fmt); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
951 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
952 out: |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
953 dmGrowBufFree(&mem); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
954 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
955 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
956 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
957 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
958 static int fmtEncodeDrazPaintPacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
959 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
960 int res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
961 DMGrowBuf tmp; |
1505
3265175b24d2
Change the passing of RLE compression/decompression parameters to be in a dedicated struct.
Matti Hamalainen <ccr@tnsp.org>
parents:
1503
diff
changeset
|
962 DMCompParams cfg; |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
963 const char *magicID = (fmt->format->mode & D64_FMT_ILACE) ? "DRAZLACE! 1.0" : "DRAZPAINT 2.0"; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
964 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
965 // Encode the data to temp buffer |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
966 if ((res = dmC64EncodeGenericBMP(true, &tmp, img, fmt)) != DMERR_OK) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
967 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
968 |
1650
9233da9de92c
Refactor RLE encoding a bit, and add support for 16bit run counts and make things more configurable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1649
diff
changeset
|
969 // Analyze and setup RLE |
1711
4fd94bf558b3
Add function name field to DMCompParams struct and set it in places where we use DMCompParams.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
970 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
971 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
972 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1; |
1855
5e33f367bafe
Adjust the minimum byte run RLE counts from 3 to 4.
Matti Hamalainen <ccr@tnsp.org>
parents:
1854
diff
changeset
|
973 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
974 cfg.rleMaxCountB = 255; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
975 |
2329
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
976 if ((res = dmGenericRLEAnalyze(&tmp, &cfg)) != DMERR_OK) |
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
977 goto out; |
1661
dc3fbd130db7
RLE analyze was ran before setting up the compression config. Oops. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1660
diff
changeset
|
978 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
979 // Add the header bits |
1697
1036b0dcccb5
Refactor DMGrowBuf so that there can be buffers that grow "backwards".
Matti Hamalainen <ccr@tnsp.org>
parents:
1684
diff
changeset
|
980 if (!dmGrowBufPut(buf, (Uint8 *) magicID, strlen(magicID)) || |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
981 !dmGrowBufPutU8(buf, cfg.rleMarkerB)) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
982 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
983 res = DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
984 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
985 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
986 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
987 // And now RLE compress the data to the existing buffer |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
988 res = dmEncodeGenericRLE(buf, &tmp, &cfg); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
989 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
990 out: |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
991 dmGrowBufFree(&tmp); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
992 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
993 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
994 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
995 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
996 static int fmtProbeDrazLace10Packed(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
997 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
998 if (buf->len > 22 && |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
999 dmCompareAddr16(buf, 0, fmt->addr) && |
2080
7e4087e2740d
Define macros DM_MEMCMP_SIZE() and DM_MEMCMP_LEN() as helpers.
Matti Hamalainen <ccr@tnsp.org>
parents:
2056
diff
changeset
|
1000 DM_MEMCMP_LEN(buf->data + 2, "DRAZLACE! 1.0") == 0) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1001 return DM_PROBE_SCORE_MAX; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1002 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1003 return DM_PROBE_SCORE_FALSE; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1004 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1005 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1006 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
1007 static int fmtDrazLaceGetLaceType(const DMC64EncDecOp *op, DMC64Image *img, |
1984
e7f2ddaf94a6
Change encode and decode function format parameter type from DMC64ImageFormat to DMC64ImageCommonFormat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1983
diff
changeset
|
1008 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1009 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1010 (void) fmt; |
1930
c048da352279
Default to D64_ILACE_RES if the given buffer is NULL in fmtDrazLaceGetLaceType().
Matti Hamalainen <ccr@tnsp.org>
parents:
1922
diff
changeset
|
1011 |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
1012 img->extraInfo[D64_EI_ILACE_TYPE] = buf->data[op->offs] ? D64_ILACE_RES : D64_ILACE_COLOR; |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
1013 return DMERR_OK; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1014 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1015 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1016 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
1017 static int fmtDrazLaceSetLaceType(const DMC64EncDecOp *op, DMGrowBuf *buf, |
1984
e7f2ddaf94a6
Change encode and decode function format parameter type from DMC64ImageFormat to DMC64ImageCommonFormat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1983
diff
changeset
|
1018 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) |
1535 | 1019 { |
1020 (void) fmt; | |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
1021 buf->data[op->offs] = (img->extraInfo[D64_EI_ILACE_TYPE] == D64_ILACE_RES) ? 1 : 0; |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
1022 return DMERR_OK; |
1535 | 1023 } |
1024 | |
1025 | |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1026 static int fmtGetPixelDrazLace(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1027 const DMC64Image *img, const int rasterX, const int rasterY) |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1028 { |
2313
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
1029 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
1030 (void) vshift; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1031 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1032 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 1033 bmoffs, scroffs, |
2313
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
1034 6 - (rasterX & 6), 0, |
2133 | 1035 rasterX & 1, 0, img->bgcolor); |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1036 } |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1037 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1038 |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
1039 static const char *fmtBDP5_MagicID = "BDP 5.00"; |
1662 | 1040 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1041 static int fmtProbeBDP5Packed(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1042 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1043 if (buf->len > 20 && |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1044 dmCompareAddr16(buf, 0, fmt->addr) && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
1045 DM_MEMCMP_LEN(buf->data + 2, fmtBDP5_MagicID) == 0) |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1046 return DM_PROBE_SCORE_MAX; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1047 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1048 return DM_PROBE_SCORE_FALSE; |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1049 } |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1050 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1051 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1052 static int fmtDecodeBDP5Packed(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1053 { |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1054 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1055 DMGrowBuf mem, tmp; |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1056 DMCompParams cfg; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1057 |
1711
4fd94bf558b3
Add function name field to DMCompParams struct and set it in places where we use DMCompParams.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
1058 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1059 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1060 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_WORD_RUNS | DM_COMP_RLE_ORDER_1; |
1712 | 1061 cfg.rleMarkerB = buf->data[8]; |
1062 cfg.rleMarkerW = buf->data[9]; | |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1063 |
1791
ae53df2156ed
Add buffer expansion quirk to Boogie Down Paint decoder, as it seems to be needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1789
diff
changeset
|
1064 // Boogie Down Paint apparently is broken and stores one byte less |
ae53df2156ed
Add buffer expansion quirk to Boogie Down Paint decoder, as it seems to be needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1789
diff
changeset
|
1065 // than it should in some cases so we need to do some crappy buffer |
ae53df2156ed
Add buffer expansion quirk to Boogie Down Paint decoder, as it seems to be needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1789
diff
changeset
|
1066 // expansion here .. |
ae53df2156ed
Add buffer expansion quirk to Boogie Down Paint decoder, as it seems to be needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1789
diff
changeset
|
1067 if (dmGrowBufCopyOffs(&tmp, buf, 10, 1) == NULL) |
ae53df2156ed
Add buffer expansion quirk to Boogie Down Paint decoder, as it seems to be needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1789
diff
changeset
|
1068 return DMERR_MALLOC; |
ae53df2156ed
Add buffer expansion quirk to Boogie Down Paint decoder, as it seems to be needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1789
diff
changeset
|
1069 |
ae53df2156ed
Add buffer expansion quirk to Boogie Down Paint decoder, as it seems to be needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1789
diff
changeset
|
1070 tmp.len = tmp.size; |
ae53df2156ed
Add buffer expansion quirk to Boogie Down Paint decoder, as it seems to be needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1789
diff
changeset
|
1071 |
ae53df2156ed
Add buffer expansion quirk to Boogie Down Paint decoder, as it seems to be needed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1789
diff
changeset
|
1072 if ((res = dmDecodeGenericRLEAlloc(&mem, &tmp, &cfg)) != DMERR_OK) |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1073 goto out; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1074 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1075 res = dmC64DecodeGenericBMP(img, &mem, fmt); |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1076 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1077 out: |
1792
905c09049fe6
Oops, forgot to free the buffer allocated in the BDP5 decoder. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1791
diff
changeset
|
1078 dmGrowBufFree(&tmp); |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1079 dmGrowBufFree(&mem); |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1080 return res; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1081 } |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1082 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
1083 |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1084 static int fmtEncodeBDP5Packed(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1085 { |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1086 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1087 DMGrowBuf mem; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1088 DMCompParams cfg; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1089 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1090 // Encode the data to temp buffer |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
1091 if ((res = dmC64EncodeGenericBMP(true, &mem, img, fmt)) != DMERR_OK) |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1092 goto out; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1093 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1094 // Analyze and setup RLE |
1711
4fd94bf558b3
Add function name field to DMCompParams struct and set it in places where we use DMCompParams.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
1095 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1096 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1097 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_WORD_RUNS | DM_COMP_RLE_ORDER_1; |
1855
5e33f367bafe
Adjust the minimum byte run RLE counts from 3 to 4.
Matti Hamalainen <ccr@tnsp.org>
parents:
1854
diff
changeset
|
1098 cfg.rleMinCountB = 4; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1099 cfg.rleMaxCountB = 255; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1100 cfg.rleMinCountW = 256; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1101 cfg.rleMaxCountW = 1024; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1102 |
2329
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
1103 if ((res = dmGenericRLEAnalyze(&mem, &cfg)) != DMERR_OK) |
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
1104 goto out; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1105 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1106 // Add the header bits |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
1107 if (!dmGrowBufPut(buf, (Uint8 *) fmtBDP5_MagicID, strlen(fmtBDP5_MagicID)) || |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1108 !dmGrowBufPutU8(buf, cfg.rleMarkerB) || |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1109 !dmGrowBufPutU8(buf, cfg.rleMarkerW)) |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1110 { |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1111 res = DMERR_MALLOC; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1112 goto out; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1113 } |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1114 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1115 // And now RLE compress the data to the existing buffer |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1116 res = dmEncodeGenericRLE(buf, &mem, &cfg); |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1117 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1118 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1119 dmGrowBufFree(&mem); |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1120 return res; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1121 } |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1122 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
1123 |
2185
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
1124 static const char *fmtGunPaint_MagicID = "GUNPAINT (JZ) "; |
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
1125 #define fmtGunPaint_MagicLen (16) |
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
1126 #define fmtGunPaint_MagicOffs (0x03e8) |
1776
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
1127 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1128 static int fmtProbeGunPaint(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1129 { |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
1130 if (buf->len > fmtGunPaint_MagicOffs + fmtGunPaint_MagicLen && |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1131 dmCompareAddr16(buf, 0, fmt->addr) && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
1132 memcmp(buf->data + fmtGunPaint_MagicOffs + 2, fmtGunPaint_MagicID, fmtGunPaint_MagicLen) == 0) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1133 return DM_PROBE_SCORE_MAX; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1134 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1135 return DM_PROBE_SCORE_FALSE; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1136 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1137 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1138 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
1139 static int fmtEncodeGunPaint(const DMC64EncDecOp *op, DMGrowBuf *buf, |
1984
e7f2ddaf94a6
Change encode and decode function format parameter type from DMC64ImageFormat to DMC64ImageCommonFormat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1983
diff
changeset
|
1140 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) |
1776
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
1141 { |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
1142 (void) op; |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
1143 (void) img; |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
1144 (void) fmt; |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
1145 |
1946 | 1146 // Here we assume that the op triggering this function is |
1147 // at the end of the oplist, so the memory is allocated, | |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
1148 memcpy(buf->data + fmtGunPaint_MagicOffs + 2, fmtGunPaint_MagicID, fmtGunPaint_MagicLen); |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
1149 |
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
1150 return DMERR_OK; |
1776
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
1151 } |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
1152 |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
1153 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1154 static int fmtProbeAmicaPaintPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1155 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1156 size_t i, n; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1157 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1158 if (buf->len < 256 || !dmCompareAddr16(buf, 0, fmt->addr)) |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1159 return DM_PROBE_SCORE_FALSE; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1160 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1161 // Interpaint Hi-Res gives a false positive |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1162 // as do some GunPaint images .. |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1163 if (buf->len == 9002 || |
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1164 fmtProbeGunPaint(buf, fmt) > DM_PROBE_SCORE_GOOD) |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1165 return DM_PROBE_SCORE_FALSE; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1166 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1167 for (n = 0, i = 2; i < buf->len; i++) |
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1168 if (buf->data[i] == 0xC2) n++; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1169 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1170 if (n > 50) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1171 return DM_PROBE_SCORE_GOOD; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1172 if (n > 25) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1173 return DM_PROBE_SCORE_AVG; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1174 if (n > 10) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1175 return DM_PROBE_SCORE_MAYBE; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1176 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1177 return DM_PROBE_SCORE_FALSE; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1178 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1179 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1180 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1181 static int fmtDecodeAmicaPaintPacked(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1182 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1183 int res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1184 DMGrowBuf mem, tmp; |
1505
3265175b24d2
Change the passing of RLE compression/decompression parameters to be in a dedicated struct.
Matti Hamalainen <ccr@tnsp.org>
parents:
1503
diff
changeset
|
1185 DMCompParams cfg; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1186 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1187 // Amica Paint apparently is broken and stores one byte less than it should |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1188 // so we need to do some crappy buffer expansion here .. |
1751
768fddda73e9
Convert fmtDecodeAmicaPaintPacked() to use the new DMGrowBuf functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1749
diff
changeset
|
1189 if (dmGrowBufCopy(&tmp, buf, 1) == NULL) |
768fddda73e9
Convert fmtDecodeAmicaPaintPacked() to use the new DMGrowBuf functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1749
diff
changeset
|
1190 return DMERR_MALLOC; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1191 |
1751
768fddda73e9
Convert fmtDecodeAmicaPaintPacked() to use the new DMGrowBuf functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1749
diff
changeset
|
1192 tmp.len = tmp.size; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1193 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1194 // Now do an RLE decode on the enlarged buffer |
1711
4fd94bf558b3
Add function name field to DMCompParams struct and set it in places where we use DMCompParams.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
1195 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1196 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1197 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1; |
1712 | 1198 cfg.rleMarkerB = 0xC2; |
1650
9233da9de92c
Refactor RLE encoding a bit, and add support for 16bit run counts and make things more configurable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1649
diff
changeset
|
1199 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1200 if ((res = dmDecodeGenericRLEAlloc(&mem, &tmp, &cfg)) != DMERR_OK) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1201 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1202 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1203 // And finally decode to bitmap struct |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1204 res = dmC64DecodeGenericBMP(img, &mem, fmt); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1205 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1206 out: |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1207 dmGrowBufFree(&tmp); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1208 dmGrowBufFree(&mem); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1209 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1210 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1211 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1212 |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1213 static int fmtEncodeAmicaPaintPacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1214 { |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1215 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1216 DMGrowBuf mem; |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1217 DMCompParams cfg; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1218 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1219 // Encode the data to temp buffer |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
1220 if ((res = dmC64EncodeGenericBMP(true, &mem, img, fmt)) != DMERR_OK) |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1221 goto out; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1222 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1223 // And now RLE compress the data to the existing buffer |
1711
4fd94bf558b3
Add function name field to DMCompParams struct and set it in places where we use DMCompParams.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
1224 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1225 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1226 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
1227 cfg.rleMarkerB = 0xC2; |
1855
5e33f367bafe
Adjust the minimum byte run RLE counts from 3 to 4.
Matti Hamalainen <ccr@tnsp.org>
parents:
1854
diff
changeset
|
1228 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
1229 cfg.rleMaxCountB = 255; |
1650
9233da9de92c
Refactor RLE encoding a bit, and add support for 16bit run counts and make things more configurable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1649
diff
changeset
|
1230 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1231 res = dmEncodeGenericRLE(buf, &mem, &cfg); |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1232 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1233 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1234 dmGrowBufFree(&mem); |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1235 return res; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1236 } |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1237 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1238 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1239 static int fmtProbeSaracenPaint(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1772
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
1240 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1241 if ((buf->len == 10219 || buf->len == 10220) && |
1772
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
1242 dmCompareAddr16(buf, 0, fmt->addr)) |
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
1243 return DM_PROBE_SCORE_GOOD; |
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
1244 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1245 return DM_PROBE_SCORE_FALSE; |
1772
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
1246 } |
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
1247 |
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
1248 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1249 static int fmtGetPixelFLIDesigner(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1250 const DMC64Image *img, const int rasterX, const int rasterY) |
1806
dcb12cd340d3
Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1805
diff
changeset
|
1251 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1252 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1253 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1254 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 1255 bmoffs, scroffs, |
1256 vshift, rasterY & 7, | |
1257 0, 0, img->bgcolor); | |
1806
dcb12cd340d3
Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1805
diff
changeset
|
1258 } |
dcb12cd340d3
Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1805
diff
changeset
|
1259 |
dcb12cd340d3
Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1805
diff
changeset
|
1260 |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1261 static int fmtProbeBlackMailFLIPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1262 { |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1263 if (buf->len > 16 && |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1264 dmCompareAddr16(buf, 0, fmt->addr) && |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1265 dmCompareAddr16(buf, 2 + 1, fmt->addr + buf->len - 3) && |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1266 dmCompareAddr16(buf, 2 + 3, 0x7f3f)) |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1267 return DM_PROBE_SCORE_MAX; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1268 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1269 return DM_PROBE_SCORE_FALSE; |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1270 } |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1271 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1272 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1273 static int fmtDecodeBlackMailFLIPacked(DMC64Image *img, const DMGrowBuf *psrc, const DMC64ImageFormat *fmt) |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1274 { |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1275 int res; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1276 DMGrowBuf dst, src; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1277 DMCompParams cfg; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1278 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1279 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1280 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1281 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1 | DM_COMP_RLE_ZERO_COUNT_MAX | |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1282 DM_COMP_INPUT_BACKWARDS | DM_COMP_OUTPUT_BACKWARDS | DM_COMP_OUTPUT_CROP_END; |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1283 cfg.rleMarkerB = psrc->data[0]; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1284 cfg.cropOutLen = 0x4442 - 2; // Crop to unpacked size - load address |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1285 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1286 // Skip the RLE marker byte, packed data end address and unpacked data end address |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1287 dmGrowBufConstCopyOffs(&src, psrc, 1 + 2 + 2); |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1288 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1289 if ((res = dmDecodeGenericRLEAlloc(&dst, &src, &cfg)) != DMERR_OK) |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1290 goto out; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1291 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1292 res = dmC64DecodeGenericBMP(img, &dst, fmt); |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1293 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1294 out: |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1295 dmGrowBufFree(&dst); |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1296 return res; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1297 } |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1298 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1299 |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1300 static int fmtEncodeBlackMailFLIPacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1301 { |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1302 int res; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1303 DMGrowBuf tmp1, tmp2; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1304 DMCompParams cfg; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1305 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1306 dmGrowBufInit(&tmp1); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1307 dmGrowBufInit(&tmp2); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1308 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1309 // Encode the data to temp buffer |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
1310 if ((res = dmC64EncodeGenericBMP(true, &tmp1, img, fmt)) != DMERR_OK) |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1311 goto out; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1312 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1313 // And now RLE compress the data to the existing buffer |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1314 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1315 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1316 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1 | DM_COMP_RLE_ZERO_COUNT_MAX | |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1317 DM_COMP_INPUT_BACKWARDS | DM_COMP_OUTPUT_BACKWARDS; |
1855
5e33f367bafe
Adjust the minimum byte run RLE counts from 3 to 4.
Matti Hamalainen <ccr@tnsp.org>
parents:
1854
diff
changeset
|
1318 cfg.rleMinCountB = 4; |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1319 cfg.rleMaxCountB = 256; // this format allows 256 byte runs with ZERO_COUNT_MAX |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1320 |
2329
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
1321 if ((res = dmGenericRLEAnalyze(&tmp1, &cfg)) != DMERR_OK) |
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
1322 goto out; |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1323 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1324 if ((res = dmEncodeGenericRLEAlloc(&tmp2, &tmp1, &cfg)) != DMERR_OK) |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1325 goto out; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1326 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1327 // Now, finally we must put in the header etc. |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1328 if (!dmGrowBufPutU8(buf, cfg.rleMarkerB) || |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1329 !dmGrowBufPutU16LE(buf, fmt->addr + tmp2.len + 4) || |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1330 !dmGrowBufPutU16LE(buf, 0x7f3f) || |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1331 !dmGrowBufPut(buf, tmp2.data, tmp2.len)) |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1332 { |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1333 res = DMERR_MALLOC; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1334 goto out; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1335 } |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1336 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1337 out: |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1338 dmGrowBufFree(&tmp1); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1339 dmGrowBufFree(&tmp2); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1340 return res; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1341 } |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1342 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
1343 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1344 static int fmtGetPixelBlackMailFLI(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1345 const DMC64Image *img, const int rasterX, const int rasterY) |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1346 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1347 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1348 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1349 Uint8 bgcol = (unsigned) rasterY < img->extraData[0].size ? |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1350 img->extraData[0].data[rasterY] : img->bgcolor; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1351 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1352 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 1353 bmoffs, scroffs, |
1354 vshift, rasterY & 7, | |
2222
75b5bb490f38
Add & 15 to deeper helper functions and remove it from unnecessary places.
Matti Hamalainen <ccr@tnsp.org>
parents:
2208
diff
changeset
|
1355 0, 0, bgcol); |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1356 } |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1357 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1358 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1359 static int fmtGetPixelTruePaint(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1360 const DMC64Image *img, const int rasterX, const int rasterY) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1361 { |
2313
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
1362 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
1363 (void) vshift; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1364 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1365 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 1366 bmoffs, scroffs, |
2313
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
1367 6 - (rasterX & 6), 0, |
2133 | 1368 rasterX & 1, 0, img->bgcolor); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1369 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1370 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1371 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1372 static int fmtProbeTruePaintPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1373 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1374 // The beginning/un-changing part of the BASIC bootstrap and |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1375 // relocation of decompression code |
1684 | 1376 static const Uint8 magicID[] = { |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1377 0x0b, 0x08, 0x09, 0x00, 0x9e, 0x32, 0x30, 0x35, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1378 0x39, 0x00, 0xa2, 0x00, 0x78, 0xbd, 0x1c, 0x08, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1379 0x9d, 0xf5, 0x00, 0xe8, 0xd0, 0xf7, 0xe6, 0x01, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1380 0x4c, 0x01, 0x01, 0xa5, 0xfe, 0xd0, 0x02, 0xc6, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1381 0xff, 0xc6, 0xfe |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1382 }; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1383 |
1789
9f5c5ab0e85e
Adjust True Paint probing to be slightly more forgiving vs. file size.
Matti Hamalainen <ccr@tnsp.org>
parents:
1788
diff
changeset
|
1384 if (buf->len >= 320 && |
9f5c5ab0e85e
Adjust True Paint probing to be slightly more forgiving vs. file size.
Matti Hamalainen <ccr@tnsp.org>
parents:
1788
diff
changeset
|
1385 dmCompareAddr16(buf, 0, fmt->addr) && |
2080
7e4087e2740d
Define macros DM_MEMCMP_SIZE() and DM_MEMCMP_LEN() as helpers.
Matti Hamalainen <ccr@tnsp.org>
parents:
2056
diff
changeset
|
1386 DM_MEMCMP_SIZE(buf->data + 2, magicID) == 0) |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1387 return DM_PROBE_SCORE_MAX; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1388 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1389 return DM_PROBE_SCORE_FALSE; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1390 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1391 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1392 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1393 // |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1394 // Based on disassembly of the depacker routine. Encoding seems to be |
1714
95317672ff00
Improve a comment on TruePaint encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1712
diff
changeset
|
1395 // some kind of "improved RLE" variant with different modes and a |
95317672ff00
Improve a comment on TruePaint encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1712
diff
changeset
|
1396 // simplistic "codebook". |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1397 // |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1398 static int fmtTruePaintGetByte(DMGrowBuf *src, Uint8 *data, const int mode) |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1399 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1400 if (!dmGrowBufGetU8(src, data)) |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1401 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1402 return dmError(DMERR_INVALID_DATA, |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1403 "TruePaintRLE: Out of input data (N=%d)\n", mode); |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1404 } |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1405 else |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1406 return DMERR_OK; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1407 } |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1408 |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1409 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1410 static int fmtDecodeTruePaintPacked(DMC64Image *img, const DMGrowBuf *psrc, const DMC64ImageFormat *fmt) |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1411 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1412 int res = DMERR_OK; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1413 const Uint8 *codeBook1, *codeBook2; |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1414 DMGrowBuf dst, src; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1415 DMCompParams cfg; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1416 Uint8 data; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1417 |
1724 | 1418 // 1b7e-67e8 decoded by original depacker |
1419 // 1c00-67e8 is the actual area used tho | |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1420 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1421 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1422 cfg.flags = DM_COMP_OUTPUT_BACKWARDS | DM_COMP_INPUT_BACKWARDS | DM_COMP_OUTPUT_CROP_END; |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1423 cfg.rleMarkerB = 0xfe; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1424 cfg.cropOutLen = 0x67e8 - 0x1c00; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1425 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1426 // Codebooks: #1 is trampoline table markers, #2 is RLE data table |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1427 codeBook1 = psrc->data + 0x81 - 2; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1428 codeBook2 = psrc->data + 0x85 - 2; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1429 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1430 // Allocate output buffer |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1431 if ((res = dmGrowBufAlloc(&dst, 64*1024, 4*1024)) != DMERR_OK) |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1432 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1433 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1434 // As we need to modify the offs, etc. but not the data, |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1435 // we will just make a shallow copy of the DMGrowBuf struct |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1436 dmGrowBufConstCopy(&src, psrc); |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1437 dmSetupRLEBuffers(&dst, &src, &cfg); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1438 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1439 while ((res = fmtTruePaintGetByte(&src, &data, -1)) == DMERR_OK) |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1440 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1441 unsigned int count = 1; |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
1442 bool found = false; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1443 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1444 for (int n = 0; n < 8; n++) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1445 if (codeBook1[n] == data && !found) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1446 { |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
1447 found = true; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1448 switch (n) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1449 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1450 case 4: // Y = 4, JTO = $0B |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1451 if ((res = fmtTruePaintGetByte(&src, &data, n)) != DMERR_OK) |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1452 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1453 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1454 count = data; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1455 if (data == 0) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1456 goto finish; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1457 |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1458 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1459 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1460 case 1: // Y = 1, JTO = $17 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1461 count += 2; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1462 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1463 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1464 case 0: // Y = 0, JTO = $19 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1465 if ((res = fmtTruePaintGetByte(&src, &data, n)) != DMERR_OK) |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1466 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1467 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1468 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1469 case 2: // Y = 2, JTO = $07 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1470 if ((res = fmtTruePaintGetByte(&src, &data, n)) != DMERR_OK) |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1471 goto out; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1472 |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1473 count = data; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
1474 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1475 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1476 case 3: // Y = 3, JTO = $0B |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1477 count += 2; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1478 data = 0; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1479 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1480 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1481 default: // Y = [5..8], JTO = $00 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1482 count++; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1483 data = codeBook2[n]; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1484 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1485 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1486 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1487 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1488 if ((res = dmGenericRLEOutputRun(&dst, &cfg, data, count)) != DMERR_OK) |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1489 goto out; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1490 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1491 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1492 finish: |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1493 dmFinishRLEBuffers(&dst, &src, &cfg); |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1494 res = dmC64DecodeGenericBMP(img, &dst, fmt); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1495 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1496 out: |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
1497 dmGrowBufFree(&dst); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1498 return res; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1499 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1500 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1501 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1502 static int fmtGetPixelFlinterlazer(DMC64ScanLine *scan, |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1503 const DMC64Image *img, const int rasterX, const int rasterY) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1504 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1505 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1506 const int vbank = rasterY & 7; |
2302 | 1507 Uint8 color1, color2, bgcol = img->bgcolor; |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1508 int res; |
2300
a494e4a4b6bc
Minor improvements to Flinterlazer support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2299
diff
changeset
|
1509 |
a494e4a4b6bc
Minor improvements to Flinterlazer support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2299
diff
changeset
|
1510 if ((res = dmC64GetGenericMCPixel(&color1, img, bmoffs, scroffs, vshift, vbank , 0, 0, bgcol)) != DMERR_OK || |
a494e4a4b6bc
Minor improvements to Flinterlazer support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2299
diff
changeset
|
1511 (res = dmC64GetGenericMCPixel(&color2, img, bmoffs, scroffs, vshift, vbank + 8, 1, 0, bgcol)) != DMERR_OK) |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1512 return res; |
2300
a494e4a4b6bc
Minor improvements to Flinterlazer support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2299
diff
changeset
|
1513 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1514 *(scan->col) = (color1 * D64_NCOLORS) + color2; |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1515 return DMERR_OK; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1516 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1517 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1518 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1519 enum |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1520 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1521 I_BRK = 0x00, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1522 I_RTS = 0x60, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1523 I_LDA_IMD = 0xa9, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1524 I_STA_ABS = 0x8d, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1525 }; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1526 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1527 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1528 static int fmtDecode6502SpeedCode(const DMGrowBuf *buf, DMC64Image *img, const int cbank) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1529 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1530 size_t reg_pc = 0; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1531 Uint8 reg_accu = 0;//, reg_x = 0, reg_y = 0; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1532 Uint16 reg_ptr; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1533 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1534 while (reg_pc < buf->size) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1535 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1536 Uint8 instr = buf->data[reg_pc++]; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1537 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1538 switch (instr) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1539 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1540 case I_LDA_IMD: |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1541 if (reg_pc >= buf->size) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1542 goto out; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1543 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1544 reg_accu = buf->data[reg_pc++]; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1545 break; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1546 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1547 case I_STA_ABS: |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1548 if (reg_pc >= buf->size) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1549 goto out; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1550 reg_ptr = buf->data[reg_pc++]; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1551 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1552 if (reg_pc >= buf->size) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1553 goto out; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1554 reg_ptr |= buf->data[reg_pc++] << 8; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1555 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1556 if (reg_ptr >= 0xd800 && reg_ptr <= 0xdbff) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1557 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1558 img->color[cbank].data[reg_ptr - 0xd800] = reg_accu; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1559 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1560 break; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1561 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1562 case I_RTS: |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1563 return DMERR_OK; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1564 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1565 default: |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1566 return DMERR_INVALID_DATA; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1567 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1568 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1569 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1570 out: |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1571 return DMERR_INVALID_DATA; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1572 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1573 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1574 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1575 static int fmtDecodeFlinterlazer(const DMC64EncDecOp *op, DMC64Image *img, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1576 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1577 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1578 DMGrowBuf tmp; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1579 (void) op; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1580 (void) fmt; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1581 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1582 // Flinterlazer stores color RAMs as speedcode, so we need to |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1583 // decode some 6510 instructions to get the data. |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1584 return fmtDecode6502SpeedCode( |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1585 dmGrowBufConstCopyOffsSize(&tmp, buf, 0, 0x17b2), img, 0); |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1586 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1587 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1588 |
1812
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1589 static int fmtProbeCosmosDesignsHiresManager(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1590 { |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1591 if (buf->len > 32 && dmCompareAddr16(buf, 0, fmt->addr)) |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1592 { |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1593 // Packed variant |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1594 if (fmt->size == 0 && |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1595 dmCompareAddr16(buf, 2, fmt->addr + buf->len - 3) && |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1596 dmCompareAddr16(buf, 4, 0x7ff2)) |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1597 return DM_PROBE_SCORE_MAX; |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1598 |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1599 // Unpacked variant |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1600 if (fmt->size != 0 && fmt->size == buf->len) |
2168
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1601 { |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1602 // In the unpacked format the first 0x40 bytes should be 0xff |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1603 for (size_t offs = 2; offs < 0x42; offs++) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1604 if (buf->data[offs] != 0xff) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1605 return DM_PROBE_SCORE_GOOD; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1606 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1607 return DM_PROBE_SCORE_MAX; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1608 } |
1812
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1609 } |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1610 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1611 return DM_PROBE_SCORE_FALSE; |
1812
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1612 } |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1613 |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1614 |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1615 static int fmtDecodeCosmosDesignsHiresManagerPacked(DMC64Image *img, const DMGrowBuf *psrc, const DMC64ImageFormat *fmt) |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1616 { |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1617 const size_t baseAddr = 0x4000; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1618 const size_t dstSize = 0x8000 - baseAddr; |
2604
1c80099fe47e
Cleanup CDHP decoder slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
2603
diff
changeset
|
1619 DMGrowBuf tmp; |
1c80099fe47e
Cleanup CDHP decoder slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
2603
diff
changeset
|
1620 Uint8 *dstBuf; |
1c80099fe47e
Cleanup CDHP decoder slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
2603
diff
changeset
|
1621 size_t dstOffs, srcOffs; |
1c80099fe47e
Cleanup CDHP decoder slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
2603
diff
changeset
|
1622 int res; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1623 |
2149 | 1624 // Allocate output buffer |
1625 if ((dstBuf = dmMalloc0(dstSize)) == NULL) | |
1626 { | |
1627 return dmError(DMERR_MALLOC, | |
2624
75382239c95c
Print format name in Cosmos Designs Hires Manager RLE unpacker error messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
2623
diff
changeset
|
1628 "%s: Could not allocate memory for RLE decoding buffer.\n", |
75382239c95c
Print format name in Cosmos Designs Hires Manager RLE unpacker error messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
2623
diff
changeset
|
1629 fmt->name); |
2149 | 1630 } |
1631 | |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1632 // Setup input and output offsets |
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1633 srcOffs = psrc->len - 1; |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1634 dstOffs = 0x7ff2 - baseAddr - 1; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1635 |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1636 while (dstOffs > 0 && srcOffs > 0) |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1637 { |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1638 // Get one byte of data |
2604
1c80099fe47e
Cleanup CDHP decoder slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
2603
diff
changeset
|
1639 Uint8 data = psrc->data[srcOffs]; |
1c80099fe47e
Cleanup CDHP decoder slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
2603
diff
changeset
|
1640 size_t ncount; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1641 |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1642 // Current data byte tells us the mode |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1643 if (data == 0) |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1644 { |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1645 // RLE run |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1646 if (srcOffs < 3) |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1647 { |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1648 res = dmError(DMERR_INVALID_DATA, |
2624
75382239c95c
Print format name in Cosmos Designs Hires Manager RLE unpacker error messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
2623
diff
changeset
|
1649 "%s: RLE: Invalid data/out of data for run sequence.\n", |
75382239c95c
Print format name in Cosmos Designs Hires Manager RLE unpacker error messages.
Matti Hamalainen <ccr@tnsp.org>
parents:
2623
diff
changeset
|
1650 fmt->name); |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1651 goto out; |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1652 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1653 |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1654 ncount = psrc->data[--srcOffs]; |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1655 data = psrc->data[--srcOffs]; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1656 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1657 if (dstOffs < ncount) |
2604
1c80099fe47e
Cleanup CDHP decoder slightly.
Matti Hamalainen <ccr@tnsp.org>
parents:
2603
diff
changeset
|
1658 break;; |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1659 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1660 dstOffs -= ncount; |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1661 |
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1662 for (size_t n = 0; n < ncount + 1; n++) |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1663 dstBuf[dstOffs + n] = data; |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1664 |
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1665 srcOffs--; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1666 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1667 else |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1668 { |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1669 // Literal run of data bytes |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1670 ncount = data; |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1671 if (srcOffs < ncount) |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1672 ncount = srcOffs; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1673 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1674 if (dstOffs < ncount) |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1675 ncount = dstOffs; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1676 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1677 srcOffs -= ncount; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1678 dstOffs -= ncount - 1; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1679 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1680 for (size_t n = 0; n < ncount; n++) |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1681 dstBuf[dstOffs + n] = psrc->data[srcOffs + n]; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1682 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1683 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1684 |
2152
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1685 // Fixups that the original decoder does, not necessary really |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1686 dstBuf[0x7ff0 - baseAddr] = 0x03; |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1687 dstBuf[0x7ffe - baseAddr] = dstBuf[4]; |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1688 |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1689 for (size_t n = 0; n < 0x40; n++) |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1690 dstBuf[n] = 0xff; |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1691 |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1692 for (size_t n = 0; n < 0x100; n++) |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1693 dstBuf[0x40 + n] = 0x00; |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1694 |
2188 | 1695 res = dmC64DecodeGenericBMP(img, dmGrowBufConstCreateFrom(&tmp, dstBuf, dstSize), fmt); |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1696 |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1697 out: |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1698 dmFree(dstBuf); |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1699 return res; |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1700 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1701 |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1702 |
2188 | 1703 static const char *fmtFunPaint2_MagicID = "FUNPAINT (MT) "; |
1704 #define fmtFunPaint2_Header_Size (0x10) | |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1705 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1706 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1707 static int fmtProbeFunPaint2(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1708 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1709 if (buf->len > 30 && |
2188 | 1710 DM_MEMCMP_LEN(buf->data + 2, fmtFunPaint2_MagicID) == 0) |
1777
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1711 { |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1712 // Unpacked variant |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1713 if (fmt->size != 0 && buf->data[14 + 2] == 0) |
1777
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1714 return DM_PROBE_SCORE_MAX; |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1715 |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1716 // Packed variant |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1717 if (fmt->size == 0 && buf->data[14 + 2] != 0) |
1777
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1718 return DM_PROBE_SCORE_MAX; |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1719 } |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1720 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1721 return DM_PROBE_SCORE_FALSE; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1722 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1723 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1724 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1725 static int fmtDecodeFunPaint2(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1726 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1727 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1728 DMGrowBuf tmp; |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1729 |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1730 // Check if the data is compressed |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1731 if (buf->data[14]) |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1732 { |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1733 DMGrowBuf mem; |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1734 DMCompParams cfg; |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1735 |
1711
4fd94bf558b3
Add function name field to DMCompParams struct and set it in places where we use DMCompParams.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
1736 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1737 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1738 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1; |
1712 | 1739 cfg.rleMarkerB = buf->data[15]; |
1505
3265175b24d2
Change the passing of RLE compression/decompression parameters to be in a dedicated struct.
Matti Hamalainen <ccr@tnsp.org>
parents:
1503
diff
changeset
|
1740 |
2188 | 1741 dmGrowBufCopyOffs(&tmp, buf, fmtFunPaint2_Header_Size, 1); |
1749
feaf5cf07603
Apparently Fun Paint 2 also saves one byte less than it should with the
Matti Hamalainen <ccr@tnsp.org>
parents:
1748
diff
changeset
|
1742 tmp.len = tmp.size; |
feaf5cf07603
Apparently Fun Paint 2 also saves one byte less than it should with the
Matti Hamalainen <ccr@tnsp.org>
parents:
1748
diff
changeset
|
1743 |
1598
b5e0f28f1842
Adjust Fun Paint 2 decoding now that the RLE decoding is fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1594
diff
changeset
|
1744 if ((res = dmDecodeGenericRLEAlloc( |
1749
feaf5cf07603
Apparently Fun Paint 2 also saves one byte less than it should with the
Matti Hamalainen <ccr@tnsp.org>
parents:
1748
diff
changeset
|
1745 &mem, &tmp, &cfg)) == DMERR_OK) |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1746 res = dmC64DecodeGenericBMP(img, &mem, fmt); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1747 |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1748 dmGrowBufFree(&mem); |
1749
feaf5cf07603
Apparently Fun Paint 2 also saves one byte less than it should with the
Matti Hamalainen <ccr@tnsp.org>
parents:
1748
diff
changeset
|
1749 dmGrowBufFree(&tmp); |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1750 } |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1751 else |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1752 { |
2188 | 1753 res = dmC64DecodeGenericBMP(img, dmGrowBufConstCopyOffs(&tmp, buf, fmtFunPaint2_Header_Size), fmt); |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1754 } |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1755 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1756 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1757 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1758 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1759 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1760 static int fmtEncodeFunPaint2Unpacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1761 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1762 // Add the header bits |
2188 | 1763 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2_MagicID, strlen(fmtFunPaint2_MagicID)) || |
1838
d02514ceed91
Fix Fun Paint 2 packed variant writing, it was missing one byte (the "is packed" flag).
Matti Hamalainen <ccr@tnsp.org>
parents:
1834
diff
changeset
|
1764 !dmGrowBufPutU8(buf, 0) || // 0 == unpacked variant |
d02514ceed91
Fix Fun Paint 2 packed variant writing, it was missing one byte (the "is packed" flag).
Matti Hamalainen <ccr@tnsp.org>
parents:
1834
diff
changeset
|
1765 !dmGrowBufPutU8(buf, 0)) // RLE marker byte (not used in unpacked) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1766 return DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1767 |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
1768 return dmC64EncodeGenericBMP(false, buf, img, fmt); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1769 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1770 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1771 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1772 static int fmtEncodeFunPaint2Packed(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1773 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1774 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1775 DMGrowBuf mem; |
1505
3265175b24d2
Change the passing of RLE compression/decompression parameters to be in a dedicated struct.
Matti Hamalainen <ccr@tnsp.org>
parents:
1503
diff
changeset
|
1776 DMCompParams cfg; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1777 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1778 // Encode the data to temp buffer |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
1779 if ((res = dmC64EncodeGenericBMP(true, &mem, img, fmt)) != DMERR_OK) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1780 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1781 |
1650
9233da9de92c
Refactor RLE encoding a bit, and add support for 16bit run counts and make things more configurable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1649
diff
changeset
|
1782 // Analyze and setup RLE |
1711
4fd94bf558b3
Add function name field to DMCompParams struct and set it in places where we use DMCompParams.
Matti Hamalainen <ccr@tnsp.org>
parents:
1707
diff
changeset
|
1783 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1784 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1785 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1; |
1855
5e33f367bafe
Adjust the minimum byte run RLE counts from 3 to 4.
Matti Hamalainen <ccr@tnsp.org>
parents:
1854
diff
changeset
|
1786 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
1787 cfg.rleMaxCountB = 255; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1788 |
2329
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
1789 if ((res = dmGenericRLEAnalyze(&mem, &cfg)) != DMERR_OK) |
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
1790 goto out; |
1661
dc3fbd130db7
RLE analyze was ran before setting up the compression config. Oops. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1660
diff
changeset
|
1791 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1792 // Add the header bits |
2188 | 1793 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2_MagicID, strlen(fmtFunPaint2_MagicID)) || |
1838
d02514ceed91
Fix Fun Paint 2 packed variant writing, it was missing one byte (the "is packed" flag).
Matti Hamalainen <ccr@tnsp.org>
parents:
1834
diff
changeset
|
1794 !dmGrowBufPutU8(buf, 1) || // non-zero == packed variant |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
1795 !dmGrowBufPutU8(buf, cfg.rleMarkerB)) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1796 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1797 res = DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1798 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1799 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1800 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1801 // And now RLE compress the data to the existing buffer |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1802 res = dmEncodeGenericRLE(buf, &mem, &cfg); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1803 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1804 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1805 dmGrowBufFree(&mem); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1806 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1807 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1808 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1809 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1810 static int fmtGetPixelFunPaint2(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1811 const DMC64Image *img, const int rasterX, const int rasterY) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1812 { |
2306
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1813 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1814 const int bitmap = rasterX & 1; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1815 Uint8 bgcol = (unsigned) rasterY < img->extraData[0].size ? |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1816 img->extraData[0].data[rasterY] : img->bgcolor; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1817 |
2306
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1818 (void) vshift; |
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1819 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1820 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 1821 bmoffs, scroffs, |
2306
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1822 6 - (rasterX & 6), |
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1823 yb + (bitmap * 8), |
2222
75b5bb490f38
Add & 15 to deeper helper functions and remove it from unnecessary places.
Matti Hamalainen <ccr@tnsp.org>
parents:
2208
diff
changeset
|
1824 bitmap, 0, bgcol); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1825 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1826 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1827 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1828 static int fmtGetPixelBFLI(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1829 const DMC64Image *img, const int rasterX, const int rasterY) |
1582
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1830 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1831 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
1857
5d9dd663df8d
Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1856
diff
changeset
|
1832 const int vbb = rasterY < 200 ? 0 : 1; |
1764
52e31cfc1e36
Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents:
1763
diff
changeset
|
1833 const int vbank = (rasterY & 7) + (vbb * 8); |
1582
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1834 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1835 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 1836 bmoffs & 0x1fff, scroffs & 0x3ff, |
1837 vshift, vbank, | |
1838 vbb, 0, img->bgcolor); | |
1582
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1839 } |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1840 |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1841 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1842 static int fmtGetPixelPentelPaint(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1843 const DMC64Image *img, const int rasterX, const int rasterY) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1844 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1845 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
2595 | 1846 const int sprY = rasterY / D64_SPR_HEIGHT_PX; |
1847 const int sprYD = rasterY % D64_SPR_HEIGHT_PX; | |
1848 const int sprX = rasterX / D64_SPR_WIDTH_PX; | |
1849 const int sprXD = (rasterX % D64_SPR_WIDTH_PX) / 8; | |
1850 const int offs = (sprY * 8 + sprX) * D64_SPR_SIZE + (sprYD * D64_SPR_WIDTH_UT) + sprXD; | |
1860
01d7feb9f9ce
Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1857
diff
changeset
|
1851 const int mask = 1 << (7 - (rasterX & 7)); |
2163 | 1852 int res; |
1860
01d7feb9f9ce
Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1857
diff
changeset
|
1853 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1854 Uint8 color1, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1855 color2 = img->extraData[0].data[offs] & mask ? 0x0f : 0, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1856 color3 = img->extraData[0].data[offs + D64_SPR_SIZE * 155] & mask ? img->d022 : 0; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1857 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1858 if ((res = dmC64GetGenericSCPixel(&color1, img, bmoffs, scroffs, vshift, 0, 0)) != DMERR_OK) |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1859 return res; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1860 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1861 *(scan->col) = color3 ? color3 : ( color2 ? color2 : color1 ); |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1862 return DMERR_OK; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1863 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1864 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1865 |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1866 // Horizontal character X-offset and scanline Y-offset |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1867 #define DM_CREST_SHFLI_IMG_XOFFS 14 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1868 #define DM_CREST_SHFLI_IMG_YOFFS 1 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1869 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1870 // True image width and height in character blocks |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1871 #define DM_CREST_SHFLI_IMG_WIDTH (4 * D64_SPR_WIDTH_UT) |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1872 #define DM_CREST_SHFLI_IMG_HEIGHT 21 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1873 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1874 #define DM_CREST_SHFLI_BANKS 8 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1875 #define DM_CREST_SHFLI_PTRS 8 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1876 |
2607 | 1877 static const Uint8 fmtCrestSHFLI_sprite_pointers[DM_CREST_SHFLI_BANKS][DM_CREST_SHFLI_PTRS] = |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1878 { |
2187
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1879 { 0x80, 0x84, 0x85, 0x89, 0x8A, 0x8E, 0x8F, 0x93 }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1880 { 0x94, 0x98, 0x99, 0x9D, 0x9E, 0xA2, 0xA3, 0xA7 }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1881 { 0xA8, 0xAC, 0xAD, 0xB1, 0xB2, 0xB6, 0xB7, 0xBB }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1882 { 0xBC, 0xC0, 0xC1, 0xC5, 0xC6, 0xCA, 0xCB, 0xCF }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1883 { 0xD0, 0xD4, 0xD5, 0xD9, 0xDA, 0xDE, 0xDF, 0xE3 }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1884 { 0xE4, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1885 { 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6 }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1886 { 0xF7, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E }, |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1887 }; |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1888 |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1889 |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1890 static const Uint8 fmtCrestSHFLI_MagicID_Packed[] = |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1891 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1892 0x83, 0x92, 0x85, 0x93, 0x94, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1893 }; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1894 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1895 |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1896 static int fmtProbeCrestSHFLI(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1897 { |
2187
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1898 // Unpacked variant |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1899 if (buf->len == fmt->size && |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1900 dmCompareAddr16(buf, 0, fmt->addr)) |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1901 { |
2187
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1902 int score = DM_PROBE_SCORE_MAYBE; |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1903 for (int nbank = 0; nbank < DM_CREST_SHFLI_BANKS; nbank++) |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1904 { |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1905 if (memcmp(buf->data + 2 + (nbank * 0x0400) + 0x03f8, |
2607 | 1906 fmtCrestSHFLI_sprite_pointers[nbank], DM_CREST_SHFLI_PTRS) == 0) |
2187
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1907 score += DM_PROBE_SCORE_GOOD; |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1908 } |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1909 return score; |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1910 } |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1911 |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1912 // Packed variant |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1913 if (dmCompareAddr16(buf, 0, fmt->addr) && |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1914 buf->len > sizeof(fmtCrestSHFLI_MagicID_Packed) && |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1915 DM_MEMCMP_SIZE(buf->data + buf->len - sizeof(fmtCrestSHFLI_MagicID_Packed), fmtCrestSHFLI_MagicID_Packed) == 0) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1916 return DM_PROBE_SCORE_MAX; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1917 |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
1918 return DM_PROBE_SCORE_FALSE; |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1919 } |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1920 |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1921 |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1922 static int fmtDecodeCrestSHFLIPacked(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1923 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1924 int res; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1925 DMGrowBuf tmp, mem; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1926 DMCompParams cfg; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1927 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1928 // Compression is typical RLE, with first byte being the RLE marker byte etc. |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1929 // However, as a difference to the uncompressed files, only the data of the |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1930 // 96 pixels wide area (4 sprite widths) x 168 tall is saved. |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1931 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1932 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
1933 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1 | DM_COMP_RLE_ZERO_COUNT_MAX; |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1934 cfg.rleMarkerB = buf->data[0]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1935 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1936 if ((res = dmDecodeGenericRLEAlloc( |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1937 &mem, dmGrowBufConstCopyOffs(&tmp, buf, 1), &cfg)) == DMERR_OK) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1938 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1939 const size_t fmtUncompSize = 0x1ff0; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1940 const size_t dstSize = 16 * 1024; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1941 Uint8 *dstBuf, *sptr, *dptr; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1942 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1943 // Check uncompressed size? |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1944 if (mem.len != fmtUncompSize) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1945 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1946 res = dmError(DMERR_INVALID_DATA, |
2389
647671a9a0b8
More printf() format specifier size_t -related fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
2378
diff
changeset
|
1947 "%s: Unexpected uncompressed data size %" DM_PRIu_SIZE_T |
647671a9a0b8
More printf() format specifier size_t -related fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
2378
diff
changeset
|
1948 " bytes (should be %" DM_PRIu_SIZE_T ").\n", |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1949 cfg.func, mem.len, fmtUncompSize); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1950 goto out; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1951 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1952 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1953 // Allocate output buffer |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1954 if ((dstBuf = dmMalloc0(dstSize)) == NULL) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1955 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1956 res = dmError(DMERR_MALLOC, |
2389
647671a9a0b8
More printf() format specifier size_t -related fixes.
Matti Hamalainen <ccr@tnsp.org>
parents:
2378
diff
changeset
|
1957 "%s: Could not allocate temporary memory buffer of %" DM_PRIu_SIZE_T " bytes.\n", |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1958 cfg.func, dstSize); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1959 goto out; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1960 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1961 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1962 // Now that we have the uncompressed data (0x1ff0 bytes), we need to |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1963 // re-arrange it. The data is as follows .. |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1964 // |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1965 // 0x0000 - sprite data for 64 sprites |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1966 // 0x1000 - bitmap (12 * 21 bytes) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1967 // 0x1800 - screen RAMs (12 * 21 bytes) x 8 banks |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1968 // 0x1fe8 - sprite color #1 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1969 // 0x1fe9 - sprite color #2 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1970 // |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1971 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1972 // Copy sprite colors |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1973 sptr = mem.data + 0x1fe8; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1974 dptr = dstBuf + 0x03e8; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1975 dptr[0] = sptr[0]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1976 dptr[1] = sptr[1]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1977 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1978 // First, clear and set some defaults that are not saved in the file |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1979 for (int nbank = 0; nbank < DM_CREST_SHFLI_BANKS; nbank++) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1980 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1981 dptr = dstBuf + nbank * 0x0400; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1982 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1983 // Set preset screen RAM for other area |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1984 memset(dptr, 0xff, fmt->format->chWidth * fmt->format->chHeight); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1985 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1986 // Copy sprite data points |
2607 | 1987 memcpy(dptr + 0x03f8, &fmtCrestSHFLI_sprite_pointers[nbank], DM_CREST_SHFLI_PTRS); |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1988 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1989 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1990 // Now we copy and transform the bitmap and screen RAM data. |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1991 for (int yc = 0; yc < DM_CREST_SHFLI_IMG_HEIGHT * 8; yc++) |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1992 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1993 const int syy = yc / 8; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1994 const int syd = yc & 7; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1995 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1996 // In the image the first visible scanline is unused, but in |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1997 // the compressed version data starts right away, so we offset |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1998 // the destination Y coordinate by one. |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1999 const int dyc = yc + DM_CREST_SHFLI_IMG_YOFFS; |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2000 const int dyy = dyc / 8; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2001 const int dyd = dyc & 7; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2002 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2003 // Format of the bitmap data is one horizontal pixel row (12 bytes) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2004 // times 21*8 rows, e.g. the data is "linear" rows of bytes and not |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2005 // arranged in usual c64 bitmap "char" order. Thus we reorder it. |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2006 sptr = mem.data + 0x1000 + DM_CREST_SHFLI_IMG_WIDTH * (syd + 8 * syy); |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2007 dptr = dstBuf + 0x2000 + DM_CREST_SHFLI_IMG_XOFFS * 8 + (fmt->format->chWidth * dyy * 8) + dyd; |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2008 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2009 for (int xc = 0; xc < DM_CREST_SHFLI_IMG_WIDTH; xc++) |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2010 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2011 dptr[xc * 8] = sptr[xc]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2012 sptr[xc] = 0xaa; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2013 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2014 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2015 // A bit similar arrangement is used for the screen RAM data. |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2016 // Each row of 12 bytes of data is for a bank. Next row is for |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2017 // next bank, etc. |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2018 sptr = mem.data + 0x1800 + DM_CREST_SHFLI_IMG_WIDTH * syd + DM_CREST_SHFLI_IMG_WIDTH * 8 * syy; |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2019 dptr = dstBuf + DM_CREST_SHFLI_IMG_XOFFS + 0x0400 * dyd + fmt->format->chWidth * dyy; |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2020 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2021 for (int xc = 0; xc < DM_CREST_SHFLI_IMG_WIDTH; xc++) |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2022 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2023 dptr[xc] = sptr[xc]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2024 sptr[xc] = 0xaa; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2025 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2026 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2027 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2028 // The sprite data is also transformed similarly, data is |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2029 // in same scanline format as the bitmap. Thus we need to |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2030 // place it where it belongs based on the sprite pointers. |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2031 for (int yc = 0; yc < DM_CREST_SHFLI_IMG_HEIGHT * 8; yc++) |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2032 { |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2033 const int yd = yc % D64_SPR_HEIGHT_PX; |
2607 | 2034 const Uint8 *sprPtrs = fmtCrestSHFLI_sprite_pointers[yc % 8]; |
2190
0447f4c6c32b
Fix a const discard issue.
Matti Hamalainen <ccr@tnsp.org>
parents:
2189
diff
changeset
|
2035 Uint8 *sp1, *sp2, *dp; |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2036 |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2037 dptr = dstBuf + D64_SPR_WIDTH_UT * yd; |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2038 sp1 = mem.data + DM_CREST_SHFLI_IMG_WIDTH * yc; |
2191 | 2039 sp2 = sp1 + 0x0800; |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2040 |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2041 for (int xc = 0; xc < DM_CREST_SHFLI_IMG_WIDTH / D64_SPR_WIDTH_UT; xc++) |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2042 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2043 dp = dptr + D64_SPR_SIZE * sprPtrs[xc]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2044 for (int xd = 0; xd < D64_SPR_WIDTH_UT; xd++) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2045 dp[xd] = *sp1++; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2046 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2047 dp = dptr + D64_SPR_SIZE * sprPtrs[xc + 4]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2048 for (int xd = 0; xd < D64_SPR_WIDTH_UT; xd++) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2049 dp[xd] = *sp2++; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2050 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2051 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2052 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2053 res = dmC64DecodeGenericBMP(img, dmGrowBufConstCreateFrom(&tmp, dstBuf, dstSize), fmt); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2054 dmFree(dstBuf); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2055 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2056 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2057 out: |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2058 dmGrowBufFree(&mem); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2059 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2060 return res; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2061 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2062 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2063 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
2064 static int fmtGetSpritePixelCrestSHFLI(DMC64ScanLine *scan, |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2065 const DMC64Image *img, const int sindex, const int cindex, |
2595 | 2066 const int sprXD, const int sprYD, const int mask) |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2067 { |
2595 | 2068 const size_t offs = sindex * D64_SPR_SIZE + (D64_SPR_WIDTH_UT * sprYD) + sprXD; |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2069 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2070 if (offs >= img->extraData[14].size) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2071 return DMERR_BOUNDS; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2072 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2073 if (img->extraData[14].data[offs] & mask) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2074 { |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
2075 *(scan->col) = img->extraData[15].data[cindex]; |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2076 return DMERR_OK; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2077 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2078 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2079 return -1; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2080 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2081 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2082 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
2083 static int fmtGetPixelCrestSHFLI(DMC64ScanLine *scan, |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2084 const DMC64Image *img, const int rasterX, const int rasterY) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2085 { |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2086 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2087 const int sprOffsetX = DM_CREST_SHFLI_IMG_XOFFS * 8, |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2088 sprOffsetY = DM_CREST_SHFLI_IMG_YOFFS; |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2089 const int nbank = rasterY & 7; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2090 int res; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2091 |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2092 if (rasterY / 8 >= DM_CREST_SHFLI_IMG_HEIGHT) |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2093 { |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
2094 *(scan->col) = 0x0f; |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2095 return DMERR_OK; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2096 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2097 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2098 if (rasterY >= sprOffsetY && |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2099 rasterX >= sprOffsetX && |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2100 rasterX < sprOffsetX + 4 * D64_SPR_WIDTH_PX) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2101 { |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2102 const int localX = rasterX - sprOffsetX, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2103 localY = rasterY - sprOffsetY; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2104 const int sbank = localY & 7; |
2595 | 2105 const int sprYD = localY % D64_SPR_HEIGHT_PX; |
2106 const int sprX = localX / D64_SPR_WIDTH_PX; | |
2107 const int sprXD = (localX % D64_SPR_WIDTH_PX) / 8; | |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2108 const int mask = 1 << (7 - (localX & 7)); |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2109 |
2595 | 2110 const int sprOffs = sprX & 3; |
2111 const int sprIndex1 = img->extraData[sbank].data[sprOffs]; | |
2112 const int sprIndex2 = img->extraData[sbank].data[sprOffs + 4]; | |
2113 | |
2114 if ((res = fmtGetSpritePixelCrestSHFLI(scan, img, sprIndex1, 0, sprXD, sprYD, mask)) == DMERR_OK || | |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2115 res != -1) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2116 return res; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2117 |
2595 | 2118 if ((res = fmtGetSpritePixelCrestSHFLI(scan, img, sprIndex2, 1, sprXD, sprYD, mask)) == DMERR_OK || |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2119 res != -1) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2120 return res; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2121 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2122 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
2123 if ((res = dmC64GetGenericSCPixel(scan->col, img, bmoffs, scroffs, vshift, nbank, 0)) != DMERR_OK) |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2124 return res; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2125 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2126 return DMERR_OK; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2127 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2128 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2129 |
2623
da81e524162e
Rename a function and HCB format title to include BD (for Booze Design)
Matti Hamalainen <ccr@tnsp.org>
parents:
2620
diff
changeset
|
2130 static int fmtGetPixelBDHCB(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2131 const DMC64Image *img, const int rasterX, const int rasterY) |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2132 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2133 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2134 const int vbank = (rasterY / 4) & 1; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2135 const int ry = rasterY / 5; |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2136 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2137 Uint8 bgcol = (unsigned) ry < img->extraData[0].size ? |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2138 img->extraData[0].data[ry] : img->bgcolor; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2139 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
2140 return dmC64GetGenericMCPixel(scan->col, img, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2141 bmoffs, scroffs, |
2133 | 2142 vshift, vbank, |
2222
75b5bb490f38
Add & 15 to deeper helper functions and remove it from unnecessary places.
Matti Hamalainen <ccr@tnsp.org>
parents:
2208
diff
changeset
|
2143 0, vbank, bgcol); |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2144 } |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2145 |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2146 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
2147 static int fmtGetPixelCrestHIFLIorCDHM(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2148 const DMC64Image *img, const int rasterX, const int rasterY) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2149 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2150 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
2133 | 2151 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
2152 return dmC64GetGenericSCPixel(scan->col, img, |
2133 | 2153 bmoffs, scroffs, |
2154 vshift, rasterY & 7, 0); | |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2155 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2156 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2157 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
2158 static int fmtGetPixelECI(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2159 const DMC64Image *img, const int rasterX, const int rasterY) |
1734
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
2160 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2161 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
1764
52e31cfc1e36
Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents:
1763
diff
changeset
|
2162 const int vbank = rasterY & 7; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2163 Uint8 color1, color2; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2164 int res; |
1734
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
2165 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2166 if ((res = dmC64GetGenericSCPixel(&color1, img, bmoffs, scroffs, vshift, vbank , 0)) != DMERR_OK || |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2167 (res = dmC64GetGenericSCPixel(&color2, img, bmoffs, scroffs, vshift, vbank + 8, 1)) != DMERR_OK) |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2168 return res; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2169 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
2170 *(scan->col) = (color1 * D64_NCOLORS) + color2; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2171 return DMERR_OK; |
1734
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
2172 } |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
2173 |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
2174 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
2175 static int fmtProbeECIPacked(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2176 { |
2599
c3c1d3c75f53
s/DM_PROBE_SCORE_false/DM_PROBE_SCORE_FALSE/g
Matti Hamalainen <ccr@tnsp.org>
parents:
2596
diff
changeset
|
2177 int score = DM_PROBE_SCORE_FALSE; |
2168
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2178 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2179 if (buf->len > 128 && |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2180 dmCompareAddr16(buf, 0, fmt->addr)) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2181 { |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2182 size_t i, n; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2183 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2184 // Count statistics about used byte values and compare to |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2185 // value in buf[2] which is the RLE marker |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2186 for (n = 0, i = 3; i < buf->len; i++) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2187 if (buf->data[i] == buf->data[2]) n++; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2188 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2189 if (n > 50) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2190 score = DM_PROBE_SCORE_GOOD; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2191 else |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2192 if (n > 25) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2193 score = DM_PROBE_SCORE_AVG; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2194 else |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2195 if (n > 10) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2196 score = DM_PROBE_SCORE_MAYBE; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2197 } |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2198 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2199 if (// Try to avoid misprobe of Crest Hires FLI Designer and Cosmos Design format |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2200 buf->len == 16386 || |
1979
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2201 // Face Painter |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2202 buf->len == 10004) |
2168
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2203 score /= 3; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2204 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
2205 return score; |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2206 } |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2207 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2208 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2209 static int fmtDecodeECIPacked(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2210 { |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2211 int res; |
2170 | 2212 DMGrowBuf mem, tmp; |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2213 DMCompParams cfg; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2214 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2215 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
2216 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
2217 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1; |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2218 cfg.rleMarkerB = buf->data[0]; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2219 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2220 if ((res = dmDecodeGenericRLEAlloc( |
1747
5e928618fdc8
Change DMGrowBuf API somewhat and implement more copy operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
1746
diff
changeset
|
2221 &mem, dmGrowBufConstCopyOffs(&tmp, buf, 1), &cfg)) == DMERR_OK) |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2222 res = dmC64DecodeGenericBMP(img, &mem, fmt); |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2223 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2224 dmGrowBufFree(&mem); |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2225 return res; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2226 } |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2227 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2228 |
1912
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2229 static int fmtEncodeECIPacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2230 { |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2231 int res; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2232 DMGrowBuf tmp; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2233 DMCompParams cfg; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2234 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2235 // Encode the data to temp buffer |
2586
9807ae37ad69
Require stdbool.h, we require C11 now.
Matti Hamalainen <ccr@tnsp.org>
parents:
2583
diff
changeset
|
2236 if ((res = dmC64EncodeGenericBMP(true, &tmp, img, fmt)) != DMERR_OK) |
1912
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2237 goto out; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2238 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2239 // Analyze and setup RLE |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2240 cfg.func = fmt->name; |
2606
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
2241 cfg.type = DM_COMP_TYPE_RLE_MARKER; |
92909caccc9e
Rename various compression related internal constants.
Matti Hamalainen <ccr@tnsp.org>
parents:
2605
diff
changeset
|
2242 cfg.flags = DM_COMP_RLE_BYTE_RUNS | DM_COMP_RLE_ORDER_1; |
1912
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2243 cfg.rleMinCountB = 4; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2244 cfg.rleMaxCountB = 255; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2245 |
2331
6dc64deb6718
Missed on dmGenericRLEAnalyze() call from a previous commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2329
diff
changeset
|
2246 if ((res = dmGenericRLEAnalyze(&tmp, &cfg)) != DMERR_OK) |
6dc64deb6718
Missed on dmGenericRLEAnalyze() call from a previous commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2329
diff
changeset
|
2247 goto out; |
1912
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2248 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2249 // Add the header bits |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2250 if (!dmGrowBufPutU8(buf, cfg.rleMarkerB)) |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2251 { |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2252 res = DMERR_MALLOC; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2253 goto out; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2254 } |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2255 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2256 // And now RLE compress the data to the existing buffer |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2257 res = dmEncodeGenericRLE(buf, &tmp, &cfg); |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2258 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2259 out: |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2260 dmGrowBufFree(&tmp); |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2261 return res; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2262 } |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2263 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2264 |
2605
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2265 static const Uint8 fmtEXON_VHI_Packed_MagicID[] = |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2266 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2267 0x00, 0x00, 0x20, 0x16, 0x08, 0x09, 0x20, 0x05, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2268 0x04, 0x09, 0x14, 0x0f, 0x12, 0x20, 0x16, 0x30, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2269 0x2e, 0x31, 0x20, 0x20, 0x02, 0x19, 0x20, 0x16, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2270 0x0f, 0x0c, 0x03, 0x01, 0x0e, 0x0f, 0x2f, 0x05, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2271 0x18, 0x0f, 0x0e, 0x01, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2272 }; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2273 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2274 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2275 static int fmtProbeEXON_VHI_Packed(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2276 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2277 if (buf->len > 200 && |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2278 dmCompareAddr16(buf, 0, fmt->addr)) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2279 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2280 // This is a bit heavy-handed, but what can one do |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2281 for (size_t offs = 2; offs < buf->len - sizeof(fmtEXON_VHI_Packed_MagicID); offs++) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2282 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2283 if (DM_MEMCMP_SIZE(buf->data + offs, fmtEXON_VHI_Packed_MagicID) == 0) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2284 return DM_PROBE_SCORE_MAX; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2285 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2286 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2287 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2288 return DM_PROBE_SCORE_FALSE; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2289 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2290 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2291 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2292 static int fmtDecodeEXON_VHI_Packed(DMC64Image *img, const DMGrowBuf *psrc, const DMC64ImageFormat *fmt) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2293 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2294 DMGrowBuf tmp; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2295 Uint8 *dstBuf; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2296 const size_t dstSize = fmt->size - 2; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2297 size_t dstOffs = 0, srcOffs = 0; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2298 int res; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2299 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2300 // Allocate output buffer |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2301 if ((dstBuf = dmMalloc0(dstSize)) == NULL) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2302 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2303 return dmError(DMERR_MALLOC, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2304 "EXON_VHI: Could not allocate memory for decoding buffer.\n"); |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2305 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2306 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2307 while (srcOffs < psrc->len && dstOffs < dstSize) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2308 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2309 // Get one byte of data |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2310 Uint8 data = psrc->data[srcOffs++]; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2311 size_t ncount; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2312 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2313 if (data & 0x80) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2314 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2315 // High bit means end of stream |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2316 break; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2317 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2318 else |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2319 if (data == 0) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2320 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2321 // Zero means literal run |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2322 if (srcOffs > psrc->len) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2323 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2324 res = dmError(DMERR_INVALID_DATA, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2325 "EXON_VHI: Literal sequence out of data.\n"); |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2326 goto out; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2327 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2328 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2329 ncount = psrc->data[srcOffs++]; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2330 if (ncount == 0) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2331 ncount = 256; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2332 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2333 if (srcOffs + ncount > psrc->len) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2334 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2335 res = dmError(DMERR_INVALID_DATA, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2336 "EXON_VHI: Literal sequence too long for source data.\n"); |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2337 goto out; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2338 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2339 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2340 if (dstOffs + ncount > dstSize) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2341 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2342 res = dmError(DMERR_INVALID_DATA, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2343 "EXON_VHI: Literal sequence too long for destination data.\n"); |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2344 goto out; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2345 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2346 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2347 for (size_t n = 0; n < ncount; n++) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2348 dstBuf[dstOffs++] = psrc->data[srcOffs++]; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2349 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2350 else |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2351 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2352 // RLE run |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2353 if (srcOffs + 2 > psrc->len) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2354 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2355 res = dmError(DMERR_INVALID_DATA, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2356 "EXON_VHI: Invalid data/out of data for RLE sequence.\n"); |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2357 goto out; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2358 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2359 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2360 ncount = psrc->data[srcOffs++]; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2361 data = psrc->data[srcOffs++]; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2362 if (ncount == 0) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2363 ncount = 256; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2364 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2365 if (dstOffs + ncount > dstSize) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2366 { |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2367 res = dmError(DMERR_INVALID_DATA, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2368 "EXON_VHI: Invalid data/out of data for RLE sequence.\n"); |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2369 goto out; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2370 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2371 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2372 for (size_t n = 0; n < ncount; n++) |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2373 dstBuf[dstOffs++] = data; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2374 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2375 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2376 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2377 res = dmC64DecodeGenericBMP(img, dmGrowBufConstCreateFrom(&tmp, dstBuf, dstSize), fmt); |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2378 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2379 out: |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2380 dmFree(dstBuf); |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2381 return res; |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2382 } |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2383 |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
2384 |
2603
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2385 static int fmtGetPixelEXON_VHI(DMC64ScanLine *scan, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2386 const DMC64Image *img, const int rasterX, const int rasterY) |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2387 { |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2388 const int |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2389 x = rasterX / 16, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2390 y = rasterY / 8, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2391 yb = rasterY & 7, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2392 yoffs = y * img->fmt->chWidth, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2393 bmoffs = yoffs * 8 + yb + (x * 8), |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2394 scroffs = yoffs + x, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2395 vshift = 7 - ((rasterX / 2) & 7), |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2396 vbitmap = rasterX & 1; |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2397 |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2398 return dmC64GetGenericSCPixel(scan->col, img, bmoffs, scroffs, vshift, 0, vbitmap); |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2399 } |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2400 |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2401 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2402 // |
1795
c8d690e8f9e9
Fix some typos in comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
1792
diff
changeset
|
2403 // Helper macros for defining screen memory layouts |
c8d690e8f9e9
Fix some typos in comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
1792
diff
changeset
|
2404 // common for several FLI type image formats |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2405 // |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2406 #define DEF_REPEAT_BLOCK(dop, dtype, start, oindex, bindex, osize, bsize, oflags) \ |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2407 { (dop), (dtype), (start) + ((osize) * (oindex)), (bindex), (bsize), 0, NULL, NULL, (oflags) } |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2408 |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2409 #define DEF_REPEAT_BLOCK_8(dop, dtype, start, sindex, osize, bsize, oflags) \ |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2410 DEF_REPEAT_BLOCK((dop), (dtype), (start), 0, ((sindex) + 0), (osize), (bsize), (oflags)), \ |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2411 DEF_REPEAT_BLOCK((dop), (dtype), (start), 1, ((sindex) + 1), (osize), (bsize), (oflags)), \ |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2412 DEF_REPEAT_BLOCK((dop), (dtype), (start), 2, ((sindex) + 2), (osize), (bsize), (oflags)), \ |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2413 DEF_REPEAT_BLOCK((dop), (dtype), (start), 3, ((sindex) + 3), (osize), (bsize), (oflags)), \ |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2414 DEF_REPEAT_BLOCK((dop), (dtype), (start), 4, ((sindex) + 4), (osize), (bsize), (oflags)), \ |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2415 DEF_REPEAT_BLOCK((dop), (dtype), (start), 5, ((sindex) + 5), (osize), (bsize), (oflags)), \ |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2416 DEF_REPEAT_BLOCK((dop), (dtype), (start), 6, ((sindex) + 6), (osize), (bsize), (oflags)), \ |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2417 DEF_REPEAT_BLOCK((dop), (dtype), (start), 7, ((sindex) + 7), (osize), (bsize), (oflags)) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2418 |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2419 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2420 // |
1861 | 2421 // Many formats actually share memory layout and other specs, and there are |
2422 // packed and unpacked versions of several formats. We'll reuse these here | |
2423 // through this common formats data array, referred from dmC64ImageFormats[] | |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2424 // |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2425 DMC64ImageCommonFormat dmC64CommonFormats[] = |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2426 { |
1815
2b68b6955635
Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents:
1813
diff
changeset
|
2427 { // #0: Koala Painter type memory layout |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2428 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2429 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2430 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2431 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2432 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2433 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2434 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2435 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2436 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2437 { DO_COPY , DS_COLOR_RAM , 0x2328, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2438 { DO_SET_MEM_LO , DS_BGCOL , 0x2710, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2439 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2440 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2441 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2442 |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2443 { // #1: Black Mail FLI Graph |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2444 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2445 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2446 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2447 2, 1, |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2448 NULL, NULL, |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2449 fmtGetPixelBlackMailFLI, |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2450 { |
2294 | 2451 { DO_COPY , DS_EXTRA_DATA , 0x0000, 0, 200 , 0, NULL, NULL, DF_NORMAL }, |
2452 { DO_COPY , DS_COLOR_RAM , 0x0100, 0, 0 , 0, NULL, NULL, DF_NORMAL }, | |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2453 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x0500, 0, 0x400, 0, DF_NORMAL), |
2294 | 2454 { DO_COPY , DS_BITMAP_RAM , 0x2500, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
2455 | |
2456 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0 , 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, | |
2457 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, | |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2458 } |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2459 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2460 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2461 { // #2: Art Studio etc. Hires |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2462 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2463 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2464 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2465 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2466 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2467 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2468 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2469 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2470 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2471 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2472 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2473 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2474 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2475 { // #3: FunPaint II |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2476 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2477 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2478 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2479 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2480 NULL, NULL, |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2481 fmtGetPixelFunPaint2, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2482 { |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2483 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x0000, 0, 0x400, 0, DF_NORMAL), |
2224
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
2484 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
2485 { DO_COPY , DS_EXTRA_DATA , 0x3f48, 0, 100 , 0, NULL, NULL, DF_NORMAL }, |
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
2486 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2487 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x43e8, 8, 0x400, 0, DF_NORMAL), |
2224
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
2488 { DO_COPY , DS_BITMAP_RAM , 0x63e8, 1, 0 , 0, NULL, NULL, DF_NORMAL }, |
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
2489 { DO_COPY , DS_EXTRA_DATA , 0x8328, 0, 100 , 100, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2490 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_RES, 0 , 0 , D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2491 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2224
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
2492 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2493 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2494 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2495 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2496 { // #4: DrazPaint 1.x & 2 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2497 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2498 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2499 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2500 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2501 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2502 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2503 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2504 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2505 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2506 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2507 { DO_SET_MEM_LO , DS_BGCOL , 0x2740, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2508 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2509 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2510 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2511 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2512 { // #5: DrazLace 1.0 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2513 D64_FMT_MC | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2514 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2515 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2516 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2517 NULL, NULL, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
2518 fmtGetPixelDrazLace, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2519 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2520 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2521 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2522 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2523 { DO_SET_MEM_LO , DS_BGCOL , 0x2740, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2524 { DO_FUNC , 0 , 0x2742, 0, 1, 0, fmtDrazLaceGetLaceType, fmtDrazLaceSetLaceType, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2525 { DO_COPY , DS_BITMAP_RAM , 0x2800, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2526 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2527 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2528 }, |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2529 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2530 { // #6: TruePaint |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2531 D64_FMT_MC | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2532 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2533 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2534 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2535 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2536 fmtGetPixelTruePaint, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2537 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2538 { DO_COPY , DS_SCREEN_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2539 { DO_SET_MEM_LO , DS_BGCOL , 0x03e8, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2540 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2541 { DO_COPY , DS_BITMAP_RAM , 0x2400, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2542 { DO_COPY , DS_SCREEN_RAM , 0x4400, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2543 { DO_COPY , DS_COLOR_RAM , 0x4800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2544 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_RES, 0 , 0 , D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2545 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2546 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2547 }, |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
2548 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2549 { // #7: ECI Graphic Editor Hires FLI |
2224
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
2550 D64_FMT_HIRES | D64_FMT_FLI | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2551 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2552 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2553 1, 1, |
2224
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
2554 NULL, NULL, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2555 fmtGetPixelECI, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2556 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2557 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2558 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x2000, 0, 0x400, 0, DF_NORMAL), |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2559 { DO_COPY , DS_BITMAP_RAM , 0x4000, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2560 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x6000, 8, 0x400, 0, DF_NORMAL), |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2561 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_COLOR, 0 , 0 , D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2562 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2563 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2564 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2565 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2566 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2567 { // #8: Cosmos Designs Hires Manager |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2568 D64_FMT_HIRES | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2569 D64_SCR_WIDTH, 24*8, // Actually 296 x 192 (=24*8) |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2570 D64_SCR_CH_WIDTH, 24, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2571 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2572 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2573 fmtGetPixelCrestHIFLIorCDHM, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2574 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2575 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2576 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x2000, 0, 0x400, 0, DF_NORMAL), |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2577 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2578 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2579 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2580 }, |
1834
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
2581 |
2018 | 2582 { // #9: FBI Crew FLI Designer 1.x & 2.0 |
1834
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
2583 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2584 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2585 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2586 2, 1, |
1834
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
2587 NULL, NULL, |
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
2588 fmtGetPixelFLIDesigner, |
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
2589 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2590 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2591 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM, 0x0400, 0, 0x400, 0, DF_NORMAL), |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2592 { DO_COPY , DS_BITMAP_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2545 | 2593 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2594 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1834
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
2595 } |
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
2596 }, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2597 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2598 { // #10: Doodle |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2599 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2600 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2601 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2602 1, 1, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2603 NULL, NULL, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2604 NULL, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2605 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2606 { DO_COPY , DS_SCREEN_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2607 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2608 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2609 } |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2610 }, |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2611 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2612 { // #11: Crest Super Hires FLI Editor 1.0 (SHF) |
2314
87533af8db64
Add format flag for formats that use sprite layer.
Matti Hamalainen <ccr@tnsp.org>
parents:
2313
diff
changeset
|
2613 D64_FMT_HIRES | D64_FMT_FLI | D64_FMT_SPRITES, |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2614 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
2615 D64_SCR_CH_WIDTH, 24, |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2616 1, 1, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2617 NULL, NULL, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2618 fmtGetPixelCrestSHFLI, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2619 { |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2620 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM, 0x0000, 0 , 0x0400, 0x0400, DF_NORMAL), |
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
2621 DEF_REPEAT_BLOCK_8(DO_COPY, DS_EXTRA_DATA, 0x03f8, 0 , 0x0400, 8, DF_DECODE), // Sprite pointers for each bank |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2622 { DO_COPY , DS_EXTRA_DATA , 0x03e8, 15 , 2 , 0, NULL, NULL, DF_DECODE }, // 2 sprite colors |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2623 { DO_COPY , DS_EXTRA_DATA , 0x0000, 14 , 0x3e00, 0, NULL, NULL, DF_DECODE }, // Lazily copy whole data for sprite data |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2624 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0 , 0 , 0, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2625 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2626 { DO_LAST , 0 , 0 , 0 , 0 , 0, NULL, NULL, DF_NORMAL }, |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2627 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2628 }, |
2603
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2629 |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2630 { // #12: EXON VHI Editor 0.1 |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2631 D64_FMT_HIRES | D64_FMT_ILACE, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2632 D64_SCR_WIDTH * 2, D64_SCR_HEIGHT, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2633 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2634 1, 1, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2635 NULL, NULL, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2636 fmtGetPixelEXON_VHI, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2637 { |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2638 { DO_COPY , DS_BITMAP_RAM , 0x2000 - 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2639 { DO_COPY , DS_BITMAP_RAM , 0x4000 - 0x2000, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2640 { DO_COPY , DS_SCREEN_RAM , 0x6000 - 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2641 { DO_SET_MEM_LO , DS_D020 , 0x63ea - 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2642 |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2643 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_RES , 0, 0, D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2644 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2645 } |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
2646 } |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2647 }; |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2648 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2649 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2650 // |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2651 // Array with data for supported formats |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2652 // |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2653 DMC64ImageFormat dmC64ImageFormats[] = |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2654 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2655 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2656 "d2p", "DrazPaint 1.4/2.0 (packed)", 0x5800, 0, 0, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2657 fmtProbeDrazPaint20Packed, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2658 fmtDecodeDrazPaintPacked, fmtEncodeDrazPaintPacked, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2659 { 0 }, &dmC64CommonFormats[4] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2660 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2661 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2662 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2663 "drp", "DrazPaint (unpacked)", 0x5800, 10051, 0, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2664 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2665 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2666 { 0 }, &dmC64CommonFormats[4] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2667 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2668 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2669 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2670 "dlp", "DrazLace 1.0 (packed)", 0x5800, 0, 0, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2671 fmtProbeDrazLace10Packed, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2672 fmtDecodeDrazPaintPacked, fmtEncodeDrazPaintPacked, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2673 { 0 }, &dmC64CommonFormats[5] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2674 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2675 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2676 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2677 "drl", "DrazLace 1.0 (unpacked)", 0x5800, 18242, 0, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2678 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2679 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2680 { 0 }, &dmC64CommonFormats[5] |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2681 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2682 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2683 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2684 "bdp5", "Boogie Down Paint 5 (packed)", 0x5000, 0, 0, DM_FMT_RDWR, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2685 fmtProbeBDP5Packed, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2686 fmtDecodeBDP5Packed, fmtEncodeBDP5Packed, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2687 { 0 }, &dmC64CommonFormats[0] // Memory format is same as Koala |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2688 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2689 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2690 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2691 "vid", "Vidcom 64 (unpacked)", 0x5800, 10050, 0, DM_FMT_RDWR, |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2692 NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2693 NULL, NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2694 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2695 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2696 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2697 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2698 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2699 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2700 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2701 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2702 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2703 { DO_SET_MEM_LO , DS_BGCOL , 0x07e8, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2704 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2705 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2706 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2707 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2708 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2709 NULL |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2710 }, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2711 |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2712 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2713 "p64", "Picasso 64 (unpacked)", 0x1800, 10050, 0, DM_FMT_RDWR, |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2714 NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2715 NULL, NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2716 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2717 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2718 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2719 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2720 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2721 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2722 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2723 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2724 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2725 { DO_SET_MEM_LO , DS_BGCOL , 0x07fe, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2726 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2727 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2728 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2729 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2730 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2731 NULL |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2732 }, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2733 |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2734 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2735 "mci", "Truepaint (unpacked)", 0x9c00, 19434, 0, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2736 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2737 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2738 { 0 }, &dmC64CommonFormats[6] |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2739 }, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2740 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2741 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2742 "mcip", "Truepaint (packed)", 0x0801, 0, 0, DM_FMT_RD, |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2743 fmtProbeTruePaintPacked, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2744 fmtDecodeTruePaintPacked, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2745 { 0 }, &dmC64CommonFormats[6] |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2746 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2747 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2748 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2749 "kla", "Koala Painter (unpacked)", 0x6000, 10003, 0, DM_FMT_RDWR, |
2015
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
2750 fmtProbeKoalaPainter, |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2751 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2752 { 0 }, &dmC64CommonFormats[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2753 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2754 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2755 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2756 "klp", "Koala Painter (packed)", 0x6000, 0, 0xfe, DM_FMT_RDWR, |
1815
2b68b6955635
Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents:
1813
diff
changeset
|
2757 fmtProbeKoalaPainterPacked, |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
2758 fmtDecodeStaticRLEMarkerMode2, fmtEncodeStaticRLEMarkerMode2, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2759 { 0 }, &dmC64CommonFormats[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2760 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2761 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2762 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2763 "aas", "Advanced Art Studio (unpacked)", 0x2000, 10018, 0, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2764 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2765 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2766 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2767 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2768 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2769 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2770 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2771 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2772 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2773 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2774 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2775 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2776 { DO_SET_MEM_LO , DS_D020 , 0x2328, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2777 { DO_SET_MEM_LO , DS_BGCOL , 0x2329, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2778 { DO_COPY , DS_COLOR_RAM , 0x2338, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2779 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2780 }, |
1593
a77876a07425
Oops, missed this from the last commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1592
diff
changeset
|
2781 }, |
a77876a07425
Oops, missed this from the last commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1592
diff
changeset
|
2782 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2783 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2784 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2785 { |
2630
ca617d635fce
Rename Image System type ims -> ism.
Matti Hamalainen <ccr@tnsp.org>
parents:
2629
diff
changeset
|
2786 "ism", "Image System MC (unpacked)", 0x3c00, 10218, 0, DM_FMT_RDWR, |
1755
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2787 NULL, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2788 NULL, NULL, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2789 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2790 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2791 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2792 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2793 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2794 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2795 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2796 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2797 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2798 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2799 { DO_SET_MEM_LO , DS_BGCOL , 0x23ff, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2800 { DO_COPY , DS_SCREEN_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2801 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2802 } |
1755
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2803 }, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2804 NULL |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2805 }, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2806 |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2807 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2808 "mil", "Micro Illustrator (unpacked)", 0x18dc, 10022, 0, DM_FMT_RDWR | DM_FMT_BROKEN, |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
2809 fmtProbeMicroIllustrator, |
1758
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2810 NULL, NULL, |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2811 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2812 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2813 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2814 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2815 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2816 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2817 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2818 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2819 { DO_COPY , DS_SCREEN_RAM , 20 + 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2820 { DO_COPY , DS_COLOR_RAM , 20 + 1000 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2821 { DO_COPY , DS_BITMAP_RAM , 20 + 2000 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1985
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
2822 // XXX TODO: Unknown where the background color is set, so default to 0x00 |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2823 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2824 { DO_SET_MEM_LO , DS_BGCOL , 20 + 0x3e8 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2825 { DO_SET_MEM_LO , DS_BGCOL , 20 + 0x3e9 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2826 { DO_SET_MEM_LO , DS_BGCOL , 20 + 0x3ea , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2827 { DO_SET_MEM_LO , DS_BGCOL , 20 + 0x3eb , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2828 { DO_FUNC , 0 , 0 , 0, 0, 0, NULL, fmtEncodeMicroIllustrator, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2829 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2830 } |
1758
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2831 }, |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2832 NULL |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2833 }, |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2834 |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2835 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2836 "cdu", "CDU-Paint (unpacked)", 0x7eef, 10277, 0, DM_FMT_RDWR, |
1754
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2837 NULL, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2838 NULL, NULL, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2839 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2840 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2841 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2842 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2843 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2844 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2845 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2846 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2847 { DO_COPY , DS_BITMAP_RAM , 0x0000 + 0x111, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2848 { DO_COPY , DS_SCREEN_RAM , 0x1f40 + 0x111, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2849 { DO_COPY , DS_COLOR_RAM , 0x2328 + 0x111, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2850 { DO_SET_MEM_LO , DS_BGCOL , 0x2710 + 0x111, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2851 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2852 } |
1754
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2853 }, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2854 NULL |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2855 }, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2856 |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2857 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2858 "rbp", "Rainbow Painter (unpacked)", 0x5c00, 10242, 0, DM_FMT_RDWR | DM_FMT_BROKEN, |
1763
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2859 NULL, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2860 NULL, NULL, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2861 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2862 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2863 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2864 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2865 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2866 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2867 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2868 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2869 { DO_COPY , DS_SCREEN_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2870 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2871 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2872 // XXX TODO: Not sure if the background color is hardcoded .. |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2873 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2874 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2875 } |
1763
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2876 }, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2877 NULL |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2878 }, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2879 |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2880 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2881 "sar", "Saracen Paint (unpacked)", 0x7800, 10219, 0, DM_FMT_RDWR, |
1772
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
2882 fmtProbeSaracenPaint, |
1769
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2883 NULL, NULL, |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2884 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2885 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2886 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2887 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2888 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2889 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2890 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2891 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2892 { DO_COPY , DS_SCREEN_RAM , 0x7800 - 0x7800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2893 { DO_SET_MEM_LO , DS_BGCOL , 0x7bf0 - 0x7800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2894 { DO_COPY , DS_BITMAP_RAM , 0x7c00 - 0x7800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2895 { DO_COPY , DS_COLOR_RAM , 0x9c00 - 0x7800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2896 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2897 } |
1769
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2898 }, |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2899 NULL |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2900 }, |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2901 |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2902 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2903 "blp", "Blazing Paddles (unpacked)", 0xA000, 10242, 0, DM_FMT_RDWR, |
1770
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2904 NULL, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2905 NULL, NULL, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2906 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2907 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2908 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2909 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2910 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2911 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2912 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2913 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2914 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1980
2cf79254b8e4
Confirm the Blazing Paddles d020/bgcolor positions and remove the broken flag.
Matti Hamalainen <ccr@tnsp.org>
parents:
1979
diff
changeset
|
2915 // Both d020 and bgcolor confirmed by tests |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2916 { DO_SET_MEM_LO , DS_D020 , 0x1f7f, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2917 { DO_SET_MEM_LO , DS_BGCOL , 0x1f80, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2918 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2919 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2920 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2921 } |
1770
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2922 }, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2923 NULL |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2924 }, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2925 |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2926 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2927 "pmg", "Paint Magic crippled MC (unpacked)", 0x3f8e, 9332, 0, DM_FMT_RDWR, |
1762
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2928 NULL, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2929 NULL, NULL, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2930 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2931 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2932 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2933 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2934 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2935 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2936 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2937 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2938 { DO_COPY , DS_BITMAP_RAM , 0x4000 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2939 { DO_COPY , DS_SCREEN_RAM , 0x6000 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2940 { DO_SET_MEM_LO , DS_D020 , 0x5f40 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2941 { DO_SET_MEM_LO , DS_COLOR_RAM , 0x5f43 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2942 { DO_SET_MEM_LO , DS_BGCOL , 0x5f44 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2943 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2944 } |
1762
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2945 }, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2946 NULL |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2947 }, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2948 |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2949 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2950 "a64", "Wigmore Artist 64 (unpacked)", 0x4000, 10242, 0, DM_FMT_RDWR, |
1779
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2951 NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2952 NULL, NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2953 { |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2954 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2955 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2956 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2957 2, 1, |
1779
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2958 NULL, NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2959 NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2960 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2961 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2962 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2963 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2964 { DO_SET_MEM_LO , DS_D020 , 0x27fe, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2965 { DO_SET_MEM_LO , DS_BGCOL , 0x27ff, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2966 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1779
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2967 } |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2968 }, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2969 NULL |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2970 }, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2971 |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2972 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2973 "ami", "Amica Paint (packed)", 0x4000, 0, 0, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2974 fmtProbeAmicaPaintPacked, |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
2975 fmtDecodeAmicaPaintPacked, fmtEncodeAmicaPaintPacked, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2976 { 0 }, &dmC64CommonFormats[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2977 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2978 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2979 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2980 "rpm", "Run Paint (unpacked)", 0x6000, 10006, 0, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2981 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2982 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2983 { 0 }, &dmC64CommonFormats[0] |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2984 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2985 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2986 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2987 "ipc", "Interpaint MC (unpacked)", 0x4000, 10003, 0, DM_FMT_RDWR, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2988 NULL, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2989 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2990 { 0 }, &dmC64CommonFormats[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2991 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2992 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2993 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
2994 "art", "Art Studio (unpacked)", 0x2000, 9009, 0, DM_FMT_RDWR, |
2161
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
2995 fmtProbeArtStudio, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2996 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
2997 { 0 }, &dmC64CommonFormats[2] |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2998 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2999 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3000 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3001 "iph", "Interpaint (unpacked)", 0x4000, 9002, 0, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3002 NULL, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3003 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3004 { 0 }, &dmC64CommonFormats[2] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3005 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3006 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3007 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3008 "dd", "Doodle (unpacked)", 0x1c00, 9218, 0, DM_FMT_RDWR, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
3009 fmtProbeDoodle, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3010 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3011 { 0 }, &dmC64CommonFormats[10] |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
3012 }, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
3013 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
3014 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3015 "jj", "Doodle (packed)", 0x5c00, 0, 0xfe, DM_FMT_RDWR, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
3016 fmtProbeDoodle, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
3017 fmtDecodeStaticRLEMarkerMode2, fmtEncodeStaticRLEMarkerMode2, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3018 { 0 }, &dmC64CommonFormats[10] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3019 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3020 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3021 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3022 "mon", "Monomagic (unpacked)", 0x2000, 8194, 0, DM_FMT_RDWR, |
1670
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
3023 NULL, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
3024 NULL, NULL, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
3025 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3026 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3027 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3028 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
3029 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3030 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3031 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3032 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3033 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3034 { DO_SET_OP , DS_SCREEN_RAM , 0xCF , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3035 // Default colors used by MM are --^^ |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3036 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3037 } |
1670
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
3038 }, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
3039 NULL |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
3040 }, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
3041 |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
3042 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3043 "hir", "Plain hires (unpacked)", 0x2000, 8002, 0, DM_FMT_RDWR, |
1671
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
3044 NULL, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
3045 NULL, NULL, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
3046 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3047 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3048 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3049 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
3050 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3051 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3052 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3053 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3054 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3055 { DO_SET_OP , DS_SCREEN_RAM , 0xF0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3056 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3057 } |
1671
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
3058 }, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
3059 NULL |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
3060 }, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
3061 |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
3062 { |
2613
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3063 "hed", "Hi-Eddi (unpacked)", 0x2000, 9218, 0, DM_FMT_RDWR, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3064 NULL, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3065 NULL, NULL, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3066 { |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3067 D64_FMT_HIRES, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3068 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3069 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3070 1, 1, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3071 NULL, NULL, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3072 NULL, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3073 { |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3074 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3075 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3076 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3077 } |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3078 }, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3079 NULL |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3080 }, |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3081 |
b814fe89038d
Add support for Hi-Eddi hires format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2607
diff
changeset
|
3082 { |
2537
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3083 "gih", "Gigapaint hires [mono] (unpacked)", 0x6000, 8002, 0, DM_FMT_RDWR, |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3084 fmtProbeGigapaintHires, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3085 NULL, NULL, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3086 { |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3087 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3088 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3089 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
3090 1, 1, |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3091 NULL, NULL, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3092 NULL, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3093 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3094 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3095 { DO_SET_OP , DS_SCREEN_RAM , 0x0F , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3096 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3097 } |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3098 }, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3099 NULL |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3100 }, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3101 |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
3102 { |
2537
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3103 "gic", "Gigapaint hires [color] (unpacked)", 0x6000, 9002, 0, DM_FMT_RDWR, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3104 fmtProbeGigapaintHires, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3105 NULL, NULL, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3106 { |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3107 D64_FMT_HIRES, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3108 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3109 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3110 1, 1, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3111 NULL, NULL, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3112 NULL, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3113 { |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3114 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3115 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3116 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3117 } |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3118 }, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3119 NULL |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3120 }, |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3121 |
646641d72128
Add support for Giga-Paint hires format that includes screen RAM. Not sure
Matti Hamalainen <ccr@tnsp.org>
parents:
2535
diff
changeset
|
3122 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3123 "bfli", "Pu-239 Big FLI/BFLI (unpacked)", 0x3bff, 33795, 0, DM_FMT_RD, |
1582
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
3124 NULL, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
3125 NULL, NULL, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
3126 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3127 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3128 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT * 2, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3129 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
3130 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3131 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3132 fmtGetPixelBFLI, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3133 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3134 { DO_COPY , DS_COLOR_RAM , 0x0001, 0, 0x400 , 0, NULL, NULL, DF_NORMAL }, |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
3135 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x0401, 0, 0x400 , 0, DF_NORMAL), |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3136 { DO_COPY , DS_BITMAP_RAM , 0x2401, 0, 0x2000, 0, NULL, NULL, DF_NORMAL }, |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
3137 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x4401, 8, 0x400 , 0x400, DF_NORMAL), |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3138 { DO_COPY , DS_BITMAP_RAM , 0x6401, 1, 0x2000, 0, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
3139 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3140 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3141 } |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
3142 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
3143 NULL |
1582
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
3144 }, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
3145 |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
3146 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3147 "bml", "Black Mail FLI (unpacked)", 0x3b00, 17474, 0, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3148 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3149 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3150 { 0 }, &dmC64CommonFormats[1] |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
3151 }, |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
3152 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
3153 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3154 "bmlp", "Black Mail FLI (packed)", 0x38f0, 0, 0, DM_FMT_RDWR, |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
3155 fmtProbeBlackMailFLIPacked, |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
3156 fmtDecodeBlackMailFLIPacked, fmtEncodeBlackMailFLIPacked, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3157 { 0 }, &dmC64CommonFormats[1] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3158 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3159 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3160 { |
2614
c9741a11d1cd
Format name consistency enforcement.
Matti Hamalainen <ccr@tnsp.org>
parents:
2613
diff
changeset
|
3161 "dfed", "Dolphins FLI Editor 3.2 (unpacked)", 0x3b00, 17665, 0, DM_FMT_RDWR, |
2308
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
3162 NULL, |
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
3163 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3164 { 0 }, &dmC64CommonFormats[1] |
2308
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
3165 }, |
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
3166 |
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
3167 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3168 "fd1", "FBI Crew FLI Designer 1.1 (unpacked)", 0x3c00, 17409, 0, DM_FMT_RDWR, |
1834
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
3169 NULL, |
1734
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
3170 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3171 { 0 }, &dmC64CommonFormats[9] |
1834
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
3172 }, |
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
3173 |
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
3174 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3175 "fd2", "FLI Designer 2 (unpacked)", 0x3ff0, 17409, 0, DM_FMT_RDWR, |
1834
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
3176 NULL, |
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
3177 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3178 { 0 }, &dmC64CommonFormats[9] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3179 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3180 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3181 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3182 "flnt", "Flinterlazer 1.0 (unpacked)", 0x284e, 38812, 0, DM_FMT_RD | DM_FMT_BROKEN, |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3183 NULL, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3184 NULL, NULL, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3185 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3186 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3187 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3188 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3189 2, 1, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3190 NULL, NULL, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3191 fmtGetPixelFlinterlazer, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3192 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3193 { DO_COPY , DS_COLOR_RAM , 0x0000 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3194 { DO_COPY , DS_COLOR_RAM , 0x0000 , 1, 0 , 0, NULL, NULL, DF_NORMAL }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3195 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3196 { DO_COPY , DS_BITMAP_RAM , 0x4000 - 0x284e, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
3197 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x6000 - 0x284e, 0, 0x400, 0, DF_NORMAL), |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3198 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3199 { DO_COPY , DS_BITMAP_RAM , 0x8000 - 0x284e, 1, 0 , 0, NULL, NULL, DF_NORMAL }, |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
3200 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0xA000 - 0x284e, 8, 0x400, 0, DF_NORMAL), |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3201 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3202 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_COLOR, 0 , 0 , D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3203 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8 , 0, 0 , D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2582 | 3204 { DO_FUNC , 0 , 0 , 0, 0, 0, fmtDecodeFlinterlazer, NULL, DF_NORMAL }, |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3205 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3206 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3207 }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3208 NULL |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3209 }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3210 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
3211 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3212 "eci", "ECI Graphic Editor 1.0 (unpacked)", 0x4000, 32770, 0, DM_FMT_RDWR, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3213 NULL, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3214 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3215 { 0 }, &dmC64CommonFormats[7] |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3216 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3217 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3218 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3219 "ecip", "ECI Graphic Editor 1.0 (packed)", 0x4000, 0, 0, DM_FMT_RDWR, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3220 fmtProbeECIPacked, |
1912
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
3221 fmtDecodeECIPacked, fmtEncodeECIPacked, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3222 { 0 }, &dmC64CommonFormats[7] |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3223 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3224 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3225 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3226 "fpt", "Face Painter (unpacked)", 0x4000, 10004, 0, DM_FMT_RDWR, |
1979
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3227 NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3228 NULL, NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3229 { // Almost same layout as Koala Painter, but FPT has D020 |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3230 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3231 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3232 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
3233 2, 1, |
1979
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3234 NULL, NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3235 NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3236 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3237 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3238 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3239 { DO_COPY , DS_COLOR_RAM , 0x2328, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3240 { DO_SET_MEM_LO , DS_BGCOL , 0x2710, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3241 { DO_SET_MEM_LO , DS_D020 , 0x2711, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3242 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1979
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3243 } |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3244 }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3245 NULL |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3246 }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3247 |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
3248 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3249 "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, 0, DM_FMT_RDWR, |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
3250 fmtProbeFunPaint2, |
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
3251 fmtDecodeFunPaint2, fmtEncodeFunPaint2Unpacked, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3252 { 0 }, &dmC64CommonFormats[3] |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3253 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3254 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3255 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3256 "fp2p", "FunPaint II (packed)", 0x3ff0, 0, 0, DM_FMT_RDWR, |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
3257 fmtProbeFunPaint2, |
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
3258 fmtDecodeFunPaint2, fmtEncodeFunPaint2Packed, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3259 { 0 }, &dmC64CommonFormats[3] |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3260 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3261 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3262 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3263 "gun", "GunPaint 1.1 (unpacked)", 0x4000, 33603, 0, DM_FMT_RDWR, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3264 fmtProbeGunPaint, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3265 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3266 { |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3267 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3268 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3269 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
3270 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3271 NULL, NULL, |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
3272 fmtGetPixelFunPaint2, // The format is essentially same as FP2 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3273 { |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
3274 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x0000, 0, 0x400, 0, DF_NORMAL), |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3275 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3276 { DO_COPY , DS_EXTRA_DATA , 0x3f4f, 0, 177, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3277 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
3278 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x4400, 8, 0x400, 0, DF_NORMAL), |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3279 { DO_COPY , DS_BITMAP_RAM , 0x6400, 1, 0 , 0, NULL, NULL, DF_NORMAL }, |
1847
e3d1f16be4ee
Using the newly introduced data block offset feature, unify the handling of
Matti Hamalainen <ccr@tnsp.org>
parents:
1846
diff
changeset
|
3280 // GunPaint does not store the last 3 d021 values .. so set them to black |
e3d1f16be4ee
Using the newly introduced data block offset feature, unify the handling of
Matti Hamalainen <ccr@tnsp.org>
parents:
1846
diff
changeset
|
3281 // XXX TODO: According to some, the last 4 should be same .. |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3282 { DO_SET_MEM , DS_EXTRA_DATA , 0 , 0, 3 , 20+177, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
3283 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_RES , 0, 0 , D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
3284 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8 , 0, 0 , D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3285 { DO_FUNC , 0 , 0 , 0, 0 , 0, NULL, fmtEncodeGunPaint, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3286 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
1805 | 3287 } |
3288 }, | |
3289 NULL | |
3290 }, | |
3291 | |
3292 { | |
2623
da81e524162e
Rename a function and HCB format title to include BD (for Booze Design)
Matti Hamalainen <ccr@tnsp.org>
parents:
2620
diff
changeset
|
3293 "hcb", "BD Half Char Bitmap (unpacked)", 0x5000, 12148, 0, DM_FMT_RDWR, |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3294 NULL, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3295 NULL, NULL, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3296 { |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3297 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3298 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3299 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
3300 2, 1, |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3301 NULL, NULL, |
2623
da81e524162e
Rename a function and HCB format title to include BD (for Booze Design)
Matti Hamalainen <ccr@tnsp.org>
parents:
2620
diff
changeset
|
3302 fmtGetPixelBDHCB, |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3303 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3304 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3305 { DO_COPY , DS_COLOR_RAM , 0x0400, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3306 { DO_COPY , DS_SCREEN_RAM , 0x0800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3307 { DO_COPY , DS_SCREEN_RAM , 0x0c00, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3308 { DO_COPY , DS_BITMAP_RAM , 0x1000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3309 { DO_COPY , DS_EXTRA_DATA , 0x2f40, 0, D64_SCR_HEIGHT / 4, 0, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
3310 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8 , 0, 0 , D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3311 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3312 } |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3313 }, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3314 NULL |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3315 }, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3316 |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
3317 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3318 "pen", "Pentel Paint (unpacked)", 0x4800, 19845, 0, DM_FMT_RD | DM_FMT_BROKEN, |
1805 | 3319 NULL, |
3320 NULL, NULL, | |
3321 { | |
2314
87533af8db64
Add format flag for formats that use sprite layer.
Matti Hamalainen <ccr@tnsp.org>
parents:
2313
diff
changeset
|
3322 D64_FMT_HIRES | D64_FMT_FLI | D64_FMT_SPRITES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3323 192, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3324 24, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
3325 2, 1, |
1805 | 3326 NULL, NULL, |
3327 fmtGetPixelPentelPaint, | |
3328 { | |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3329 { DO_COPY , DS_BITMAP_RAM , 0x0000 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3330 { DO_SET_OP , DS_SCREEN_RAM , 0x10 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3331 { DO_SET_MEM_LO , DS_BGCOL , 0x9580 - 0x4800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3332 { DO_SET_MEM_LO , DS_D022 , 0x9581 - 0x4800, 0, 0, 0, NULL, NULL, DF_NORMAL }, // Sprite color |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3333 { DO_SET_MEM_LO , DS_COLOR_RAM , 0x9582 - 0x4800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3334 { DO_COPY , DS_EXTRA_DATA , 0x5ac0 - 0x4800, 0, D64_SPR_SIZE * 235, 0, NULL, NULL, DF_NORMAL }, // Sprite data |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
3335 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8 , 0, 0 , D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3336 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3337 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3338 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3339 NULL |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3340 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3341 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3342 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3343 "chfd", "Crest Hires FLI Designer (unpacked)", 0x4000, 16386, 0, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3344 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3345 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3346 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3347 D64_FMT_HIRES | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3348 D64_SCR_WIDTH, D64_SCR_HEIGHT, // Actually 296 x 112 (=14*8) |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
3349 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
3350 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3351 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3352 fmtGetPixelCrestHIFLIorCDHM, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3353 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3354 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
2546
b76ac594cf33
Change DEF_REPEAT_BLOCK*() macro to have operator argument.
Matti Hamalainen <ccr@tnsp.org>
parents:
2545
diff
changeset
|
3355 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x2000, 0, 0x400, 0, DF_NORMAL), |
2545 | 3356 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0 , D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3357 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
3358 } |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
3359 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
3360 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3361 }, |
1803
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
3362 |
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
3363 { |
2614
c9741a11d1cd
Format name consistency enforcement.
Matti Hamalainen <ccr@tnsp.org>
parents:
2613
diff
changeset
|
3364 "cshf", "Crest Super Hires FLI Editor 1.0 (unpacked)", 0x4000, 15874, 0, DM_FMT_RDWR, |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
3365 fmtProbeCrestSHFLI, |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
3366 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3367 { 0 }, &dmC64CommonFormats[11] |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
3368 }, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
3369 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
3370 { |
2614
c9741a11d1cd
Format name consistency enforcement.
Matti Hamalainen <ccr@tnsp.org>
parents:
2613
diff
changeset
|
3371 "cshfp", "Crest Super Hires FLI Editor 1.0 (packed)", 0xa000, 0, 0, DM_FMT_RD, |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
3372 fmtProbeCrestSHFLI, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
3373 fmtDecodeCrestSHFLIPacked, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3374 { 0 }, &dmC64CommonFormats[11] |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
3375 }, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
3376 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
3377 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3378 "cdhm", "Cosmos Designs Hires Manager (unpacked)", 0x4000, 16385, 0, DM_FMT_RDWR, |
1803
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
3379 fmtProbeCosmosDesignsHiresManager, |
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
3380 NULL, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3381 { 0 }, &dmC64CommonFormats[8] |
1803
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
3382 }, |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
3383 |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3384 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3385 "cdhp", "Cosmos Designs Hires Manager (packed)", 0x4000, 0, 0, DM_FMT_RD, |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
3386 fmtProbeCosmosDesignsHiresManager, |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
3387 fmtDecodeCosmosDesignsHiresManagerPacked, NULL, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3388 { 0 }, &dmC64CommonFormats[8] |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
3389 }, |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
3390 |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
3391 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3392 "mrqp", "Marq's PETSCII editor (new format) (unpacked)", 0x0801, 0, 0, DM_FMT_RDWR, |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3393 fmtProbeMarqPETSCII, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3394 NULL, NULL, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3395 { |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3396 D64_FMT_HIRES | D64_FMT_CHAR, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3397 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3398 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3399 1, 1, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3400 NULL, NULL, |
2172
de88333acc44
Move the PETSCII getpixel function to lib64gfx.c and remove the
Matti Hamalainen <ccr@tnsp.org>
parents:
2170
diff
changeset
|
3401 NULL, |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3402 { |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
3403 // For offset values see petscii/m_c64.pde :: save_prg() |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
3404 { DO_FUNC , 0 , 20 - 2, 0, 0, 0, NULL, fmtEncodeMarqPETSCIIData, DF_NORMAL }, |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
3405 { DO_COPY , DS_SCREEN_RAM , 0x60 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
3406 { DO_COPY , DS_COLOR_RAM , 0x60 + 1000,0,0, 0, NULL, NULL, DF_NORMAL }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3407 { DO_SET_MEM_LO , DS_D020 , 25 - 2, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3408 { DO_SET_MEM_LO , DS_BGCOL , 30 - 2, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
3409 { DO_FUNC , 0 , 20 - 2, 0, 0, 0, fmtDecodeHiresPETSCIICharsetData, NULL, DF_NORMAL }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3410 |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3411 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3412 } |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3413 }, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3414 NULL |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
3415 }, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3416 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3417 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3418 "mqpo", "Marq's PETSCII editor (old format) (unpacked)", 0x0801, 2499, 0, DM_FMT_RD, |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3419 NULL, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3420 NULL, NULL, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3421 { |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3422 D64_FMT_HIRES | D64_FMT_CHAR, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3423 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3424 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3425 1, 1, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3426 NULL, NULL, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3427 NULL, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3428 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3429 { DO_COPY , DS_SCREEN_RAM , 0x01ab, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3430 { DO_COPY , DS_COLOR_RAM , 0x01ab + 1000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3431 |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3432 { DO_SET_MEM_LO , DS_D020 , 0x01a9, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3433 { DO_SET_MEM_LO , DS_BGCOL , 0x01aa, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2377
d8889ff223b6
UPETSCII is actually old version of Marq's PETSCII editor.
Matti Hamalainen <ccr@tnsp.org>
parents:
2371
diff
changeset
|
3434 { DO_FUNC , 0 , 0 , 0, 0, 0, fmtDecodeMarqOldData, NULL, DF_NORMAL }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3435 |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3436 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3437 } |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3438 }, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3439 NULL |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3440 }, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3441 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
3442 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3443 "pkhu", "petscii.krissz.hu editor (unpacked)", 0x0801, 0, 0, DM_FMT_RD, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3444 fmtProbePetsciiKrisszHu, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3445 NULL, NULL, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3446 { |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
3447 D64_FMT_CHAR, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3448 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3449 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3450 1, 1, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3451 NULL, NULL, |
2172
de88333acc44
Move the PETSCII getpixel function to lib64gfx.c and remove the
Matti Hamalainen <ccr@tnsp.org>
parents:
2170
diff
changeset
|
3452 NULL, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3453 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3454 { DO_COPY , DS_SCREEN_RAM , 0x2001 - 2, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3455 { DO_COPY , DS_COLOR_RAM , 0x23e9 - 2, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3456 |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3457 { DO_COPY , DS_EXTRA_DATA , 0x0000 , 0, 0x0100, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3458 { DO_COPY , DS_CHAR_DATA , 0x1801 - 2, 0, 0x0800, 0, NULL, NULL, DF_NORMAL }, |
2366
1e6e018b6487
Rename some functions to be more consistent with their intent.
Matti Hamalainen <ccr@tnsp.org>
parents:
2363
diff
changeset
|
3459 { DO_FUNC , 0 , 0 , 0, 0 , 0, fmtDecodePetsciiKrisszHuData, NULL, DF_NORMAL }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3460 |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
3461 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3462 } |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3463 }, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3464 NULL |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
3465 }, |
2362
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3466 |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3467 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3468 "poca", "Petscii Coca editor (unpacked)", 0x0801, 0, 0, DM_FMT_RDWR, |
2367
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
3469 fmtProbeCocaPETSCII, |
2362
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3470 NULL, NULL, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3471 { |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3472 D64_FMT_HIRES | D64_FMT_CHAR, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3473 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3474 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3475 1, 1, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3476 NULL, NULL, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3477 NULL, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3478 { |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
3479 { DO_FUNC , 0 , 0x0c44 - 0x0801, 0, 0, 0, NULL, fmtEncodeCocaPETSCIIData, DF_NORMAL }, |
2362
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3480 { DO_COPY , DS_SCREEN_RAM , 0x085a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3481 { DO_COPY , DS_COLOR_RAM , 0x0c5a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2367
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
3482 |
2362
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3483 { DO_SET_MEM_LO , DS_D020 , 0x0c42 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3484 { DO_SET_MEM_LO , DS_BGCOL , 0x0c43 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
3485 { DO_FUNC , 0 , 0x0c44 - 0x0801, 0, 0, 0, fmtDecodeHiresPETSCIICharsetData, NULL, DF_NORMAL }, |
2362
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3486 |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3487 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3488 } |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3489 }, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3490 NULL |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3491 }, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
3492 |
2399
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3493 { |
2521
b19535da15e9
Add new field 'size_t extra' to DMC64ImageFormat for certain image format data
Matti Hamalainen <ccr@tnsp.org>
parents:
2519
diff
changeset
|
3494 "acpe", "Abyss Connection PETSCII-Editor 4.61 (unpacked)", 0x3000, 2026, 0, DM_FMT_RDWR, |
2399
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3495 NULL, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3496 NULL, NULL, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3497 { |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3498 D64_FMT_HIRES | D64_FMT_CHAR, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3499 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3500 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3501 1, 1, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3502 NULL, NULL, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3503 NULL, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3504 { |
2428
09082816665d
Fix write support of Abyss Connection PETSCII-Editor 4.61 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2399
diff
changeset
|
3505 { DO_FUNC , 0 , 0x33ea - 0x3000, 0, 0, 0, NULL, fmtEncodeHiresPETSCIICharsetData, DF_NORMAL }, |
2399
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3506 { DO_COPY , DS_SCREEN_RAM , 0x0000 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3507 { DO_COPY , DS_COLOR_RAM , 0x0400 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3508 |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3509 { DO_SET_MEM_LO , DS_D020 , 0x33e8 - 0x3000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3510 { DO_SET_MEM_LO , DS_BGCOL , 0x33e9 - 0x3000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3511 { DO_FUNC , 0 , 0x33ea - 0x3000, 0, 0, 0, fmtDecodeHiresPETSCIICharsetData, NULL, DF_NORMAL }, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3512 |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3513 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3514 } |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3515 }, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3516 NULL |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3517 }, |
5d391c31ebc9
Add support for Abyss Connection PETSCII-Editor 4.61 (unpacked) raw file format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2389
diff
changeset
|
3518 |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3519 { |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
3520 "suphi1", "SupeRes hires [clear] (packed)", -1, 0, 0x23, DM_FMT_RDWR, |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3521 fmtProbeSupeRes, |
2545 | 3522 fmtDecodeSupeRes, fmtEncodeSupeRes, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3523 { 0 }, &dmC64CommonFormats[10] |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3524 }, |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3525 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3526 { |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
3527 "suphi2", "SupeRes hires [no-clear] (packed)", -1, 0, 0x25, DM_FMT_RDWR, |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3528 fmtProbeSupeRes, |
2545 | 3529 fmtDecodeSupeRes, fmtEncodeSupeRes, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3530 { 0 }, &dmC64CommonFormats[10] |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3531 }, |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3532 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3533 { |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
3534 "supmc1", "SupeRes multicolor [clear] (packed)", -1, 0, 0x24, DM_FMT_RDWR, |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3535 fmtProbeSupeRes, |
2545 | 3536 fmtDecodeSupeRes, fmtEncodeSupeRes, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3537 { 0 }, &dmC64CommonFormats[0] |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3538 }, |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3539 |
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3540 { |
2525
19b0ca169361
Implement SupeRes encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2524
diff
changeset
|
3541 "supmc2", "SupeRes multicolor [no-clear] (packed)", -1, 0, 0x26, DM_FMT_RDWR, |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3542 fmtProbeSupeRes, |
2545 | 3543 fmtDecodeSupeRes, fmtEncodeSupeRes, |
2573
21d296803fac
Use { 0 } initializer instead of {}.
Matti Hamalainen <ccr@tnsp.org>
parents:
2570
diff
changeset
|
3544 { 0 }, &dmC64CommonFormats[0] |
2519
4dbb6572622d
Add preliminary decoder for SupeRes hires and multicolor files. The decoder
Matti Hamalainen <ccr@tnsp.org>
parents:
2428
diff
changeset
|
3545 }, |
2540
a60e046b7294
Add read-only support for another unknown unpacked c64 MC format (contains a viewer routine).
Matti Hamalainen <ccr@tnsp.org>
parents:
2539
diff
changeset
|
3546 |
2570
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3547 { |
2620
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3548 "vhi", "EXON VHI Editor 0.1 (unpacked)", 0x2000, 17389, 0, DM_FMT_RDWR, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3549 NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3550 NULL, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3551 { 0 }, &dmC64CommonFormats[12] |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3552 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3553 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3554 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3555 "vhip", "EXON VHI Editor 0.1 (packed)", 0x2000, 17389, 0, DM_FMT_RD, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3556 fmtProbeEXON_VHI_Packed, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3557 fmtDecodeEXON_VHI_Packed, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3558 { 0 }, &dmC64CommonFormats[12] |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3559 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3560 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3561 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3562 "xx1", "Unknown $2000 format (unpacked)", 0x2000, 10242, 0, DM_FMT_RDWR, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3563 NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3564 NULL, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3565 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3566 D64_FMT_MC, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3567 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3568 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3569 2, 1, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3570 NULL, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3571 NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3572 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3573 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3574 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3575 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3576 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3577 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3578 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3579 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3580 NULL |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3581 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3582 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3583 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3584 "xx2", "Unknown $2000 format (unpacked)", 0x2000, 0, 0, DM_FMT_RDWR, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3585 fmtProbeFormatXX2, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3586 fmtDecodeFormatXX2, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3587 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3588 D64_FMT_MC, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3589 XX2_WIDTH_CH * 4, XX2_HEIGHT_CH * 8, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3590 XX2_WIDTH_CH , XX2_HEIGHT_CH, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3591 2, 1, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3592 NULL, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3593 NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3594 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3595 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, XX2_BSIZE, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3596 { DO_COPY , DS_SCREEN_RAM , XX2_BSIZE, 0, XX2_SIZE, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3597 { DO_COPY , DS_COLOR_RAM , XX2_BSIZE + XX2_SIZE, 0, XX2_SIZE, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3598 { DO_SET_OP , DS_BGCOL , 11 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3599 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3600 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3601 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3602 NULL |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3603 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3604 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3605 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3606 "xx3", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 10500, 0, DM_FMT_RD, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3607 fmtProbeFormatXX3, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3608 NULL, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3609 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3610 D64_FMT_MC, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3611 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3612 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3613 2, 1, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3614 NULL, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3615 NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3616 { |
2628 | 3617 { DO_SET_MEM_LO , DS_D020 , 0x09e6 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
3618 { DO_SET_MEM_LO , DS_BGCOL , 0x09e7 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, | |
2620
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3619 { DO_COPY , DS_BITMAP_RAM , 0x09f2 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3620 { DO_COPY , DS_SCREEN_RAM , 0x2932 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3621 { DO_COPY , DS_COLOR_RAM , 0x2d1a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3622 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3623 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3624 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3625 NULL |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3626 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3627 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3628 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3629 "xx4", "Unknown $1f00 format (unpacked)", 0x1f00, 10260, 0, DM_FMT_RD, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3630 fmtProbeFormatXX4, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3631 NULL, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3632 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3633 D64_FMT_MC, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3634 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3635 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3636 2, 1, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3637 NULL, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3638 NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3639 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3640 { DO_COPY , DS_BITMAP_RAM , 0x2000 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3641 { DO_COPY , DS_SCREEN_RAM , 0x3f40 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3642 { DO_COPY , DS_COLOR_RAM , 0x4328 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2626
4fc62ffe1969
Fix XX4 bg/border color setting.
Matti Hamalainen <ccr@tnsp.org>
parents:
2625
diff
changeset
|
3643 { DO_SET_MEM_LO, DS_BGCOL , 0x4710 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
4fc62ffe1969
Fix XX4 bg/border color setting.
Matti Hamalainen <ccr@tnsp.org>
parents:
2625
diff
changeset
|
3644 { DO_SET_MEM_LO, DS_D020 , 0x4711 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2620
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3645 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3646 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3647 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3648 NULL |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3649 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3650 |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3651 { |
2570
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3652 "xx5", "Unknown $1000 format (unpacked)", 0x1000, 45000, 0, DM_FMT_RD | DM_FMT_BROKEN, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3653 fmtProbeFormatXX5, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3654 NULL, NULL, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3655 { |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3656 D64_FMT_HIRES | D64_FMT_FLI | D64_FMT_ILACE, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3657 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3658 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3659 1, 1, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3660 NULL, NULL, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3661 fmtGetPixelXX5, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3662 { |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3663 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x4000 - 0x1000, 0, 0x400, 0, DF_NORMAL), |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3664 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x8000 - 0x1000, 8, 0x400, 0, DF_NORMAL), |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3665 |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3666 { DO_COPY , DS_BITMAP_RAM , 0x6000 - 0x1000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3667 { DO_COPY , DS_BITMAP_RAM , 0xa400 - 0x1000, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3668 |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3669 { DO_COPY , DS_COLOR_RAM , 0x8000 - 0x1000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3670 |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3671 // BG/FG always 0 |
2625
84d6b7805b7f
Fix XX5 bg/border color setting.
Matti Hamalainen <ccr@tnsp.org>
parents:
2624
diff
changeset
|
3672 { DO_SET_OP , DS_BGCOL , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
84d6b7805b7f
Fix XX5 bg/border color setting.
Matti Hamalainen <ccr@tnsp.org>
parents:
2624
diff
changeset
|
3673 { DO_SET_OP , DS_D020 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2570
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3674 |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3675 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_RES , 0, 0, D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3676 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8 , 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3677 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3678 } |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3679 }, |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3680 NULL |
1559011d749f
Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5".
Matti Hamalainen <ccr@tnsp.org>
parents:
2546
diff
changeset
|
3681 }, |
2540
a60e046b7294
Add read-only support for another unknown unpacked c64 MC format (contains a viewer routine).
Matti Hamalainen <ccr@tnsp.org>
parents:
2539
diff
changeset
|
3682 |
2603
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
3683 { |
2620
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3684 "xx6", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 16148, 0, DM_FMT_RD, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3685 fmtProbeFormatXX6, |
2603
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
3686 NULL, NULL, |
2620
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3687 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3688 D64_FMT_MC, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3689 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3690 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3691 2, 1, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3692 NULL, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3693 NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3694 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3695 { DO_COPY , DS_BITMAP_RAM , 0x2000 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3696 { DO_COPY , DS_SCREEN_RAM , 0x3f40 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3697 { DO_COPY , DS_COLOR_RAM , 0x4328 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3698 { DO_SET_OP , DS_D020 , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3699 { DO_SET_MEM_LO , DS_BGCOL , 0x4710 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3700 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3701 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3702 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3703 NULL |
2603
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
3704 }, |
8386c5e55a31
Implement support for EXON VHI Editor 0.1 unpacked format files
Matti Hamalainen <ccr@tnsp.org>
parents:
2601
diff
changeset
|
3705 |
2605
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
3706 { |
2620
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3707 "xx7", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 9590, 0, DM_FMT_RD, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3708 fmtProbeFormatXX7, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3709 NULL, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3710 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3711 D64_FMT_HIRES, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3712 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3713 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3714 1, 1, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3715 NULL, NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3716 NULL, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3717 { |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3718 { DO_COPY , DS_BITMAP_RAM , 0x0a26 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3719 { DO_COPY , DS_SCREEN_RAM , 0x2968 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3720 { DO_SET_MEM_LO , DS_D020 , 0x2966 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3721 { DO_SET_MEM_LO , DS_BGCOL , 0x2967 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3722 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3723 } |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3724 }, |
2aa885371c13
Reorganize the format list a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2614
diff
changeset
|
3725 NULL |
2605
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
3726 }, |
f5f03c5d9fd5
Implement EXON VHI Editor 0.1 packed format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2604
diff
changeset
|
3727 |
2627
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3728 { |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3729 "xx9", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 10608, 0, DM_FMT_RD, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3730 fmtProbeFormatXX9, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3731 NULL, NULL, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3732 { |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3733 D64_FMT_MC, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3734 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3735 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3736 2, 1, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3737 NULL, NULL, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3738 NULL, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3739 { |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3740 { DO_COPY , DS_BITMAP_RAM , 0x0a38 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3741 { DO_COPY , DS_SCREEN_RAM , 0x297a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3742 { DO_COPY , DS_COLOR_RAM , 0x2d62 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3743 { DO_SET_MEM_LO, DS_BGCOL , 0x2979 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3744 { DO_SET_MEM_LO, DS_D020 , 0x2978 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3745 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3746 } |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3747 }, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3748 NULL |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3749 }, |
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3750 |
2629
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3751 { |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3752 "xx10", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 9312, 0, DM_FMT_RD, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3753 fmtProbeFormatXX10, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3754 NULL, NULL, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3755 { |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3756 D64_FMT_HIRES, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3757 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3758 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3759 1, 1, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3760 NULL, NULL, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3761 NULL, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3762 { |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3763 { DO_COPY , DS_BITMAP_RAM , 0x0937 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3764 { DO_COPY , DS_SCREEN_RAM , 0x2877 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3765 { DO_SET_MEM_LO , DS_D020 , 0x0934 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3766 { DO_SET_MEM_LO , DS_BGCOL , 0x0934 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3767 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3768 } |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3769 }, |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3770 NULL |
07c85fffd805
Add support for unknown hires format XX10.
Matti Hamalainen <ccr@tnsp.org>
parents:
2628
diff
changeset
|
3771 }, |
2627
262395b86b7c
Add support for unknown plain multicolor viewer format XX9.
Matti Hamalainen <ccr@tnsp.org>
parents:
2626
diff
changeset
|
3772 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3773 }; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3774 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3775 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3776 |