Mercurial > hg > dmlib
annotate tools/lib64fmts.c @ 2186:dc8a443accdf
Simplify fmtDrazLaceGetLaceType() as the buffer can't be NULL.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Wed, 12 Jun 2019 21:30:58 +0300 |
parents | 6ba6ca5632d2 |
children | ec47c60d26e2 |
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 |
2120 | 5 * (C) Copyright 2012-2019 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 |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
14 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
|
15 { |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
16 if (buf->len == fmt->size && |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
17 dmCompareAddr16(buf, 0, fmt->addr)) |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
18 return DM_PROBE_SCORE_MAX; |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
19 |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
20 return DM_PROBE_SCORE_FALSE; |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
21 } |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
22 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
23 |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
24 // 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
|
25 // 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
|
26 // 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
|
27 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
|
28 { |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
29 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
|
30 }; |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
31 |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
32 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
|
33 { |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
34 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
|
35 }; |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
36 |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
37 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
|
38 { |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
39 if (buf->len == fmt->size && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
40 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
|
41 && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
42 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
|
43 ) |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
44 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
|
45 |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
46 return DM_PROBE_SCORE_FALSE; |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
47 } |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
48 |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
49 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
50 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
|
51 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
|
52 { |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
53 (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
|
54 (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
|
55 (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
|
56 |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
57 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
|
58 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
|
59 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
60 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
|
61 } |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
62 |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
63 |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
64 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
|
65 { |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
66 0x01, 0x08, 0x0b, 0x08, 0xef, 0x00, 0x9e, 0x32, 0x30, 0x36, |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
67 0x31, 0x00, 0x00, 0x00, 0xa9, 0x0b, 0x8d, 0x11, 0xd0, 0xa9, |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
68 }; |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
69 |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
70 static const Uint8 fmtMarqPETSCII_ID2[] = |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
71 { |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
72 0x8d, 0x21, 0xd0, 0xa2, 0x00, 0xa0, 0xfa, 0xbd, 0x61, 0x08, |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
73 0x9d, 0x00, 0x04, 0xbd, 0x5b, 0x09, 0x9d, 0xfa, 0x04, 0xbd, |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
74 0x55, 0x0a, 0x9d, 0xf4, |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
75 }; |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
76 |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
77 |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
78 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
|
79 { |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
80 (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
|
81 |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
82 if (buf->len == 2098 && |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
83 DM_MEMCMP_SIZE(buf->data, fmtMarqPETSCII_ID1) == 0 && |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
84 DM_MEMCMP_SIZE(buf->data + 0x1f, fmtMarqPETSCII_ID2) == 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
|
85 ) |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
86 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
|
87 |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
88 return DM_PROBE_SCORE_FALSE; |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
89 } |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
90 |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
91 |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
92 static int fmtSetMarqPETSCIIData(const DMC64EncDecOp *op, DMC64Image *img, |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
93 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
94 { |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
95 (void) op; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
96 (void) buf; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
97 (void) fmt; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
98 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
99 switch (img->extraData[0].data[0]) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
100 { |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
101 case 20: img->extraInfo[D64_EI_CHAR_CASE] = 0; break; // upper case |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
102 case 23: img->extraInfo[D64_EI_CHAR_CASE] = 1; break; // lower case |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
103 default: |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
104 return DMERR_INVALID_DATA; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
105 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
106 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
107 img->extraInfo[D64_EI_CHAR_MODE] = D64_FMT_HIRES; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
108 img->extraInfo[D64_EI_CHAR_CUSTOM] = 0; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
109 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
110 return DMERR_OK; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
111 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
112 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
113 |
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
|
114 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
|
115 { |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
116 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
|
117 0x31, 0x00, 0x00, 0x00, 0xA9, |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
118 }; |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
119 |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
120 static const Uint8 fmtPetsciiKrisszHu_ID2[] = |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
121 { |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
122 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
|
123 }; |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
124 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
125 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
126 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
|
127 { |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
128 (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
|
129 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
130 if (buf->len == 10193 && |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
131 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
|
132 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
|
133 ) |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
134 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
|
135 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
136 return DM_PROBE_SCORE_FALSE; |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
137 } |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
138 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
139 |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
140 static int fmtSetPetsciiKrisszHuData(const DMC64EncDecOp *op, DMC64Image *img, |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
141 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
142 { |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
143 (void) op; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
144 (void) buf; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
145 (void) fmt; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
146 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
147 const Uint8 *data = img->extraData[0].data; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
148 switch (data[0x0028 - 2]) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
149 { |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
150 case 0x00: |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
151 img->extraInfo[D64_EI_CHAR_MODE] = D64_FMT_HIRES; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
152 img->d020 = data[0x001e - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
153 img->bgcolor = data[0x0023 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
154 break; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
155 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
156 case 0xd8: |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
157 img->extraInfo[D64_EI_CHAR_MODE] = D64_FMT_MC; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
158 img->d020 = data[0x001e - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
159 img->bgcolor = data[0x0023 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
160 img->d022 = data[0x002d - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
161 img->d023 = data[0x0032 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
162 break; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
163 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
164 case 0x01: |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
165 img->extraInfo[D64_EI_CHAR_MODE] = D64_FMT_ECM; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
166 img->d020 = data[0x001e - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
167 img->bgcolor = data[0x0023 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
168 img->d022 = data[0x0028 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
169 img->d023 = data[0x002d - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
170 img->d024 = data[0x0032 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
171 break; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
172 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
173 default: |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
174 return DMERR_INVALID_DATA; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
175 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
176 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
177 // 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
|
178 // 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
|
179 // 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
|
180 // implement a hash-based detection at some point. |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
181 img->extraInfo[D64_EI_CHAR_CASE] = 0; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
182 img->extraInfo[D64_EI_CHAR_CUSTOM] = 1; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
183 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
184 return DMERR_OK; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
185 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
186 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
187 |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
188 static int fmtSetSPETSCIIData(const DMC64EncDecOp *op, DMC64Image *img, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
189 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
|
190 { |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
191 (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
|
192 (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
|
193 (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
|
194 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
195 img->extraInfo[D64_EI_CHAR_MODE] = D64_FMT_HIRES; |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
196 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
|
197 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
198 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
|
199 } |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
200 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
201 |
2015
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
202 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
|
203 { |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
204 int score = DM_PROBE_SCORE_FALSE; |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
205 |
2112
9dc2976e9fa3
Improve probing of packed and unpacked Koala files. Many converters and
Matti Hamalainen <ccr@tnsp.org>
parents:
2080
diff
changeset
|
206 if (buf->len == 10003 || |
9dc2976e9fa3
Improve probing of packed and unpacked Koala files. Many converters and
Matti Hamalainen <ccr@tnsp.org>
parents:
2080
diff
changeset
|
207 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
|
208 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
|
209 |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
210 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
|
211 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
|
212 |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
213 return score; |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
214 } |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
215 |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
216 |
1815
2b68b6955635
Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents:
1813
diff
changeset
|
217 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
|
218 { |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
219 // 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
|
220 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
|
221 buf->len < 10002 && |
1594
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
222 dmCompareAddr16(buf, 0, fmt->addr)) |
1771 | 223 return DM_PROBE_SCORE_GOOD; |
1594
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
224 |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
225 return DM_PROBE_SCORE_FALSE; |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
226 } |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
227 |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
228 |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
229 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
|
230 { |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
231 if (buf->len > 32 && |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
232 (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
|
233 { |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
234 // Packed variant |
1841
fc4841460fad
Attempt to avoid misprobes of "Rainbow Painter (unpacked)" as packed Doodle files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1840
diff
changeset
|
235 if (fmt->size == 0xfe && |
fc4841460fad
Attempt to avoid misprobes of "Rainbow Painter (unpacked)" as packed Doodle files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1840
diff
changeset
|
236 buf->len != fmt->size && |
fc4841460fad
Attempt to avoid misprobes of "Rainbow Painter (unpacked)" as packed Doodle files.
Matti Hamalainen <ccr@tnsp.org>
parents:
1840
diff
changeset
|
237 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
|
238 return DM_PROBE_SCORE_MAX; |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
239 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
240 // Unpacked variant |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
241 if (fmt->size != 0xfe && buf->len == fmt->size) |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
242 return DM_PROBE_SCORE_MAX; |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
243 } |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
244 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
245 return DM_PROBE_SCORE_FALSE; |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
246 } |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
247 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
248 |
2161
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
249 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
|
250 { |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
251 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
|
252 dmCompareAddr16(buf, 0, 0x2000)) |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
253 return DM_PROBE_SCORE_MAX; |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
254 |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
255 return DM_PROBE_SCORE_FALSE; |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
256 } |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
257 |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
258 |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
259 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
|
260 { |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
261 int res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
262 DMGrowBuf mem; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
263 DMCompParams cfg; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
264 |
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
|
265 cfg.func = fmt->name; |
1712 | 266 cfg.type = DM_COMP_RLE_MARKER; |
267 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_2; | |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
268 cfg.rleMarkerB = fmt->size; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
269 |
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
270 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
|
271 goto out; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
272 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
273 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
|
274 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
275 out: |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
276 dmGrowBufFree(&mem); |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
277 return res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
278 } |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
279 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
280 |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
281 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
|
282 { |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
283 int res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
284 DMGrowBuf tmp; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
285 DMCompParams cfg; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
286 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
287 // Encode the data to temp buffer |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
288 if ((res = dmC64EncodeGenericBMP(TRUE, &tmp, img, fmt)) != DMERR_OK) |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
289 goto out; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
290 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
291 // 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
|
292 cfg.func = fmt->name; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
293 cfg.type = DM_COMP_RLE_MARKER; |
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
294 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_2; |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
295 cfg.rleMarkerB = fmt->size; |
1855
5e33f367bafe
Adjust the minimum byte run RLE counts from 3 to 4.
Matti Hamalainen <ccr@tnsp.org>
parents:
1854
diff
changeset
|
296 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
297 cfg.rleMaxCountB = 255; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
298 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
|
299 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
300 out: |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
301 dmGrowBufFree(&tmp); |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
302 return res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
303 } |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
304 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
305 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
306 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
|
307 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
308 const Uint8 *ident = buf->data + 2; |
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
309 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
|
310 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
|
311 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
|
312 ident[11] == '.' && ( |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
313 (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
|
314 (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
|
315 )) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
316 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
|
317 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
318 return DM_PROBE_SCORE_FALSE; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
319 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
320 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
321 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
322 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
|
323 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
324 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
325 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
|
326 DMCompParams cfg; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
327 |
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
|
328 cfg.func = fmt->name; |
1712 | 329 cfg.type = DM_COMP_RLE_MARKER; |
330 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; | |
331 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
|
332 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
333 if ((res = dmDecodeGenericRLEAlloc(&mem, |
1747
5e928618fdc8
Change DMGrowBuf API somewhat and implement more copy operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
1746
diff
changeset
|
334 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
|
335 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
336 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
337 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
|
338 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
339 out: |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
340 dmGrowBufFree(&mem); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
341 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
342 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
343 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
344 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
345 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
|
346 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
347 int res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
348 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
|
349 DMCompParams cfg; |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
350 const char *magicID = (fmt->format->type & 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
|
351 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
352 // Encode the data to temp buffer |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
353 if ((res = dmC64EncodeGenericBMP(TRUE, &tmp, img, fmt)) != DMERR_OK) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
354 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
355 |
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
|
356 // 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
|
357 cfg.func = fmt->name; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
358 cfg.type = DM_COMP_RLE_MARKER; |
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
359 cfg.flags = DM_RLE_BYTE_RUNS | DM_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
|
360 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
361 cfg.rleMaxCountB = 255; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
362 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
363 dmGenericRLEAnalyze(&tmp, &cfg); |
1661
dc3fbd130db7
RLE analyze was ran before setting up the compression config. Oops. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1660
diff
changeset
|
364 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
365 // 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
|
366 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
|
367 !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
|
368 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
369 res = DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
370 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
371 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
372 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
373 // 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
|
374 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
|
375 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
376 out: |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
377 dmGrowBufFree(&tmp); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
378 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
379 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
380 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
381 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
382 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
|
383 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
384 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
|
385 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
|
386 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
|
387 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
|
388 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
389 return DM_PROBE_SCORE_FALSE; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
390 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
391 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
392 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
393 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
|
394 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
|
395 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
396 (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
|
397 |
2186
dc8a443accdf
Simplify fmtDrazLaceGetLaceType() as the buffer can't be NULL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2185
diff
changeset
|
398 img->laceType = 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
|
399 return DMERR_OK; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
400 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
401 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
402 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
403 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
|
404 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) |
1535 | 405 { |
406 (void) fmt; | |
407 buf->data[op->offs] = (img->laceType == 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
|
408 return DMERR_OK; |
1535 | 409 } |
410 | |
411 | |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
412 static int fmtGetPixelDrazLace(Uint8 *col, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
413 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
|
414 { |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
415 const int |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
416 x = rasterX / 8, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
417 y = rasterY / 8, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
418 yoffs = y * img->fmt->chWidth, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
419 bmoffs = yoffs * 8 + (rasterY & 7) + (x * 8), |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
420 scroffs = yoffs + x, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
421 vshift = 6 - (rasterX & 6); |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
422 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
423 return dmC64GetGenericMCPixel(col, img, |
2133 | 424 bmoffs, scroffs, |
425 vshift, 0, | |
426 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
|
427 } |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
428 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
429 |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
430 static const char *fmtBDP5_MagicID = "BDP 5.00"; |
1662 | 431 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
432 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
|
433 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
434 if (buf->len > 20 && |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
435 dmCompareAddr16(buf, 0, fmt->addr) && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
436 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
|
437 return DM_PROBE_SCORE_MAX; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
438 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
439 return DM_PROBE_SCORE_FALSE; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
440 } |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
441 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
442 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
443 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
|
444 { |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
445 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
446 DMGrowBuf mem, tmp; |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
447 DMCompParams cfg; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
448 |
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
|
449 cfg.func = fmt->name; |
1712 | 450 cfg.type = DM_COMP_RLE_MARKER; |
451 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_WORD_RUNS | DM_RLE_ORDER_1; | |
452 cfg.rleMarkerB = buf->data[8]; | |
453 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
|
454 |
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
|
455 // 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
|
456 // 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
|
457 // 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
|
458 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
|
459 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
|
460 |
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
|
461 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
|
462 |
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
|
463 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
|
464 goto out; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
465 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
466 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
|
467 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
468 out: |
1792
905c09049fe6
Oops, forgot to free the buffer allocated in the BDP5 decoder. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1791
diff
changeset
|
469 dmGrowBufFree(&tmp); |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
470 dmGrowBufFree(&mem); |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
471 return res; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
472 } |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
473 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
474 |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
475 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
|
476 { |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
477 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
478 DMGrowBuf mem; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
479 DMCompParams cfg; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
480 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
481 // Encode the data to temp buffer |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
482 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
|
483 goto out; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
484 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
485 // 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
|
486 cfg.func = fmt->name; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
487 cfg.type = DM_COMP_RLE_MARKER; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
488 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_WORD_RUNS | DM_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
|
489 cfg.rleMinCountB = 4; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
490 cfg.rleMaxCountB = 255; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
491 cfg.rleMinCountW = 256; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
492 cfg.rleMaxCountW = 1024; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
493 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
494 dmGenericRLEAnalyze(&mem, &cfg); |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
495 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
496 // Add the header bits |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
497 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
|
498 !dmGrowBufPutU8(buf, cfg.rleMarkerB) || |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
499 !dmGrowBufPutU8(buf, cfg.rleMarkerW)) |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
500 { |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
501 res = DMERR_MALLOC; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
502 goto out; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
503 } |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
504 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
505 // 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
|
506 res = dmEncodeGenericRLE(buf, &mem, &cfg); |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
507 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
508 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
509 dmGrowBufFree(&mem); |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
510 return res; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
511 } |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
512 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
513 |
2185
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
514 static const char *fmtGunPaint_MagicID = "GUNPAINT (JZ) "; |
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
515 #define fmtGunPaint_MagicLen (16) |
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
516 #define fmtGunPaint_MagicOffs (0x03e8) |
1776
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
517 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
518 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
|
519 { |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
520 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
|
521 dmCompareAddr16(buf, 0, fmt->addr) && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
522 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
|
523 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
|
524 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
525 return DM_PROBE_SCORE_FALSE; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
526 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
527 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
528 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
529 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
|
530 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) |
1776
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
531 { |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
532 (void) op; |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
533 (void) img; |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
534 (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
|
535 |
1946 | 536 // Here we assume that the op triggering this function is |
537 // 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
|
538 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
|
539 |
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
540 return DMERR_OK; |
1776
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
541 } |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
542 |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
543 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
544 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
|
545 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
546 size_t i, n; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
547 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
548 if (buf->len < 256 || !dmCompareAddr16(buf, 0, fmt->addr)) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
549 return DM_PROBE_SCORE_FALSE; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
550 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
551 // 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
|
552 // as do some GunPaint images .. |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
553 if (buf->len == 9002 || |
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
554 fmtProbeGunPaint(buf, fmt) > DM_PROBE_SCORE_GOOD) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
555 return DM_PROBE_SCORE_FALSE; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
556 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
557 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
|
558 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
|
559 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
560 if (n > 50) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
561 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
|
562 if (n > 25) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
563 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
|
564 if (n > 10) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
565 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
|
566 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
567 return DM_PROBE_SCORE_FALSE; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
568 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
569 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
570 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
571 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
|
572 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
573 int res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
574 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
|
575 DMCompParams cfg; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
576 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
577 // 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
|
578 // 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
|
579 if (dmGrowBufCopy(&tmp, buf, 1) == NULL) |
768fddda73e9
Convert fmtDecodeAmicaPaintPacked() to use the new DMGrowBuf functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1749
diff
changeset
|
580 return DMERR_MALLOC; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
581 |
1751
768fddda73e9
Convert fmtDecodeAmicaPaintPacked() to use the new DMGrowBuf functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1749
diff
changeset
|
582 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
|
583 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
584 // 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
|
585 cfg.func = fmt->name; |
1712 | 586 cfg.type = DM_COMP_RLE_MARKER; |
587 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; | |
588 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
|
589 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
590 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
|
591 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
592 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
593 // 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
|
594 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
|
595 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
596 out: |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
597 dmGrowBufFree(&tmp); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
598 dmGrowBufFree(&mem); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
599 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
600 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
601 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
602 |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
603 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
|
604 { |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
605 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
606 DMGrowBuf mem; |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
607 DMCompParams cfg; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
608 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
609 // Encode the data to temp buffer |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
610 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
|
611 goto out; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
612 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
613 // 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
|
614 cfg.func = fmt->name; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
615 cfg.type = DM_COMP_RLE_MARKER; |
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
616 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; |
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
617 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
|
618 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
619 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
|
620 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
621 res = dmEncodeGenericRLE(buf, &mem, &cfg); |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
622 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
623 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
624 dmGrowBufFree(&mem); |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
625 return res; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
626 } |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
627 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
628 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
629 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
|
630 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
631 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
|
632 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
|
633 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
|
634 |
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
635 return DM_PROBE_SCORE_FALSE; |
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
636 } |
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
637 |
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
638 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
639 static int fmtGetPixelFLIDesigner(Uint8 *col, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
640 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
|
641 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
642 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
|
643 |
2133 | 644 return dmC64GetGenericMCPixel(col, img, |
645 bmoffs, scroffs, | |
646 vshift, rasterY & 7, | |
647 0, 0, img->bgcolor); | |
1806
dcb12cd340d3
Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1805
diff
changeset
|
648 } |
dcb12cd340d3
Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1805
diff
changeset
|
649 |
dcb12cd340d3
Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1805
diff
changeset
|
650 |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
651 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
|
652 { |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
653 if (buf->len > 16 && |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
654 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
|
655 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
|
656 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
|
657 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
|
658 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
659 return DM_PROBE_SCORE_FALSE; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
660 } |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
661 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
662 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
663 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
|
664 { |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
665 int res; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
666 DMGrowBuf dst, src; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
667 DMCompParams cfg; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
668 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
669 cfg.func = fmt->name; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
670 cfg.type = DM_COMP_RLE_MARKER; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
671 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1 | DM_RLE_ZERO_COUNT_MAX | |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
672 DM_RLE_BACKWARDS_INPUT | DM_RLE_BACKWARDS_OUTPUT | DM_OUT_CROP_END; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
673 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
|
674 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
|
675 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
676 // 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
|
677 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
|
678 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
679 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
|
680 goto out; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
681 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
682 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
|
683 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
684 out: |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
685 dmGrowBufFree(&dst); |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
686 return res; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
687 } |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
688 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
689 |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
690 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
|
691 { |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
692 int res; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
693 DMGrowBuf tmp1, tmp2; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
694 DMCompParams cfg; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
695 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
696 dmGrowBufInit(&tmp1); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
697 dmGrowBufInit(&tmp2); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
698 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
699 // Encode the data to temp buffer |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
700 if ((res = dmC64EncodeGenericBMP(TRUE, &tmp1, img, fmt)) != DMERR_OK) |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
701 goto out; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
702 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
703 // 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
|
704 cfg.func = fmt->name; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
705 cfg.type = DM_COMP_RLE_MARKER; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
706 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1 | DM_RLE_ZERO_COUNT_MAX | |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
707 DM_RLE_BACKWARDS_INPUT | DM_RLE_BACKWARDS_OUTPUT; |
1855
5e33f367bafe
Adjust the minimum byte run RLE counts from 3 to 4.
Matti Hamalainen <ccr@tnsp.org>
parents:
1854
diff
changeset
|
708 cfg.rleMinCountB = 4; |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
709 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
|
710 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
711 dmGenericRLEAnalyze(&tmp1, &cfg); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
712 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
713 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
|
714 goto out; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
715 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
716 // 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
|
717 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
|
718 !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
|
719 !dmGrowBufPutU16LE(buf, 0x7f3f) || |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
720 !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
|
721 { |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
722 res = DMERR_MALLOC; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
723 goto out; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
724 } |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
725 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
726 out: |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
727 dmGrowBufFree(&tmp1); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
728 dmGrowBufFree(&tmp2); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
729 return res; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
730 } |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
731 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
732 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
733 static int fmtGetPixelBlackMailFLI(Uint8 *col, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
734 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
|
735 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
736 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
|
737 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
738 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
|
739 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
|
740 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
741 return dmC64GetGenericMCPixel(col, img, |
2133 | 742 bmoffs, scroffs, |
743 vshift, rasterY & 7, | |
744 0, 0, bgcol & 15); | |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
745 } |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
746 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
747 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
748 static int fmtTruePaintGetLaceType(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
|
749 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
|
750 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
751 (void) op; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
752 (void) buf; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
753 (void) fmt; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
754 img->laceType = D64_ILACE_RES; |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
755 return DMERR_OK; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
756 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
757 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
758 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
759 static int fmtGetPixelTruePaint(Uint8 *col, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
760 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
|
761 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
762 const int |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
763 x = rasterX / 8, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
764 y = rasterY / 8, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
765 yoffs = y * img->fmt->chWidth, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
766 bmoffs = yoffs * 8 + (rasterY & 7) + (x * 8), |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
767 scroffs = yoffs + x, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
768 vshift = 6 - (rasterX & 6); |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
769 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
770 return dmC64GetGenericMCPixel(col, img, |
2133 | 771 bmoffs, scroffs, |
772 vshift, 0, | |
773 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
|
774 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
775 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
776 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
777 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
|
778 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
779 // 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
|
780 // relocation of decompression code |
1684 | 781 static const Uint8 magicID[] = { |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
782 0x0b, 0x08, 0x09, 0x00, 0x9e, 0x32, 0x30, 0x35, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
783 0x39, 0x00, 0xa2, 0x00, 0x78, 0xbd, 0x1c, 0x08, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
784 0x9d, 0xf5, 0x00, 0xe8, 0xd0, 0xf7, 0xe6, 0x01, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
785 0x4c, 0x01, 0x01, 0xa5, 0xfe, 0xd0, 0x02, 0xc6, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
786 0xff, 0xc6, 0xfe |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
787 }; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
788 |
1789
9f5c5ab0e85e
Adjust True Paint probing to be slightly more forgiving vs. file size.
Matti Hamalainen <ccr@tnsp.org>
parents:
1788
diff
changeset
|
789 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
|
790 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
|
791 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
|
792 return DM_PROBE_SCORE_MAX; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
793 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
794 return DM_PROBE_SCORE_FALSE; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
795 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
796 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
797 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
798 // |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
799 // 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
|
800 // 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
|
801 // simplistic "codebook". |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
802 // |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
803 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
|
804 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
805 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
|
806 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
807 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
|
808 "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
|
809 } |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
810 else |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
811 return DMERR_OK; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
812 } |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
813 |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
814 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
815 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
|
816 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
817 int res = DMERR_OK; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
818 const Uint8 *codeBook1, *codeBook2; |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
819 DMGrowBuf dst, src; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
820 DMCompParams cfg; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
821 Uint8 data; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
822 |
1724 | 823 // 1b7e-67e8 decoded by original depacker |
824 // 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
|
825 cfg.func = fmt->name; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
826 cfg.type = DM_COMP_RLE_MARKER; |
1724 | 827 cfg.flags = DM_RLE_BACKWARDS_OUTPUT | DM_RLE_BACKWARDS_INPUT | DM_OUT_CROP_END; |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
828 cfg.rleMarkerB = 0xfe; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
829 cfg.cropOutLen = 0x67e8 - 0x1c00; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
830 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
831 // 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
|
832 codeBook1 = psrc->data + 0x81 - 2; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
833 codeBook2 = psrc->data + 0x85 - 2; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
834 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
835 // Allocate output buffer |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
836 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
|
837 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
838 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
839 // 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
|
840 // 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
|
841 dmGrowBufConstCopy(&src, psrc); |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
842 dmSetupRLEBuffers(&dst, &src, &cfg); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
843 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
844 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
|
845 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
846 unsigned int count = 1; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
847 BOOL found = FALSE; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
848 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
849 for (int n = 0; n < 8; n++) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
850 if (codeBook1[n] == data && !found) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
851 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
852 found = TRUE; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
853 switch (n) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
854 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
855 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
|
856 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
|
857 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
858 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
859 count = data; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
860 if (data == 0) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
861 goto finish; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
862 |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
863 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
864 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
865 case 1: // Y = 1, JTO = $17 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
866 count += 2; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
867 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
868 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
869 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
|
870 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
|
871 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
872 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
873 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
874 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
|
875 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
|
876 goto out; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
877 |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
878 count = data; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
879 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
880 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
881 case 3: // Y = 3, JTO = $0B |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
882 count += 2; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
883 data = 0; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
884 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
885 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
886 default: // Y = [5..8], JTO = $00 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
887 count++; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
888 data = codeBook2[n]; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
889 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
890 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
891 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
892 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
893 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
|
894 goto out; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
895 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
896 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
897 finish: |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
898 dmFinishRLEBuffers(&dst, &src, &cfg); |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
899 res = dmC64DecodeGenericBMP(img, &dst, fmt); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
900 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
901 out: |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
902 dmGrowBufFree(&dst); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
903 return res; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
904 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
905 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
906 |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
907 #define XX2_MIN_SIZE 4000 |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
908 #define XX2_WIDTH_CH 40 |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
909 #define XX2_HEIGHT_CH 10 |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
910 #define XX2_SIZE (XX2_WIDTH_CH * XX2_HEIGHT_CH) |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
911 #define XX2_BSIZE (XX2_SIZE * 8) |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
912 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
913 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
914 static int fmtProbeFormatXX2(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
|
915 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
916 if (buf->len >= XX2_MIN_SIZE && |
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
917 buf->len <= XX2_MIN_SIZE + 8 && |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
918 dmCompareAddr16(buf, 0, fmt->addr)) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
919 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
|
920 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
921 return DM_PROBE_SCORE_FALSE; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
922 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
923 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
924 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
925 static int fmtDecodeFormatXX2(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
|
926 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
927 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
928 DMGrowBuf tmp; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
929 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
930 // If there is only data for less than XX2_MIN_SIZE bytes, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
931 // allocate a buffer of that size and copy data there. |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
932 // Otherwise allocate len bytes. |
1748
9c4b3fecc510
Use the new DMGrowBuf functions in XX2 format buffer enlarging.
Matti Hamalainen <ccr@tnsp.org>
parents:
1747
diff
changeset
|
933 if (dmGrowBufCopy(&tmp, buf, buf->len < XX2_MIN_SIZE ? XX2_MIN_SIZE - buf->len : 0) == NULL) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
934 return DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
935 |
1748
9c4b3fecc510
Use the new DMGrowBuf functions in XX2 format buffer enlarging.
Matti Hamalainen <ccr@tnsp.org>
parents:
1747
diff
changeset
|
936 tmp.len = tmp.size; |
9c4b3fecc510
Use the new DMGrowBuf functions in XX2 format buffer enlarging.
Matti Hamalainen <ccr@tnsp.org>
parents:
1747
diff
changeset
|
937 res = dmC64DecodeGenericBMP(img, &tmp, fmt); |
9c4b3fecc510
Use the new DMGrowBuf functions in XX2 format buffer enlarging.
Matti Hamalainen <ccr@tnsp.org>
parents:
1747
diff
changeset
|
938 dmGrowBufFree(&tmp); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
939 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
940 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
941 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
942 |
1812
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
943 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
|
944 { |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
945 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
|
946 { |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
947 // Packed variant |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
948 if (fmt->size == 0 && |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
949 dmCompareAddr16(buf, 2, fmt->addr + buf->len - 3) && |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
950 dmCompareAddr16(buf, 4, 0x7ff2)) |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
951 return DM_PROBE_SCORE_MAX; |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
952 |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
953 // Unpacked variant |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
954 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
|
955 { |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
956 // 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
|
957 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
|
958 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
|
959 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
|
960 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
961 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
|
962 } |
1812
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
963 } |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
964 |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
965 return DM_PROBE_SCORE_FALSE; |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
966 } |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
967 |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
968 |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
969 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
|
970 { |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
971 int res; |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
972 DMGrowBuf tmp; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
973 Uint8 data, *dstBuf; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
974 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
|
975 const size_t dstSize = 0x8000 - baseAddr; |
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
|
976 size_t dstOffs, srcOffs, ncount; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
977 |
2149 | 978 // Allocate output buffer |
979 if ((dstBuf = dmMalloc0(dstSize)) == NULL) | |
980 { | |
981 return dmError(DMERR_MALLOC, | |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
982 "Could not allocate memory for RLE decoding buffer.\n"); |
2149 | 983 } |
984 | |
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
|
985 // 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
|
986 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
|
987 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
|
988 |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
989 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
|
990 { |
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
|
991 // Get one byte of data |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
992 data = psrc->data[srcOffs]; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
993 |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
994 // 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
|
995 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
|
996 { |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
997 // RLE run |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
998 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
|
999 { |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1000 res = dmError(DMERR_INVALID_DATA, |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1001 "RLE: Invalid data/out of data for run sequence.\n"); |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1002 goto out; |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1003 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1004 |
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
|
1005 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
|
1006 data = psrc->data[--srcOffs]; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1007 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1008 if (dstOffs < ncount) |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1009 goto finish; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1010 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1011 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
|
1012 |
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
|
1013 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
|
1014 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
|
1015 |
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
|
1016 srcOffs--; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1017 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1018 else |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1019 { |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1020 // 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
|
1021 ncount = data; |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1022 if (srcOffs < ncount) |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1023 ncount = srcOffs; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1024 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1025 if (dstOffs < ncount) |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1026 ncount = dstOffs; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1027 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1028 srcOffs -= ncount; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1029 dstOffs -= ncount - 1; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1030 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1031 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
|
1032 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
|
1033 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1034 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1035 |
2149 | 1036 finish: |
1037 | |
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
|
1038 // 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
|
1039 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
|
1040 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
|
1041 |
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
|
1042 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
|
1043 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
|
1044 |
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
|
1045 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
|
1046 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
|
1047 |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1048 dmGrowBufConstCreateFrom(&tmp, dstBuf, dstSize); |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1049 res = dmC64DecodeGenericBMP(img, &tmp, fmt); |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1050 |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1051 out: |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1052 dmFree(dstBuf); |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1053 return res; |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1054 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1055 |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1056 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1057 #define FUNPAINT2_HEADER_SIZE (0x10) |
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1058 static const char *fmtFunPaint2MagicID = "FUNPAINT (MT) "; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1059 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1060 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1061 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
|
1062 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1063 if (buf->len > 30 && |
2080
7e4087e2740d
Define macros DM_MEMCMP_SIZE() and DM_MEMCMP_LEN() as helpers.
Matti Hamalainen <ccr@tnsp.org>
parents:
2056
diff
changeset
|
1064 DM_MEMCMP_LEN(buf->data + 2, fmtFunPaint2MagicID) == 0) |
1777
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1065 { |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1066 // Unpacked variant |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1067 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
|
1068 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
|
1069 |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1070 // Packed variant |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1071 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
|
1072 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
|
1073 } |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1074 |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1075 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
|
1076 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1077 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1078 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1079 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
|
1080 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1081 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1082 DMGrowBuf tmp; |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1083 |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1084 // 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
|
1085 if (buf->data[14]) |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1086 { |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1087 DMGrowBuf mem; |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1088 DMCompParams cfg; |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1089 |
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
|
1090 cfg.func = fmt->name; |
1712 | 1091 cfg.type = DM_COMP_RLE_MARKER; |
1092 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; | |
1093 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
|
1094 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1095 dmGrowBufCopyOffs(&tmp, buf, FUNPAINT2_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
|
1096 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
|
1097 |
1598
b5e0f28f1842
Adjust Fun Paint 2 decoding now that the RLE decoding is fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1594
diff
changeset
|
1098 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
|
1099 &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
|
1100 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
|
1101 |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1102 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
|
1103 dmGrowBufFree(&tmp); |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1104 } |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1105 else |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1106 { |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1107 res = dmC64DecodeGenericBMP(img, dmGrowBufConstCopyOffs(&tmp, buf, FUNPAINT2_HEADER_SIZE), fmt); |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1108 } |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1109 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1110 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1111 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1112 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1113 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1114 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
|
1115 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1116 // Add the header bits |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1117 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || |
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
|
1118 !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
|
1119 !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
|
1120 return DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1121 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1122 return dmC64EncodeGenericBMP(FALSE, buf, img, fmt); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1123 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1124 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1125 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1126 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
|
1127 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1128 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1129 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
|
1130 DMCompParams cfg; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1131 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1132 // Encode the data to temp buffer |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1133 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
|
1134 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1135 |
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
|
1136 // 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
|
1137 cfg.func = fmt->name; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
1138 cfg.type = DM_COMP_RLE_MARKER; |
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
1139 cfg.flags = DM_RLE_BYTE_RUNS | DM_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
|
1140 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
1141 cfg.rleMaxCountB = 255; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1142 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1143 dmGenericRLEAnalyze(&mem, &cfg); |
1661
dc3fbd130db7
RLE analyze was ran before setting up the compression config. Oops. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1660
diff
changeset
|
1144 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1145 // Add the header bits |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1146 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || |
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
|
1147 !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
|
1148 !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
|
1149 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1150 res = DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1151 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1152 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1153 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1154 // 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
|
1155 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
|
1156 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1157 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1158 dmGrowBufFree(&mem); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1159 return res; |
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 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1162 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1163 static int fmtGetPixelFunPaint2(Uint8 *col, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1164 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
|
1165 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1166 const int |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1167 x = rasterX / 8, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1168 y = rasterY / 8, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1169 yb = rasterY & 7, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1170 yoffs = y * img->fmt->chWidth, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1171 bmoffs = yoffs * 8 + yb + (x * 8), |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1172 scroffs = yoffs + x, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1173 bitmap = rasterX & 1, |
2133 | 1174 vbank = yb + (bitmap * 8), |
1175 vshift = 6 - (rasterX & 6); | |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1176 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1177 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
|
1178 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
|
1179 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1180 return dmC64GetGenericMCPixel(col, img, |
2133 | 1181 bmoffs, scroffs, |
1182 vshift, vbank, | |
1183 bitmap, 0, bgcol & 15); | |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1184 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1185 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1186 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1187 static int fmtGetPixelBFLI(Uint8 *col, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1188 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
|
1189 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1190 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
1857
5d9dd663df8d
Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1856
diff
changeset
|
1191 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
|
1192 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
|
1193 |
2133 | 1194 return dmC64GetGenericMCPixel(col, img, |
1195 bmoffs & 0x1fff, scroffs & 0x3ff, | |
1196 vshift, vbank, | |
1197 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
|
1198 } |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1199 |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1200 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1201 static int fmtGetPixelPentelPaint(Uint8 *col, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1202 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
|
1203 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1204 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
2163 | 1205 const int spr_y = rasterY / D64_SPR_HEIGHT_PX; |
1206 const int spr_yd = rasterY % D64_SPR_HEIGHT_PX; | |
1207 const int spr_x = rasterX / D64_SPR_WIDTH_PX; | |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
1208 const int spr_xd = (rasterX % D64_SPR_WIDTH_PX) / 8; |
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
1209 const int offs = (spr_y * 8 + spr_x) * D64_SPR_SIZE + (spr_yd * D64_SPR_WIDTH_UT) + spr_xd; |
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
|
1210 const int mask = 1 << (7 - (rasterX & 7)); |
2163 | 1211 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
|
1212 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1213 Uint8 color1, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1214 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
|
1215 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
|
1216 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1217 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
|
1218 return res; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1219 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1220 *col = color3 ? color3 : ( color2 ? color2 : color1 ); |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1221 return DMERR_OK; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1222 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1223 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1224 |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1225 static const Uint8 fmtCrestSHFLI_MagicID_1[] = |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1226 { |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1227 0x80, 0x84, 0x85, 0x89, 0x8A, 0x8E, 0x8F, 0x93 |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1228 }; |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1229 |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1230 |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1231 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
|
1232 { |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1233 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
|
1234 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
|
1235 { |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1236 if (DM_MEMCMP_SIZE(buf->data + 0x03f8 + 2, fmtCrestSHFLI_MagicID_1) == 0) |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1237 return DM_PROBE_SCORE_MAX; |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1238 else |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1239 return DM_PROBE_SCORE_MAYBE; |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1240 } |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1241 |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1242 return DM_PROBE_SCORE_FALSE; |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1243 } |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1244 |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1245 |
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
|
1246 static int fmtGetSpritePixelCrestSHFLI(Uint8 *col, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1247 const DMC64Image *img, const int sindex, const int cindex, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1248 const int spr_xd, const int spr_yd, const int 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
|
1249 { |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1250 const size_t offs = sindex * D64_SPR_SIZE + (D64_SPR_WIDTH_UT * spr_yd) + spr_xd; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1251 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1252 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
|
1253 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
|
1254 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1255 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
|
1256 { |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1257 *col = img->extraData[15].data[cindex]; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1258 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
|
1259 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1260 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1261 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
|
1262 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1263 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1264 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1265 static int fmtGetPixelCrestSHFLI(Uint8 *col, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1266 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
|
1267 { |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1268 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1269 const int sprOffsetX = 112, sprOffsetY = 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
|
1270 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
|
1271 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
|
1272 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1273 if (rasterY / 8 >= img->fmt->chHeight) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1274 { |
2178
e1b7c021db8a
Default the Crest Super Hires FLI background to 0x0F for the unused bottom
Matti Hamalainen <ccr@tnsp.org>
parents:
2174
diff
changeset
|
1275 *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
|
1276 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
|
1277 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1278 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1279 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
|
1280 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
|
1281 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
|
1282 { |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1283 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
|
1284 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
|
1285 const int sbank = localY & 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
|
1286 const int spr_yd = localY % D64_SPR_HEIGHT_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
|
1287 const int spr_x = localX / 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
|
1288 const int spr_xd = (localX % D64_SPR_WIDTH_PX) / 8; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1289 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
|
1290 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1291 const int spr_offs = spr_x & 3; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1292 const int spr_index1 = img->extraData[sbank].data[spr_offs]; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1293 const int spr_index2 = img->extraData[sbank].data[spr_offs + 4]; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1294 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1295 if ((res = fmtGetSpritePixelCrestSHFLI(col, img, spr_index1, 0, spr_xd, spr_yd, mask)) == 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
|
1296 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
|
1297 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
|
1298 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1299 if ((res = fmtGetSpritePixelCrestSHFLI(col, img, spr_index2, 1, spr_xd, spr_yd, mask)) == 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
|
1300 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
|
1301 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
|
1302 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1303 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1304 if ((res = dmC64GetGenericSCPixel(col, img, bmoffs, scroffs, vshift, nbank, 0)) != 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
|
1305 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
|
1306 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1307 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
|
1308 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1309 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1310 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1311 static int fmtGetPixelHCB(Uint8 *col, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1312 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
|
1313 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1314 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
|
1315 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
|
1316 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
|
1317 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1318 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
|
1319 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
|
1320 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1321 return dmC64GetGenericMCPixel(col, img, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1322 bmoffs, scroffs, |
2133 | 1323 vshift, vbank, |
1324 0, vbank, bgcol & 15); | |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
1325 } |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
1326 |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
1327 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1328 static int fmtGetPixelCrestHIFLIorCDHM(Uint8 *col, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1329 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
|
1330 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1331 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
2133 | 1332 |
1333 return dmC64GetGenericSCPixel(col, img, | |
1334 bmoffs, scroffs, | |
1335 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
|
1336 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1337 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1338 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
1339 static int fmtECIGetLaceType(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
|
1340 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
1734
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1341 { |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1342 (void) op; |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1343 (void) buf; |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1344 (void) fmt; |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1345 img->laceType = 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
|
1346 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
|
1347 } |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1348 |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1349 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1350 static int fmtGetPixelECI(Uint8 *col, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1351 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
|
1352 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1353 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
|
1354 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
|
1355 Uint8 color1, color2; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1356 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
|
1357 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1358 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
|
1359 (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
|
1360 return res; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1361 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1362 *col = (color1 * D64_NCOLORS) + color2; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1363 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
|
1364 } |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1365 |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1366 |
1931
410679d2fe8a
"Enable" the image->c64 bitmap conversion path in gfxconv. It does not work
Matti Hamalainen <ccr@tnsp.org>
parents:
1930
diff
changeset
|
1367 static int fmtConvertECIBMP2Image(DMImage *dst, const DMC64Image *src, |
410679d2fe8a
"Enable" the image->c64 bitmap conversion path in gfxconv. It does not work
Matti Hamalainen <ccr@tnsp.org>
parents:
1930
diff
changeset
|
1368 const DMC64ImageFormat *fmt, const DMC64ImageConvSpec *spec) |
1734
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1369 { |
2127
c1a9519a619f
Fix ECI palette setting, return value of dmSetMixedColorC64Palette() had
Matti Hamalainen <ccr@tnsp.org>
parents:
2125
diff
changeset
|
1370 int res; |
2170 | 1371 |
2127
c1a9519a619f
Fix ECI palette setting, return value of dmSetMixedColorC64Palette() had
Matti Hamalainen <ccr@tnsp.org>
parents:
2125
diff
changeset
|
1372 if ((res = dmSetMixedColorC64Palette(dst)) != DMERR_OK) |
c1a9519a619f
Fix ECI palette setting, return value of dmSetMixedColorC64Palette() had
Matti Hamalainen <ccr@tnsp.org>
parents:
2125
diff
changeset
|
1373 return 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
|
1374 |
1931
410679d2fe8a
"Enable" the image->c64 bitmap conversion path in gfxconv. It does not work
Matti Hamalainen <ccr@tnsp.org>
parents:
1930
diff
changeset
|
1375 return dmC64ConvertGenericBMP2Image(dst, src, fmt, spec); |
1734
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1376 } |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1377 |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1378 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1379 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
|
1380 { |
2168
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1381 int score = DM_PROBE_SCORE_FALSE; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1382 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1383 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
|
1384 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
|
1385 { |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1386 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
|
1387 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1388 // 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
|
1389 // 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
|
1390 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
|
1391 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
|
1392 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1393 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
|
1394 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
|
1395 else |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1396 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
|
1397 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
|
1398 else |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1399 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
|
1400 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
|
1401 } |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1402 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1403 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
|
1404 buf->len == 16386 || |
1979
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
1405 // Face Painter |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
1406 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
|
1407 score /= 3; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1408 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1409 return score; |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1410 } |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1411 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1412 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1413 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
|
1414 { |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1415 int res; |
2170 | 1416 DMGrowBuf mem, tmp; |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1417 DMCompParams cfg; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1418 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1419 cfg.func = fmt->name; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1420 cfg.type = DM_COMP_RLE_MARKER; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1421 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1422 cfg.rleMarkerB = buf->data[0]; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1423 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1424 if ((res = dmDecodeGenericRLEAlloc( |
1747
5e928618fdc8
Change DMGrowBuf API somewhat and implement more copy operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
1746
diff
changeset
|
1425 &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
|
1426 res = dmC64DecodeGenericBMP(img, &mem, fmt); |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1427 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1428 dmGrowBufFree(&mem); |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1429 return res; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1430 } |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1431 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1432 |
1912
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1433 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
|
1434 { |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1435 int res; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1436 DMGrowBuf tmp; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1437 DMCompParams cfg; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1438 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1439 // Encode the data to temp buffer |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1440 if ((res = dmC64EncodeGenericBMP(TRUE, &tmp, img, fmt)) != DMERR_OK) |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1441 goto out; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1442 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1443 // 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
|
1444 cfg.func = fmt->name; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1445 cfg.type = DM_COMP_RLE_MARKER; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1446 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1447 cfg.rleMinCountB = 4; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1448 cfg.rleMaxCountB = 255; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1449 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1450 dmGenericRLEAnalyze(&tmp, &cfg); |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1451 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1452 // 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
|
1453 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
|
1454 { |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1455 res = DMERR_MALLOC; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1456 goto out; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1457 } |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1458 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1459 // 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
|
1460 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
|
1461 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1462 out: |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1463 dmGrowBufFree(&tmp); |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1464 return res; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1465 } |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1466 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1467 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1468 // |
1795
c8d690e8f9e9
Fix some typos in comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
1792
diff
changeset
|
1469 // Helper macros for defining screen memory layouts |
c8d690e8f9e9
Fix some typos in comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
1792
diff
changeset
|
1470 // 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
|
1471 // |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1472 #define DEF_REPEAT_BLOCK(dtype, start, oindex, bindex, osize, bsize) \ |
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1473 { DO_COPY, (dtype), (start) + ((osize) * (oindex)), (bindex), (bsize), 0, NULL, NULL } |
2033 | 1474 |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1475 #define DEF_REPEAT_BLOCK_8(dtype, start, sindex, osize, bsize) \ |
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1476 DEF_REPEAT_BLOCK((dtype), (start), 0, (sindex + 0), (osize), (bsize)), \ |
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1477 DEF_REPEAT_BLOCK((dtype), (start), 1, (sindex + 1), (osize), (bsize)), \ |
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1478 DEF_REPEAT_BLOCK((dtype), (start), 2, (sindex + 2), (osize), (bsize)), \ |
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1479 DEF_REPEAT_BLOCK((dtype), (start), 3, (sindex + 3), (osize), (bsize)), \ |
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1480 DEF_REPEAT_BLOCK((dtype), (start), 4, (sindex + 4), (osize), (bsize)), \ |
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1481 DEF_REPEAT_BLOCK((dtype), (start), 5, (sindex + 5), (osize), (bsize)), \ |
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1482 DEF_REPEAT_BLOCK((dtype), (start), 6, (sindex + 6), (osize), (bsize)), \ |
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1483 DEF_REPEAT_BLOCK((dtype), (start), 7, (sindex + 7), (osize), (bsize)) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1484 |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1485 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1486 // |
1861 | 1487 // Many formats actually share memory layout and other specs, and there are |
1488 // packed and unpacked versions of several formats. We'll reuse these here | |
1489 // 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
|
1490 // |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1491 DMC64ImageCommonFormat dmC64CommonFormats[] = |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1492 { |
1815
2b68b6955635
Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents:
1813
diff
changeset
|
1493 { // #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
|
1494 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1495 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1496 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
|
1497 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
|
1498 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1499 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1500 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1501 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1502 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1503 { DO_COPY , DS_COLOR_RAM , 0x2328, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1504 { DO_SET_MEM_LO , DS_BGCOL , 0x2710, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1505 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1506 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1507 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1508 |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1509 { // #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
|
1510 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1511 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1512 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
|
1513 2, 1, |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1514 NULL, NULL, |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1515 fmtGetPixelBlackMailFLI, |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1516 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1517 { DO_COPY , DS_EXTRA_DATA , 0x0000, 0, 200, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1518 { DO_COPY , DS_COLOR_RAM , 0x0100, 0, 0, 0, NULL, NULL }, |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1519 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x0500, 0, 0x400, 0), |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1520 { DO_COPY , DS_BITMAP_RAM , 0x2500, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1521 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1522 } |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1523 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1524 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1525 { // #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
|
1526 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1527 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1528 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
|
1529 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
|
1530 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1531 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1532 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1533 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1534 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1535 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1536 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1537 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1538 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1539 { // #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
|
1540 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
|
1541 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1542 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
|
1543 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
|
1544 NULL, NULL, |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1545 fmtGetPixelFunPaint2, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1546 { |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1547 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x0000, 0, 0x400, 0), |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1548 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL }, |
1854
31c9884321b1
Fix Fun Paint 2 raster colours.
Matti Hamalainen <ccr@tnsp.org>
parents:
1850
diff
changeset
|
1549 { DO_COPY , DS_EXTRA_DATA , 0x3f48, 0, 100, 0, NULL, NULL }, |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1550 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL }, |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1551 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x43e8, 8, 0x400, 0), |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1552 { DO_COPY , DS_BITMAP_RAM , 0x63e8, 1, 0 , 0, NULL, NULL }, |
1847
e3d1f16be4ee
Using the newly introduced data block offset feature, unify the handling of
Matti Hamalainen <ccr@tnsp.org>
parents:
1846
diff
changeset
|
1553 { DO_COPY , DS_EXTRA_DATA , 0x8328, 0, 100, 100, NULL, NULL }, |
1922
3c6f638ce402
Remove the useless distinction of DO_ENC_FUNC and DO_DEC_FUNC, as the
Matti Hamalainen <ccr@tnsp.org>
parents:
1915
diff
changeset
|
1554 { DO_FUNC , 0 , 0 , 0, 1 , 0, fmtTruePaintGetLaceType, NULL }, |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1555 { DO_LAST , 0 , 0 , 0, 0 , 0, 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
|
1556 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1557 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1558 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1559 { // #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
|
1560 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1561 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1562 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
|
1563 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
|
1564 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1565 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1566 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1567 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1568 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1569 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1570 { DO_SET_MEM_LO , DS_BGCOL , 0x2740, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1571 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1572 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1573 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1574 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1575 { // #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
|
1576 D64_FMT_MC | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1577 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1578 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
|
1579 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
|
1580 NULL, NULL, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1581 fmtGetPixelDrazLace, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1582 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1583 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1584 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1585 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1586 { DO_SET_MEM_LO , DS_BGCOL , 0x2740, 0, 0, 0, NULL, NULL }, |
1922
3c6f638ce402
Remove the useless distinction of DO_ENC_FUNC and DO_DEC_FUNC, as the
Matti Hamalainen <ccr@tnsp.org>
parents:
1915
diff
changeset
|
1587 { DO_FUNC , 0 , 0x2742, 0, 1, 0, fmtDrazLaceGetLaceType, fmtDrazLaceSetLaceType }, |
1880 | 1588 { DO_COPY , DS_BITMAP_RAM , 0x2800, 1, 0, 0, NULL, NULL }, |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1589 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1590 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1591 }, |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1592 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1593 { // #6: TruePaint |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1594 D64_FMT_MC | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1595 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1596 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
|
1597 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
|
1598 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1599 fmtGetPixelTruePaint, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1600 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1601 { DO_COPY , DS_SCREEN_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1602 { DO_SET_MEM_LO , DS_BGCOL , 0x03e8, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1603 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1604 { DO_COPY , DS_BITMAP_RAM , 0x2400, 1, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1605 { DO_COPY , DS_SCREEN_RAM , 0x4400, 1, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1606 { DO_COPY , DS_COLOR_RAM , 0x4800, 0, 0, 0, NULL, NULL }, |
1922
3c6f638ce402
Remove the useless distinction of DO_ENC_FUNC and DO_DEC_FUNC, as the
Matti Hamalainen <ccr@tnsp.org>
parents:
1915
diff
changeset
|
1607 { DO_FUNC , 0 , 0x0000, 0, 0, 0, fmtTruePaintGetLaceType, NULL }, |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1608 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1609 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1610 }, |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1611 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1612 { // #7: ECI Graphic Editor Hires FLI |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1613 D64_FMT_HIRES | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1614 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1615 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
|
1616 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
|
1617 fmtConvertECIBMP2Image, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1618 fmtGetPixelECI, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1619 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1620 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1621 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x2000, 0, 0x400, 0), |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1622 { DO_COPY , DS_BITMAP_RAM , 0x4000, 1, 0, 0, NULL, NULL }, |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1623 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x6000, 8, 0x400, 0), |
1922
3c6f638ce402
Remove the useless distinction of DO_ENC_FUNC and DO_DEC_FUNC, as the
Matti Hamalainen <ccr@tnsp.org>
parents:
1915
diff
changeset
|
1624 { DO_FUNC , 0 , 0 , 0, 0, 0, fmtECIGetLaceType, NULL }, |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1625 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1626 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1627 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1628 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1629 { // #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
|
1630 D64_FMT_HIRES | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1631 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
|
1632 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
|
1633 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
|
1634 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1635 fmtGetPixelCrestHIFLIorCDHM, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1636 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1637 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1638 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x2000, 0, 0x400, 0), |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1639 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1640 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1641 }, |
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
|
1642 |
2018 | 1643 { // #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
|
1644 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1645 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1646 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
|
1647 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
|
1648 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
|
1649 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
|
1650 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1651 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
1652 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x0400, 0, 0x400, 0), |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1653 { DO_COPY , DS_BITMAP_RAM , 0x2400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1654 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, |
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
|
1655 } |
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
|
1656 }, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1657 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1658 { // #10: Doodle |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1659 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1660 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1661 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
|
1662 1, 1, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1663 NULL, NULL, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1664 NULL, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1665 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1666 { DO_COPY , DS_SCREEN_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1667 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1668 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1669 } |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1670 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1671 }; |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1672 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1673 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1674 // |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1675 // 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
|
1676 // |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1677 DMC64ImageFormat dmC64ImageFormats[] = |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1678 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1679 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1680 "d2p", "DrazPaint 1.4/2.0 (packed)", 0x5800, 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
|
1681 fmtProbeDrazPaint20Packed, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1682 fmtDecodeDrazPaintPacked, fmtEncodeDrazPaintPacked, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1683 { }, &dmC64CommonFormats[4] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1684 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1685 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1686 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1687 "drp", "DrazPaint (unpacked)", 0x5800, 10051, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1688 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1689 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
|
1690 { }, &dmC64CommonFormats[4] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1691 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1692 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1693 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1694 "dlp", "DrazLace 1.0 (packed)", 0x5800, 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
|
1695 fmtProbeDrazLace10Packed, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1696 fmtDecodeDrazPaintPacked, fmtEncodeDrazPaintPacked, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1697 { }, &dmC64CommonFormats[5] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1698 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1699 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1700 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1701 "drl", "DrazLace 1.0 (unpacked)", 0x5800, 18242, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1702 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1703 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
|
1704 { }, &dmC64CommonFormats[5] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1705 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1706 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1707 { |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1708 "bdp5", "Boogie Down Paint 5 (packed)", 0x5000, 0, DM_FMT_RDWR, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1709 fmtProbeBDP5Packed, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1710 fmtDecodeBDP5Packed, fmtEncodeBDP5Packed, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1711 { }, &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
|
1712 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1713 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1714 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1715 "vid", "Vidcom 64 (unpacked)", 0x5800, 10050, DM_FMT_RDWR, |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1716 NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1717 NULL, NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1718 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1719 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1720 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1721 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
|
1722 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
|
1723 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1724 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1725 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1726 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1727 { DO_SET_MEM_LO , DS_BGCOL , 0x07e8, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1728 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1729 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1730 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1731 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1732 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1733 NULL |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1734 }, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1735 |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1736 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1737 "p64", "Picasso 64 (unpacked)", 0x1800, 10050, DM_FMT_RDWR, |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1738 NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1739 NULL, NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1740 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1741 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1742 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1743 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
|
1744 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
|
1745 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1746 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1747 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1748 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1749 { DO_SET_MEM_LO , DS_BGCOL , 0x07fe, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1750 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1751 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1752 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1753 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1754 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1755 NULL |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1756 }, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1757 |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
1758 { |
1816
8d7b424197bc
Allow writing of unpacked True Paint format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1815
diff
changeset
|
1759 "mci", "Truepaint (unpacked)", 0x9c00, 19434, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1760 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1761 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
|
1762 { }, &dmC64CommonFormats[6] |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1763 }, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1764 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1765 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1766 "mcip", "Truepaint (packed)", 0x0801, 0, DM_FMT_RD, |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1767 fmtProbeTruePaintPacked, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1768 fmtDecodeTruePaintPacked, NULL, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1769 { }, &dmC64CommonFormats[6] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1770 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1771 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1772 { |
1815
2b68b6955635
Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents:
1813
diff
changeset
|
1773 "kla", "Koala Painter (unpacked)", 0x6000, 10003, 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
|
1774 fmtProbeKoalaPainter, |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1775 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
|
1776 { }, &dmC64CommonFormats[0] |
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 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1779 { |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
1780 "klp", "Koala Painter (packed)", 0x6000, 0xfe, DM_FMT_RDWR, // size is abused for RLE marker byte |
1815
2b68b6955635
Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents:
1813
diff
changeset
|
1781 fmtProbeKoalaPainterPacked, |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
1782 fmtDecodeStaticRLEMarkerMode2, fmtEncodeStaticRLEMarkerMode2, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1783 { }, &dmC64CommonFormats[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1784 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1785 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1786 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1787 "aas", "Advanced Art Studio (unpacked)", 0x2000, 10018, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1788 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1789 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1790 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1791 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1792 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1793 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
|
1794 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
|
1795 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1796 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1797 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1798 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1799 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1800 { DO_SET_MEM_LO , DS_D020 , 0x2328, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1801 { DO_SET_MEM_LO , DS_BGCOL , 0x2329, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1802 { DO_COPY , DS_COLOR_RAM , 0x2338, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1803 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1804 }, |
1593
a77876a07425
Oops, missed this from the last commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1592
diff
changeset
|
1805 }, |
a77876a07425
Oops, missed this from the last commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1592
diff
changeset
|
1806 NULL |
1503
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 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1810 "ims", "Image System MC (unpacked)", 0x3c00, 10218, DM_FMT_RDWR, |
1755
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
1811 NULL, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
1812 NULL, NULL, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
1813 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1814 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1815 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1816 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
|
1817 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
|
1818 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1819 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1820 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1821 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1822 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1823 { DO_SET_MEM_LO , DS_BGCOL , 0x23ff, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1824 { DO_COPY , DS_SCREEN_RAM , 0x2400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1825 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1826 } |
1755
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
1827 }, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
1828 NULL |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
1829 }, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
1830 |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
1831 { |
1985
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
1832 "mil", "Micro Illustrator (unpacked)", 0x18dc, 10022, 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
|
1833 fmtProbeMicroIllustrator, |
1758
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
1834 NULL, NULL, |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
1835 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1836 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1837 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1838 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
|
1839 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
|
1840 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1841 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1842 { |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
1843 { DO_COPY , DS_SCREEN_RAM , 20 + 0 , 0, 0, 0, NULL, NULL }, |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
1844 { DO_COPY , DS_COLOR_RAM , 20 + 1000 , 0, 0, 0, NULL, NULL }, |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
1845 { DO_COPY , DS_BITMAP_RAM , 20 + 2000 , 0, 0, 0, NULL, NULL }, |
1985
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
1846 // XXX TODO: Unknown where the background color is set, so default to 0x00 |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
1847 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL }, |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
1848 { DO_FUNC , 0 , 0 , 0, 0, 0, NULL, fmtEncodeMicroIllustrator }, |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
1849 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1850 } |
1758
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
1851 }, |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
1852 NULL |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
1853 }, |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
1854 |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
1855 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1856 "cdu", "CDU-Paint (unpacked)", 0x7eef, 10277, DM_FMT_RDWR, |
1754
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
1857 NULL, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
1858 NULL, NULL, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
1859 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1860 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1861 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1862 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
|
1863 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
|
1864 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1865 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1866 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1867 { DO_COPY , DS_BITMAP_RAM , 0x0000 + 0x111, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1868 { DO_COPY , DS_SCREEN_RAM , 0x1f40 + 0x111, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1869 { DO_COPY , DS_COLOR_RAM , 0x2328 + 0x111, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1870 { DO_SET_MEM_LO , DS_BGCOL , 0x2710 + 0x111, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1871 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1872 } |
1754
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
1873 }, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
1874 NULL |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
1875 }, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
1876 |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
1877 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1878 "rbp", "Rainbow Painter (unpacked)", 0x5c00, 10242, DM_FMT_RDWR | DM_FMT_BROKEN, |
1763
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
1879 NULL, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
1880 NULL, NULL, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
1881 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1882 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1883 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1884 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
|
1885 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
|
1886 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1887 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1888 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1889 { DO_COPY , DS_SCREEN_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1890 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1891 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, 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
|
1892 // XXX TODO: Not sure if the background color is hardcoded .. |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1893 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1894 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1895 } |
1763
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
1896 }, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
1897 NULL |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
1898 }, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
1899 |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
1900 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1901 "sar", "Saracen Paint (unpacked)", 0x7800, 10219, 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
|
1902 fmtProbeSaracenPaint, |
1769
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
1903 NULL, NULL, |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
1904 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1905 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1906 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1907 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
|
1908 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
|
1909 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1910 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1911 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1912 { DO_COPY , DS_SCREEN_RAM , 0x7800 - 0x7800, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1913 { DO_SET_MEM_LO , DS_BGCOL , 0x7bf0 - 0x7800, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1914 { DO_COPY , DS_BITMAP_RAM , 0x7c00 - 0x7800, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1915 { DO_COPY , DS_COLOR_RAM , 0x9c00 - 0x7800, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1916 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1917 } |
1769
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
1918 }, |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
1919 NULL |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
1920 }, |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
1921 |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
1922 { |
1980
2cf79254b8e4
Confirm the Blazing Paddles d020/bgcolor positions and remove the broken flag.
Matti Hamalainen <ccr@tnsp.org>
parents:
1979
diff
changeset
|
1923 "blp", "Blazing Paddles (unpacked)", 0xA000, 10242, DM_FMT_RDWR, |
1770
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
1924 NULL, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
1925 NULL, NULL, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
1926 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1927 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1928 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1929 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
|
1930 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
|
1931 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1932 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1933 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1934 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
1980
2cf79254b8e4
Confirm the Blazing Paddles d020/bgcolor positions and remove the broken flag.
Matti Hamalainen <ccr@tnsp.org>
parents:
1979
diff
changeset
|
1935 // Both d020 and bgcolor confirmed by tests |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1936 { DO_SET_MEM_LO , DS_D020 , 0x1f7f, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1937 { DO_SET_MEM_LO , DS_BGCOL , 0x1f80, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1938 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1939 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1940 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1941 } |
1770
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
1942 }, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
1943 NULL |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
1944 }, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
1945 |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
1946 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1947 "pmg", "Paint Magic crippled MC (unpacked)", 0x3f8e, 9332, 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
|
1948 NULL, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
1949 NULL, NULL, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
1950 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1951 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1952 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1953 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
|
1954 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
|
1955 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1956 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1957 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1958 { DO_COPY , DS_BITMAP_RAM , 0x4000 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1959 { DO_COPY , DS_SCREEN_RAM , 0x6000 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1960 { DO_SET_MEM_LO , DS_D020 , 0x5f40 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL }, |
1982
6af47b1009ba
Use DO_SET_MEM_LO where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
1980
diff
changeset
|
1961 { DO_SET_MEM_LO , DS_COLOR_RAM , 0x5f43 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL }, |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1962 { DO_SET_MEM_LO , DS_BGCOL , 0x5f44 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1963 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
1964 } |
1762
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
1965 }, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
1966 NULL |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
1967 }, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
1968 |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
1969 { |
1779
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1970 "a64", "Wigmore Artist 64 (unpacked)", 0x4000, 10242, DM_FMT_RDWR, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1971 NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1972 NULL, NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1973 { |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1974 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1975 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1976 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
|
1977 2, 1, |
1779
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1978 NULL, NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1979 NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1980 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1981 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1982 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1983 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1984 { DO_SET_MEM_LO , DS_D020 , 0x27fe, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1985 { DO_SET_MEM_LO , DS_BGCOL , 0x27ff, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
1986 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, |
1779
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1987 } |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1988 }, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1989 NULL |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1990 }, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1991 |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
1992 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1993 "ami", "Amica Paint (packed)", 0x4000, 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
|
1994 fmtProbeAmicaPaintPacked, |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
1995 fmtDecodeAmicaPaintPacked, fmtEncodeAmicaPaintPacked, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1996 { }, &dmC64CommonFormats[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1997 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1998 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1999 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2000 "rpm", "Run Paint (unpacked)", 0x6000, 10006, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2001 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2002 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
|
2003 { }, &dmC64CommonFormats[0] |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2004 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2005 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2006 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2007 "ipc", "Interpaint MC (unpacked)", 0x4000, 10003, 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
|
2008 NULL, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2009 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
|
2010 { }, &dmC64CommonFormats[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2011 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2012 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2013 { |
1819
c12bd223000e
Enable write support for some formats that should be workable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1816
diff
changeset
|
2014 "art", "Art Studio (unpacked)", 0x2000, 9009, DM_FMT_RDWR, |
2161
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
2015 fmtProbeArtStudio, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2016 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
|
2017 { }, &dmC64CommonFormats[2] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2018 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2019 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2020 { |
1819
c12bd223000e
Enable write support for some formats that should be workable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1816
diff
changeset
|
2021 "iph", "Interpaint (unpacked)", 0x4000, 9002, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2022 NULL, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2023 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2024 { }, &dmC64CommonFormats[2] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2025 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2026 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2027 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2028 "dd", "Doodle (unpacked)", 0x1c00, 9218, DM_FMT_RDWR, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2029 fmtProbeDoodle, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2030 NULL, NULL, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2031 { }, &dmC64CommonFormats[10] |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2032 }, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2033 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2034 { |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2035 "jj", "Doodle (packed)", 0x5c00, 0xfe, DM_FMT_RDWR, // size is abused for RLE marker byte |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2036 fmtProbeDoodle, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2037 fmtDecodeStaticRLEMarkerMode2, fmtEncodeStaticRLEMarkerMode2, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2038 { }, &dmC64CommonFormats[10] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2039 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2040 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2041 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2042 "mon", "Monomagic (unpacked)", 0x2000, 8194, DM_FMT_RDWR, |
1670
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2043 NULL, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2044 NULL, NULL, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2045 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2046 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2047 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2048 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
|
2049 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
|
2050 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2051 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2052 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2053 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2054 { DO_SET_OP , DS_SCREEN_RAM , 0xCF , 0, 0, 0, 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
|
2055 // Default colors used by MM are --^^ |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2056 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
2057 } |
1670
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2058 }, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2059 NULL |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2060 }, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2061 |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2062 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2063 "hir", "Plain hires (unpacked)", 0x2000, 8002, DM_FMT_RDWR, |
1671
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2064 NULL, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2065 NULL, NULL, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2066 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2067 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2068 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2069 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
|
2070 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
|
2071 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2072 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2073 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2074 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2075 { DO_SET_OP , DS_SCREEN_RAM , 0xF0 , 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2076 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
2077 } |
1671
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2078 }, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2079 NULL |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2080 }, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2081 |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2082 { |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2083 "gih", "Gigapaint hires (unpacked)", 0x6000, 8002, DM_FMT_RDWR, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2084 fmtProbeGigapaintHires, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2085 NULL, NULL, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2086 { |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2087 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2088 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2089 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
|
2090 1, 1, |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2091 NULL, NULL, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2092 NULL, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2093 { |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2094 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2095 { DO_SET_OP , DS_SCREEN_RAM , 0x0F , 0, 0, 0, NULL, NULL }, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2096 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2097 } |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2098 }, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2099 NULL |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2100 }, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2101 |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2102 { |
1857
5d9dd663df8d
Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1856
diff
changeset
|
2103 "bfli", "Pu-239 Big FLI/BFLI (unpacked)", 0x3bff, 33795, 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
|
2104 NULL, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
2105 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
|
2106 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2107 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2108 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT * 2, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2109 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
|
2110 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
|
2111 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2112 fmtGetPixelBFLI, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2113 { |
1857
5d9dd663df8d
Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1856
diff
changeset
|
2114 { DO_COPY , DS_COLOR_RAM , 0x0001, 0, 0x400 , 0, NULL, NULL }, |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
2115 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x0401, 0, 0x400, 0), |
1857
5d9dd663df8d
Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1856
diff
changeset
|
2116 { DO_COPY , DS_BITMAP_RAM , 0x2401, 0, 0x2000, 0, NULL, NULL }, |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
2117 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x4401, 8, 0x400, 0x400), |
1857
5d9dd663df8d
Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1856
diff
changeset
|
2118 { DO_COPY , DS_BITMAP_RAM , 0x6401, 1, 0x2000, 0, NULL, NULL }, |
5d9dd663df8d
Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1856
diff
changeset
|
2119 { DO_LAST , 0 , 0 , 0, 0 , 0, 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
|
2120 } |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2121 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2122 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
|
2123 }, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
2124 |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
2125 { |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2126 "bml", "Black Mail FLI (unpacked)", 0x3b00, 17474, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2127 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2128 NULL, NULL, |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2129 { }, &dmC64CommonFormats[1] |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2130 }, |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2131 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2132 { |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
2133 "bmlp", "Black Mail FLI (packed)", 0x38f0, 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
|
2134 fmtProbeBlackMailFLIPacked, |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
2135 fmtDecodeBlackMailFLIPacked, fmtEncodeBlackMailFLIPacked, |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2136 { }, &dmC64CommonFormats[1] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2137 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2138 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2139 { |
2014
a49f7e83edcb
Fix FBI FLI Designer format names to match v1.x and v2.
Matti Hamalainen <ccr@tnsp.org>
parents:
1985
diff
changeset
|
2140 "fd1", "FBI Crew FLI Designer 1.1 (unpacked)", 0x3c00, 17409, 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
|
2141 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
|
2142 NULL, NULL, |
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
|
2143 { }, &dmC64CommonFormats[9] |
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
|
2144 }, |
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
|
2145 |
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
|
2146 { |
2014
a49f7e83edcb
Fix FBI FLI Designer format names to match v1.x and v2.
Matti Hamalainen <ccr@tnsp.org>
parents:
1985
diff
changeset
|
2147 "fd2", "FLI Designer 2 (unpacked)", 0x3ff0, 17409, 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
|
2148 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
|
2149 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
|
2150 { }, &dmC64CommonFormats[9] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2151 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2152 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2153 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2154 "eci", "ECI Graphic Editor 1.0 (unpacked)", 0x4000, 32770, DM_FMT_RDWR, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2155 NULL, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2156 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
|
2157 { }, &dmC64CommonFormats[7] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2158 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2159 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2160 { |
1912
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2161 "ecp", "ECI Graphic Editor 1.0 (packed)", 0x4000, 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
|
2162 fmtProbeECIPacked, |
1912
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2163 fmtDecodeECIPacked, fmtEncodeECIPacked, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2164 { }, &dmC64CommonFormats[7] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2165 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2166 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2167 { |
1979
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2168 "fpt", "Face Painter (unpacked)", 0x4000, 10004, DM_FMT_RDWR, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2169 NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2170 NULL, NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2171 { // 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
|
2172 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2173 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2174 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
|
2175 2, 1, |
1979
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2176 NULL, NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2177 NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2178 { |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2179 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2180 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2181 { DO_COPY , DS_COLOR_RAM , 0x2328, 0, 0, 0, NULL, NULL }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2182 { DO_SET_MEM_LO , DS_BGCOL , 0x2710, 0, 0, 0, NULL, NULL }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2183 { DO_SET_MEM_LO , DS_D020 , 0x2711, 0, 0, 0, NULL, NULL }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2184 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2185 } |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2186 }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2187 NULL |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2188 }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2189 |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2190 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2191 "xx1", "Unknown $2000 format (unpacked)", 0x2000, 10242, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2192 NULL, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2193 NULL, NULL, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2194 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2195 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2196 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2197 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
|
2198 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
|
2199 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2200 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2201 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2202 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2203 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2204 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2205 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2206 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
2207 } |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2208 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2209 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2210 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2211 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2212 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2213 "xx2", "Unknown $2000 format (unpacked)", 0x2000, 0, DM_FMT_RDWR, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2214 fmtProbeFormatXX2, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2215 fmtDecodeFormatXX2, NULL, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2216 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2217 D64_FMT_MC, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2218 XX2_WIDTH_CH * 4, XX2_HEIGHT_CH * 8, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2219 XX2_WIDTH_CH , XX2_HEIGHT_CH, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2220 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
|
2221 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2222 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2223 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2224 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, XX2_BSIZE, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2225 { DO_COPY , DS_SCREEN_RAM , XX2_BSIZE, 0, XX2_SIZE, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2226 { DO_COPY , DS_COLOR_RAM , XX2_BSIZE + XX2_SIZE, 0, XX2_SIZE, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2227 { DO_SET_OP , DS_BGCOL , 11 , 0, 0, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2228 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
2229 } |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2230 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2231 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2232 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2233 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2234 { |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2235 "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, DM_FMT_RDWR, |
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2236 fmtProbeFunPaint2, |
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2237 fmtDecodeFunPaint2, fmtEncodeFunPaint2Unpacked, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2238 { }, &dmC64CommonFormats[3] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2239 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2240 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2241 { |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2242 "fp2p", "FunPaint II (packed)", 0x3ff0, 0, DM_FMT_RDWR, |
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2243 fmtProbeFunPaint2, |
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2244 fmtDecodeFunPaint2, fmtEncodeFunPaint2Packed, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2245 { }, &dmC64CommonFormats[3] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2246 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2247 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2248 { |
2185
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
2249 "gun", "GunPaint v1.1 (unpacked)", 0x4000, 33603, 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
|
2250 fmtProbeGunPaint, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2251 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2252 { |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2253 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
|
2254 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2255 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
|
2256 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
|
2257 NULL, NULL, |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2258 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
|
2259 { |
2185
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
2260 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x0000, 0, 0x400, 0), |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2261 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2262 { DO_COPY , DS_EXTRA_DATA , 0x3f4f, 0, 177, 0, NULL, NULL }, |
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2263 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL }, |
2185
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
2264 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x4400, 8, 0x400, 0), |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2265 { DO_COPY , DS_BITMAP_RAM , 0x6400, 1, 0 , 0, NULL, NULL }, |
1847
e3d1f16be4ee
Using the newly introduced data block offset feature, unify the handling of
Matti Hamalainen <ccr@tnsp.org>
parents:
1846
diff
changeset
|
2266 // 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
|
2267 // XXX TODO: According to some, the last 4 should be same .. |
e3d1f16be4ee
Using the newly introduced data block offset feature, unify the handling of
Matti Hamalainen <ccr@tnsp.org>
parents:
1846
diff
changeset
|
2268 { DO_SET_MEM , DS_EXTRA_DATA , 0 , 0, 3 , 20+177, NULL, NULL }, |
1922
3c6f638ce402
Remove the useless distinction of DO_ENC_FUNC and DO_DEC_FUNC, as the
Matti Hamalainen <ccr@tnsp.org>
parents:
1915
diff
changeset
|
2269 { DO_FUNC , 0 , 0x2742, 0, 1 , 0, fmtTruePaintGetLaceType, NULL }, |
2185
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
2270 { DO_FUNC , 0 , 0 , 0, 0 , 0, NULL, fmtEncodeGunPaint }, |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2271 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL }, |
1805 | 2272 } |
2273 }, | |
2274 NULL | |
2275 }, | |
2276 | |
2277 { | |
1877
f8b7baf3ff89
Some fixes to HCB support, now the background colors are supported correctly.
Matti Hamalainen <ccr@tnsp.org>
parents:
1876
diff
changeset
|
2278 "hcb", "Half Char Bitmap (unpacked)", 0x5000, 12148, DM_FMT_RDWR, |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2279 NULL, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2280 NULL, NULL, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2281 { |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2282 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2283 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2284 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
|
2285 2, 1, |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2286 NULL, NULL, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2287 fmtGetPixelHCB, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2288 { |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2289 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2290 { DO_COPY , DS_COLOR_RAM , 0x0400, 1, 0, 0, NULL, NULL }, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2291 { DO_COPY , DS_SCREEN_RAM , 0x0800, 0, 0, 0, NULL, NULL }, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2292 { DO_COPY , DS_SCREEN_RAM , 0x0c00, 1, 0, 0, NULL, NULL }, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2293 { DO_COPY , DS_BITMAP_RAM , 0x1000, 0, 0, 0, NULL, NULL }, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2294 { DO_COPY , DS_EXTRA_DATA , 0x2f40, 0, D64_SCR_HEIGHT / 4, 0, NULL, NULL }, |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2295 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2296 } |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2297 }, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2298 NULL |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2299 }, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2300 |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2301 { |
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
|
2302 "pen", "Pentel Paint (unpacked)", 0x4800, 19845, DM_FMT_RD | DM_FMT_BROKEN, |
1805 | 2303 NULL, |
2304 NULL, NULL, | |
2305 { | |
2306 D64_FMT_HIRES | D64_FMT_FLI, | |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2307 192, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2308 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
|
2309 2, 1, |
1805 | 2310 NULL, NULL, |
2311 fmtGetPixelPentelPaint, | |
2312 { | |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2313 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
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
|
2314 { DO_SET_OP , DS_SCREEN_RAM , 0x10 , 0, 0, 0, NULL, NULL }, |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2315 { DO_SET_MEM_LO , DS_BGCOL , 0x9580 - 0x4800, 0, 0, 0, NULL, NULL }, |
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
|
2316 { DO_SET_MEM_LO , DS_D022 , 0x9581 - 0x4800, 0, 0, 0, NULL, NULL }, // Sprite color |
1982
6af47b1009ba
Use DO_SET_MEM_LO where appropriate.
Matti Hamalainen <ccr@tnsp.org>
parents:
1980
diff
changeset
|
2317 { DO_SET_MEM_LO , DS_COLOR_RAM , 0x9582 - 0x4800, 0, 0, 0, NULL, NULL }, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2318 { DO_COPY , DS_EXTRA_DATA , 0x5ac0 - 0x4800, 0, D64_SPR_SIZE * 235, 0, NULL, NULL }, // Sprite data |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2319 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
2320 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2321 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2322 NULL |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2323 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2324 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2325 { |
2169
271850d7dd9b
Rename "Crest Hires FLI Designer (unpacked)" format short name to "chfd" from "chid".
Matti Hamalainen <ccr@tnsp.org>
parents:
2168
diff
changeset
|
2326 "chfd", "Crest Hires FLI Designer (unpacked)", 0x4000, 16386, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2327 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2328 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2329 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2330 D64_FMT_HIRES | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2331 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
|
2332 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
|
2333 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
|
2334 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2335 fmtGetPixelCrestHIFLIorCDHM, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2336 { |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2337 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL }, |
2164
ed079e869d64
Rename DEF_SCREEN_RAMS* macros to DEF_REPEAT_BLOCK and add argument to set block type.
Matti Hamalainen <ccr@tnsp.org>
parents:
2163
diff
changeset
|
2338 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x2000, 0, 0x400, 0), |
1846
88cef7758303
Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents:
1845
diff
changeset
|
2339 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
2340 } |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2341 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2342 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2343 }, |
1803
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
2344 |
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
2345 { |
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
|
2346 "cshf", "Crest Super Hires FLI Editor v1.0 (unpacked)", 0x4000, 15874, DM_FMT_RD, |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
2347 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
|
2348 NULL, NULL, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2349 { |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2350 D64_FMT_HIRES | D64_FMT_FLI, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2351 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2352 D64_SCR_CH_WIDTH, 21, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2353 1, 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
|
2354 NULL, NULL, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2355 fmtGetPixelCrestSHFLI, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2356 { |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2357 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x0000, 0, 0x400, 0), |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2358 DEF_REPEAT_BLOCK_8(DS_EXTRA_DATA, 0x03f8, 0, 0x400, 8), // Sprite pointers for each bank |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2359 { DO_COPY , DS_EXTRA_DATA , 0x03e8, 15, 2 , 0, NULL, NULL }, // 2 sprite colors |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2360 { DO_COPY , DS_EXTRA_DATA , 0x0000, 14, 0x3e00, 0, NULL, NULL }, // Lazily copy whole data for sprite data |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2361 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0, 0, NULL, NULL }, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2362 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2363 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2364 }, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2365 NULL |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2366 }, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2367 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2368 { |
1879
3b2f755c5745
Allow writing of "Crest Hires FLI Designer (unpacked)" and "Cosmos Designs Hires Manager (unpacked)" formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1878
diff
changeset
|
2369 "cdhm", "Cosmos Designs Hires Manager (unpacked)", 0x4000, 16385, DM_FMT_RDWR, |
1803
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
2370 fmtProbeCosmosDesignsHiresManager, |
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
2371 NULL, NULL, |
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
2372 { }, &dmC64CommonFormats[8] |
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
2373 }, |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
2374 |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2375 { |
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
|
2376 "cdhp", "Cosmos Designs Hires Manager (packed)", 0x4000, 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
|
2377 fmtProbeCosmosDesignsHiresManager, |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
2378 fmtDecodeCosmosDesignsHiresManagerPacked, NULL, |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
2379 { }, &dmC64CommonFormats[8] |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
2380 }, |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
2381 |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
2382 { |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
2383 "mrqp", "Marq's PETSCII editor (unpacked)", 0x0801, 0, DM_FMT_RD, |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2384 fmtProbeMarqPETSCII, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2385 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
|
2386 { |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2387 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
|
2388 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
|
2389 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
|
2390 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
|
2391 NULL, NULL, |
2172
de88333acc44
Move the PETSCII getpixel function to lib64gfx.c and remove the
Matti Hamalainen <ccr@tnsp.org>
parents:
2170
diff
changeset
|
2392 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
|
2393 { |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2394 { DO_COPY , DS_SCREEN_RAM , 0x60, 0, 0, 0, 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
|
2395 { DO_COPY , DS_COLOR_RAM , 0x60 + 1000, 0, 0, 0, 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
|
2396 |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
2397 // For offset values see petscii/m_c64.pde :: save_prg() |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
2398 { DO_SET_MEM_LO , DS_D020 , 25 - 2, 0, 0, 0, NULL, NULL }, |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
2399 { DO_SET_MEM_LO , DS_BGCOL , 30 - 2, 0, 0, 0, NULL, NULL }, |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
2400 { DO_COPY , DS_EXTRA_DATA , 20 - 2, 0, 1, 0, NULL, NULL }, |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
2401 { DO_FUNC , 0 , 0 , 0, 0, 0, fmtSetMarqPETSCIIData, 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
|
2402 |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
2403 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, 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
|
2404 } |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2405 }, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2406 NULL |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2407 }, |
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
|
2408 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2409 { |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2410 "upet", "Unknown PETSCII (unpacked)", 0x0801, 2499, DM_FMT_RD, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2411 NULL, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2412 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
|
2413 { |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2414 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
|
2415 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
|
2416 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
|
2417 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
|
2418 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
|
2419 NULL, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2420 { |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2421 { DO_COPY , DS_SCREEN_RAM , 0x01ab, 0, 0, 0, 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
|
2422 { DO_COPY , DS_COLOR_RAM , 0x01ab + 1000, 0, 0, 0, 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
|
2423 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2424 // For offset values see petscii/m_c64.pde :: save_prg() |
2174
5b22533cb07d
Fix d020/d021 decoding in Unknown PETSCII format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2173
diff
changeset
|
2425 { DO_SET_MEM_LO , DS_D020 , 0x01a9, 0, 0, 0, NULL, NULL }, |
5b22533cb07d
Fix d020/d021 decoding in Unknown PETSCII format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2173
diff
changeset
|
2426 { DO_SET_MEM_LO , DS_BGCOL , 0x01aa, 0, 0, 0, NULL, NULL }, |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2427 { DO_FUNC , 0 , 0 , 0, 0, 0, fmtSetSPETSCIIData, NULL }, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2428 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2429 { DO_LAST , 0 , 0 , 0, 0, 0, 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
|
2430 } |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2431 }, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2432 NULL |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2433 }, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2434 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2435 { |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
2436 "pkhu", "petscii.krissz.hu editor (unpacked)", 0x0801, 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
|
2437 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
|
2438 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
|
2439 { |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
2440 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
|
2441 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
|
2442 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
|
2443 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
|
2444 NULL, NULL, |
2172
de88333acc44
Move the PETSCII getpixel function to lib64gfx.c and remove the
Matti Hamalainen <ccr@tnsp.org>
parents:
2170
diff
changeset
|
2445 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
|
2446 { |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2447 { DO_COPY , DS_SCREEN_RAM , 0x2001 - 2, 0, 0, 0, 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
|
2448 { DO_COPY , DS_COLOR_RAM , 0x23e9 - 2, 0, 0, 0, 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
|
2449 |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
2450 { DO_COPY , DS_EXTRA_DATA , 0x0000 , 0, 0x0100, 0, NULL, NULL }, |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
2451 { DO_COPY , DS_CHAR_DATA , 0x1801 - 2, 0, 0x0800, 0, NULL, NULL }, |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
2452 { DO_FUNC , 0 , 0 , 0, 0 , 0, fmtSetPetsciiKrisszHuData, NULL }, |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
2453 |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
2454 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, 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
|
2455 } |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2456 }, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2457 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
|
2458 }, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2459 }; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2460 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2461 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
|
2462 |