annotate tools/lib64fmts.c @ 2015:c5a88bb4ee3f

Improve unpacked Koala Painter format support for variants that have a non-standard loading address by implementing variant probing.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 29 Aug 2018 22:01:29 +0300
parents a49f7e83edcb
children 1c45b2fb471d
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
5 * (C) Copyright 2012-2018 Tecnic Software productions (TNSP)
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
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
11
1915
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
12 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
13 {
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
14 if (buf->len == fmt->size &&
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
15 dmCompareAddr16(buf, 0, fmt->addr))
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
16 return DM_PROBE_SCORE_MAX;
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
17
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
18 return DM_PROBE_SCORE_FALSE;
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
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
21
1983
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
22 // 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
23 // 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
24 // before actual image data, but do not seem to be used in the image itself.
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
25 static const Uint8 fmtMicroIllustratorMagicID_1[] =
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
26 {
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
27 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
28 };
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
29
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
30 static const Uint8 fmtMicroIllustratorMagicID_2[] =
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
31 {
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
32 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
33 };
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
34
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
35 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
36 {
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
37 if (buf->len == fmt->size &&
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
38 memcmp(buf->data + 2, fmtMicroIllustratorMagicID_1, sizeof(fmtMicroIllustratorMagicID_1)) == 0
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
39 &&
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
40 memcmp(buf->data + 9, fmtMicroIllustratorMagicID_2, sizeof(fmtMicroIllustratorMagicID_2)) == 0
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
41 )
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
42 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
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_FALSE;
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
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
47
1985
5817e3335f53 Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents: 1984
diff changeset
48 static BOOL fmtEncodeMicroIllustrator(const DMC64EncDecOp *op, DMGrowBuf *buf,
5817e3335f53 Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents: 1984
diff changeset
49 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
50 {
5817e3335f53 Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents: 1984
diff changeset
51 (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
52 (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
53 (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
54
5817e3335f53 Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents: 1984
diff changeset
55 memcpy(buf->data + 2, fmtMicroIllustratorMagicID_1, sizeof(fmtMicroIllustratorMagicID_1));
5817e3335f53 Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents: 1984
diff changeset
56 memcpy(buf->data + 9, fmtMicroIllustratorMagicID_2, sizeof(fmtMicroIllustratorMagicID_2));
5817e3335f53 Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents: 1984
diff changeset
57
5817e3335f53 Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents: 1984
diff changeset
58 return TRUE;
5817e3335f53 Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents: 1984
diff changeset
59 }
5817e3335f53 Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents: 1984
diff changeset
60
5817e3335f53 Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents: 1984
diff changeset
61
2015
c5a88bb4ee3f Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
62 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
63 {
c5a88bb4ee3f Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
64 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
65
c5a88bb4ee3f Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
66 if (buf->len == 10003)
c5a88bb4ee3f Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
67 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
68
c5a88bb4ee3f Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
69 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
70 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
71
c5a88bb4ee3f Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
72 return score;
c5a88bb4ee3f Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
73 }
c5a88bb4ee3f Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
74
c5a88bb4ee3f Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents: 2014
diff changeset
75
1815
2b68b6955635 Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents: 1813
diff changeset
76 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
77 {
afb49736615a Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1593
diff changeset
78 // 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
79 if (buf->len > 30 &&
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
80 buf->len != 10006 &&
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
81 buf->len != 10003 &&
1594
afb49736615a Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1593
diff changeset
82 dmCompareAddr16(buf, 0, fmt->addr))
1771
c261db6e39aa Adjust some probe scores.
Matti Hamalainen <ccr@tnsp.org>
parents: 1770
diff changeset
83 return DM_PROBE_SCORE_GOOD;
1594
afb49736615a Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1593
diff changeset
84
afb49736615a Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1593
diff changeset
85 return DM_PROBE_SCORE_FALSE;
afb49736615a Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1593
diff changeset
86 }
afb49736615a Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1593
diff changeset
87
afb49736615a Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1593
diff changeset
88
1840
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
89 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
90 {
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
91 if (buf->len > 32 &&
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
92 (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
93 {
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
94 // 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
95 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
96 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
97 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
98 return DM_PROBE_SCORE_MAX;
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
99
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
100 // Unpacked variant
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
101 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
102 return DM_PROBE_SCORE_MAX;
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
103 }
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
104
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
105 return DM_PROBE_SCORE_FALSE;
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
106 }
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
107
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
108
1839
666b27999570 As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents: 1838
diff changeset
109 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
110 {
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
111 int res;
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
112 DMGrowBuf mem;
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
113 DMCompParams cfg;
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
114
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
115 cfg.func = fmt->name;
1712
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
116 cfg.type = DM_COMP_RLE_MARKER;
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
117 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
118 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
119
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
120 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
121 goto out;
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
122
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
123 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
124
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
125 out:
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
126 dmGrowBufFree(&mem);
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
127 return res;
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
128 }
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
129
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
130
1839
666b27999570 As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents: 1838
diff changeset
131 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
132 {
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
133 int res;
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
134 DMGrowBuf tmp;
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
135 DMCompParams cfg;
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
136
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
137 // 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
138 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
139 goto out;
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
140
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
141 // 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
142 cfg.func = fmt->name;
1660
7555c8803529 More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents: 1653
diff changeset
143 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
144 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
145 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
146 cfg.rleMinCountB = 4;
1660
7555c8803529 More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents: 1653
diff changeset
147 cfg.rleMaxCountB = 255;
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
148 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
149
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
150 out:
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
151 dmGrowBufFree(&tmp);
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
152 return res;
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
153 }
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
154
fb60abb09a65 Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents: 1577
diff changeset
155
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
156 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
157 {
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
158 const Uint8 *ident = buf->data + 2;
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
159 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
160 dmCompareAddr16(buf, 0, fmt->addr) &&
1662
34d7c708649e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1661
diff changeset
161 memcmp(ident, "DRAZPAINT ", 10) == 0 &&
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
162 ident[11] == '.' && (
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
163 (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
164 (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
165 ))
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
166 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
167
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
168 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
169 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
170
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
171
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
172 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
173 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
174 int res;
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
175 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
176 DMCompParams cfg;
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
177
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
178 cfg.func = fmt->name;
1712
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
179 cfg.type = DM_COMP_RLE_MARKER;
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
180 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
181 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
182
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
183 if ((res = dmDecodeGenericRLEAlloc(&mem,
1747
5e928618fdc8 Change DMGrowBuf API somewhat and implement more copy operations.
Matti Hamalainen <ccr@tnsp.org>
parents: 1746
diff changeset
184 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
185 goto out;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
186
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
187 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
188
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
189 out:
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
190 dmGrowBufFree(&mem);
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
191 return res;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
192 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
193
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
194
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
195 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
196 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
197 int res;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
198 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
199 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
200 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
201
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
202 // 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
203 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
204 goto out;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
205
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
206 // 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
207 cfg.func = fmt->name;
1660
7555c8803529 More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents: 1653
diff changeset
208 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
209 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
210 cfg.rleMinCountB = 4;
1660
7555c8803529 More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents: 1653
diff changeset
211 cfg.rleMaxCountB = 255;
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
212
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
213 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
214
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
215 // 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
216 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
217 !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
218 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
219 res = DMERR_MALLOC;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
220 goto out;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
221 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
222
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
223 // 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
224 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
225
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
226 out:
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
227 dmGrowBufFree(&tmp);
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
228 return res;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
229 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
230
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
231
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
232 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
233 {
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
234 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
235 dmCompareAddr16(buf, 0, fmt->addr) &&
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
236 memcmp(buf->data + 2, "DRAZLACE! 1.0", 13) == 0)
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
237 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
238
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
239 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
240 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
241
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
242
1529
4068d87ca884 Rename some decoder functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 1505
diff changeset
243 static BOOL fmtDrazLaceGetLaceType(DMC64Image *img, const DMC64EncDecOp *op,
1984
e7f2ddaf94a6 Change encode and decode function format parameter type from DMC64ImageFormat to DMC64ImageCommonFormat.
Matti Hamalainen <ccr@tnsp.org>
parents: 1983
diff changeset
244 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
245 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
246 (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
247
c048da352279 Default to D64_ILACE_RES if the given buffer is NULL in fmtDrazLaceGetLaceType().
Matti Hamalainen <ccr@tnsp.org>
parents: 1922
diff changeset
248 if (buf != NULL)
c048da352279 Default to D64_ILACE_RES if the given buffer is NULL in fmtDrazLaceGetLaceType().
Matti Hamalainen <ccr@tnsp.org>
parents: 1922
diff changeset
249 img->laceType = buf->data[op->offs] ? D64_ILACE_RES : D64_ILACE_COLOR;
c048da352279 Default to D64_ILACE_RES if the given buffer is NULL in fmtDrazLaceGetLaceType().
Matti Hamalainen <ccr@tnsp.org>
parents: 1922
diff changeset
250 else
c048da352279 Default to D64_ILACE_RES if the given buffer is NULL in fmtDrazLaceGetLaceType().
Matti Hamalainen <ccr@tnsp.org>
parents: 1922
diff changeset
251 img->laceType = D64_ILACE_RES;
c048da352279 Default to D64_ILACE_RES if the given buffer is NULL in fmtDrazLaceGetLaceType().
Matti Hamalainen <ccr@tnsp.org>
parents: 1922
diff changeset
252
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
253 return TRUE;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
254 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
255
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
256
1535
2f7ff28ea56e Fix DrazLace encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1529
diff changeset
257 static BOOL 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
258 const DMC64Image *img, const DMC64ImageCommonFormat *fmt)
1535
2f7ff28ea56e Fix DrazLace encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1529
diff changeset
259 {
2f7ff28ea56e Fix DrazLace encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1529
diff changeset
260 (void) fmt;
2f7ff28ea56e Fix DrazLace encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1529
diff changeset
261 buf->data[op->offs] = (img->laceType == D64_ILACE_RES) ? 1 : 0;
2f7ff28ea56e Fix DrazLace encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1529
diff changeset
262 return TRUE;
2f7ff28ea56e Fix DrazLace encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1529
diff changeset
263 }
2f7ff28ea56e Fix DrazLace encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1529
diff changeset
264
2f7ff28ea56e Fix DrazLace encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1529
diff changeset
265
1662
34d7c708649e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1661
diff changeset
266 static const char *fmtBDP5MagicID = "BDP 5.00";
34d7c708649e Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1661
diff changeset
267
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
268 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
269 {
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
270 if (buf->len > 20 &&
1651
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
271 dmCompareAddr16(buf, 0, fmt->addr) &&
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
272 memcmp(buf->data + 2, fmtBDP5MagicID, strlen(fmtBDP5MagicID)) == 0)
1651
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
273 return DM_PROBE_SCORE_MAX;
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
274
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
275 return DM_PROBE_SCORE_FALSE;
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
276 }
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
277
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
278
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
279 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
280 {
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
281 int res;
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
282 DMGrowBuf mem, tmp;
1651
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
283 DMCompParams cfg;
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
284
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
285 cfg.func = fmt->name;
1712
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
286 cfg.type = DM_COMP_RLE_MARKER;
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
287 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_WORD_RUNS | DM_RLE_ORDER_1;
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
288 cfg.rleMarkerB = buf->data[8];
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
289 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
290
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
291 // 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
292 // 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
293 // 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
294 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
295 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
296
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
297 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
298
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
299 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
300 goto out;
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
301
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
302 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
303
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
304 out:
1792
905c09049fe6 Oops, forgot to free the buffer allocated in the BDP5 decoder. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 1791
diff changeset
305 dmGrowBufFree(&tmp);
1651
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
306 dmGrowBufFree(&mem);
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
307 return res;
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
308 }
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
309
6dd191d04ea8 Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1650
diff changeset
310
1663
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
311 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
312 {
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
313 int res;
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
314 DMGrowBuf mem;
1663
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
315 DMCompParams cfg;
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
316
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
317 // 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
318 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
319 goto out;
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
320
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
321 // 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
322 cfg.func = fmt->name;
1663
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
323 cfg.type = DM_COMP_RLE_MARKER;
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
324 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
325 cfg.rleMinCountB = 4;
1663
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
326 cfg.rleMaxCountB = 255;
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
327 cfg.rleMinCountW = 256;
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
328 cfg.rleMaxCountW = 1024;
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
329
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
330 dmGenericRLEAnalyze(&mem, &cfg);
1663
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
331
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
332 // 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
333 if (!dmGrowBufPut(buf, (Uint8 *) fmtBDP5MagicID, strlen(fmtBDP5MagicID)) ||
1663
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
334 !dmGrowBufPutU8(buf, cfg.rleMarkerB) ||
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
335 !dmGrowBufPutU8(buf, cfg.rleMarkerW))
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
336 {
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
337 res = DMERR_MALLOC;
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
338 goto out;
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
339 }
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
340
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
341 // 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
342 res = dmEncodeGenericRLE(buf, &mem, &cfg);
1663
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
343
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
344 out:
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
345 dmGrowBufFree(&mem);
1663
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
346 return res;
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
347 }
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
348
8ae32df3c184 Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1662
diff changeset
349
1776
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
350 static const char *fmtGunPaintMagicID = "GUNPAINT (JZ) ";
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
351 #define fmtGunPaintMagicLen (14)
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
352 #define fmtGunPaintMagicOffs (0x3e8)
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
353
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
354 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
355 {
1845
a77451bb6614 Improve GunPaint format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1844
diff changeset
356 if (buf->len > fmtGunPaintMagicOffs + fmtGunPaintMagicLen &&
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
357 dmCompareAddr16(buf, 0, fmt->addr) &&
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
358 memcmp(buf->data + fmtGunPaintMagicOffs + 2, fmtGunPaintMagicID, fmtGunPaintMagicLen) == 0)
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
359 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
360
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
361 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
362 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
363
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
364
1776
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
365 static BOOL 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
366 const DMC64Image *img, const DMC64ImageCommonFormat *fmt)
1776
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
367 {
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
368 (void) op;
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
369 (void) img;
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
370 (void) fmt;
1946
c30dfd5e3227 Add a comment.
Matti Hamalainen <ccr@tnsp.org>
parents: 1941
diff changeset
371 // Here we assume that the op triggering this function is
c30dfd5e3227 Add a comment.
Matti Hamalainen <ccr@tnsp.org>
parents: 1941
diff changeset
372 // at the end of the oplist, so the memory is allocated,
1848
273e274f9ed6 Fix encoding of GunPaint format by placing the magic ID in correct position.
Matti Hamalainen <ccr@tnsp.org>
parents: 1847
diff changeset
373 memcpy(buf->data + fmtGunPaintMagicOffs + 2, fmtGunPaintMagicID, fmtGunPaintMagicLen);
1776
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
374 return TRUE;
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
375 }
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
376
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
377
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
378 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
379 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
380 size_t i, n;
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 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
383 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
384
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
385 // 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
386 // as do some GunPaint images ..
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
387 if (buf->len == 9002 ||
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
388 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
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
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
391 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
392 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
393
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
394 if (n > 50)
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
395 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
396 if (n > 25)
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
397 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
398 if (n > 10)
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
399 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
400
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
401 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
402 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
403
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
404
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
405 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
406 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
407 int res;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
408 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
409 DMCompParams cfg;
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
410
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
411 // 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
412 // 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
413 if (dmGrowBufCopy(&tmp, buf, 1) == NULL)
768fddda73e9 Convert fmtDecodeAmicaPaintPacked() to use the new DMGrowBuf functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 1749
diff changeset
414 return DMERR_MALLOC;
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
415
1751
768fddda73e9 Convert fmtDecodeAmicaPaintPacked() to use the new DMGrowBuf functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 1749
diff changeset
416 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
417
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
418 // 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
419 cfg.func = fmt->name;
1712
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
420 cfg.type = DM_COMP_RLE_MARKER;
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
421 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
422 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
423
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
424 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
425 goto out;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
426
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
427 // 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
428 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
429
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
430 out:
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
431 dmGrowBufFree(&tmp);
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
432 dmGrowBufFree(&mem);
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
433 return res;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
434 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
435
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
436
1538
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
437 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
438 {
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
439 int res;
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
440 DMGrowBuf mem;
1538
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
441 DMCompParams cfg;
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
442
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
443 // 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
444 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
445 goto out;
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
446
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
447 // 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
448 cfg.func = fmt->name;
1660
7555c8803529 More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents: 1653
diff changeset
449 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
450 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
451 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
452 cfg.rleMinCountB = 4;
1660
7555c8803529 More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents: 1653
diff changeset
453 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
454
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
455 res = dmEncodeGenericRLE(buf, &mem, &cfg);
1538
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
456
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
457 out:
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
458 dmGrowBufFree(&mem);
1538
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
459 return res;
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
460 }
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
461
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
462
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
463 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
464 {
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
465 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
466 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
467 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
468
5d7c89ad0bb4 Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents: 1771
diff changeset
469 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
470 }
5d7c89ad0bb4 Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents: 1771
diff changeset
471
5d7c89ad0bb4 Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents: 1771
diff changeset
472
1806
dcb12cd340d3 Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents: 1805
diff changeset
473 static Uint8 fmtGetPixelFLIDesigner(
dcb12cd340d3 Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents: 1805
diff changeset
474 const DMC64Image *img, const int bmoffs, const int scroffs,
dcb12cd340d3 Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents: 1805
diff changeset
475 const int shift, const int bitmap, const int rasterX, const int rasterY)
dcb12cd340d3 Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents: 1805
diff changeset
476 {
dcb12cd340d3 Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents: 1805
diff changeset
477 (void) rasterX;
dcb12cd340d3 Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents: 1805
diff changeset
478 return dmC64GetGenericMCPixel(img, bmoffs, scroffs, shift, rasterY & 7, bitmap, 0, img->bgcolor);
dcb12cd340d3 Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents: 1805
diff changeset
479 }
dcb12cd340d3 Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents: 1805
diff changeset
480
dcb12cd340d3 Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents: 1805
diff changeset
481
1788
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
482 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
483 {
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
484 if (buf->len > 16 &&
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
485 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
486 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
487 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
488 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
489
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
490 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
491 }
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
492
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
493
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
494 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
495 {
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
496 int res;
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
497 DMGrowBuf dst, src;
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
498 DMCompParams cfg;
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
499
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
500 cfg.func = fmt->name;
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
501 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
502 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
503 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
504 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
505 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
506
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
507 // 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
508 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
509
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
510 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
511 goto out;
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
512
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
513 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
514
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
515 out:
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
516 dmGrowBufFree(&dst);
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
517 return res;
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
518 }
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
519
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
520
1832
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
521 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
522 {
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
523 int res;
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
524 DMGrowBuf tmp1, tmp2;
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
525 DMCompParams cfg;
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
526
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
527 dmGrowBufInit(&tmp1);
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
528 dmGrowBufInit(&tmp2);
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
529
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
530 // 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
531 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
532 goto out;
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
533
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
534 // 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
535 cfg.func = fmt->name;
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
536 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
537 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
538 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
539 cfg.rleMinCountB = 4;
1832
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
540 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
541
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
542 dmGenericRLEAnalyze(&tmp1, &cfg);
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
543
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
544 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
545 goto out;
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
546
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
547 // 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
548 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
549 !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
550 !dmGrowBufPutU16LE(buf, 0x7f3f) ||
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
551 !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
552 {
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
553 res = DMERR_MALLOC;
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
554 goto out;
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
555 }
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
556
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
557 out:
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
558 dmGrowBufFree(&tmp1);
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
559 dmGrowBufFree(&tmp2);
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
560 return res;
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
561 }
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
562
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
563
1788
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
564 static Uint8 fmtGetPixelBlackMailFLI(
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
565 const DMC64Image *img, const int bmoffs, const int scroffs,
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
566 const int shift, const int bitmap, const int rasterX, const int rasterY)
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
567 {
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
568 const int vbank = rasterY & 7;
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
569 (void) rasterX;
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
570
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
571 return dmC64GetGenericMCPixel(
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
572 img, bmoffs, scroffs, shift,
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
573 vbank, bitmap, 0,
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
574 img->extraData[0].data[rasterY] & 15);
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
575 }
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
576
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
577
1529
4068d87ca884 Rename some decoder functions.
Matti Hamalainen <ccr@tnsp.org>
parents: 1505
diff changeset
578 static BOOL fmtTruePaintGetLaceType(DMC64Image *img, const DMC64EncDecOp *op,
1984
e7f2ddaf94a6 Change encode and decode function format parameter type from DMC64ImageFormat to DMC64ImageCommonFormat.
Matti Hamalainen <ccr@tnsp.org>
parents: 1983
diff changeset
579 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
580 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
581 (void) op;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
582 (void) buf;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
583 (void) fmt;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
584 img->laceType = D64_ILACE_RES;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
585 return TRUE;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
586 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
587
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
588
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
589 static Uint8 fmtGetPixelTruePaint(
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
590 const DMC64Image *img, const int bmoffs, const int scroffs,
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
591 const int shift, const int bitmap, 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
592 {
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
593 (void) rasterX;
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
594 (void) rasterY;
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
595 return dmC64GetGenericMCPixel(img, bmoffs, scroffs, shift, 0, bitmap, 0, img->bgcolor);
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
596 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
597
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
598
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
599 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
600 {
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
601 // 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
602 // relocation of decompression code
1684
e7990551c6d6 Rename function variable.
Matti Hamalainen <ccr@tnsp.org>
parents: 1671
diff changeset
603 static const Uint8 magicID[] = {
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
604 0x0b, 0x08, 0x09, 0x00, 0x9e, 0x32, 0x30, 0x35,
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
605 0x39, 0x00, 0xa2, 0x00, 0x78, 0xbd, 0x1c, 0x08,
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
606 0x9d, 0xf5, 0x00, 0xe8, 0xd0, 0xf7, 0xe6, 0x01,
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
607 0x4c, 0x01, 0x01, 0xa5, 0xfe, 0xd0, 0x02, 0xc6,
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
608 0xff, 0xc6, 0xfe
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
609 };
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
610
1789
9f5c5ab0e85e Adjust True Paint probing to be slightly more forgiving vs. file size.
Matti Hamalainen <ccr@tnsp.org>
parents: 1788
diff changeset
611 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
612 dmCompareAddr16(buf, 0, fmt->addr) &&
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
613 memcmp(buf->data + 2, magicID, sizeof(magicID)) == 0)
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
614 return DM_PROBE_SCORE_MAX;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
615
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
616 return DM_PROBE_SCORE_FALSE;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
617 }
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
618
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
619
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
620 //
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
621 // 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
622 // 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
623 // simplistic "codebook".
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
624 //
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
625 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
626 {
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
627 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
628 {
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
629 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
630 "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
631 }
dbdff3d50a4e Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents: 1648
diff changeset
632 else
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
633 return DMERR_OK;
1649
dbdff3d50a4e Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents: 1648
diff changeset
634 }
dbdff3d50a4e Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents: 1648
diff changeset
635
dbdff3d50a4e Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents: 1648
diff changeset
636
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
637 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
638 {
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
639 int res = DMERR_OK;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
640 const Uint8 *codeBook1, *codeBook2;
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
641 DMGrowBuf dst, src;
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
642 DMCompParams cfg;
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
643 Uint8 data;
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
644
1724
12504f179749 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1723
diff changeset
645 // 1b7e-67e8 decoded by original depacker
12504f179749 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1723
diff changeset
646 // 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
647 cfg.func = fmt->name;
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
648 cfg.type = DM_COMP_RLE_MARKER;
1724
12504f179749 Cleanups.
Matti Hamalainen <ccr@tnsp.org>
parents: 1723
diff changeset
649 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
650 cfg.rleMarkerB = 0xfe;
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
651 cfg.cropOutLen = 0x67e8 - 0x1c00;
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
652
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
653 // 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
654 codeBook1 = psrc->data + 0x81 - 2;
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
655 codeBook2 = psrc->data + 0x85 - 2;
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
656
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
657 // Allocate output buffer
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
658 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
659 goto out;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
660
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
661 // 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
662 // 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
663 dmGrowBufConstCopy(&src, psrc);
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
664 dmSetupRLEBuffers(&dst, &src, &cfg);
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
665
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
666 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
667 {
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
668 unsigned int count = 1;
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
669 BOOL found = FALSE;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
670
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
671 for (int n = 0; n < 8; n++)
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
672 if (codeBook1[n] == data && !found)
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
673 {
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
674 found = TRUE;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
675 switch (n)
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
676 {
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
677 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
678 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
679 goto out;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
680
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
681 count = data;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
682 if (data == 0)
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
683 goto finish;
1649
dbdff3d50a4e Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents: 1648
diff changeset
684
dbdff3d50a4e Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents: 1648
diff changeset
685 // fallthrough
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
686
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
687 case 1: // Y = 1, JTO = $17
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
688 count += 2;
1649
dbdff3d50a4e Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents: 1648
diff changeset
689 // fallthrough
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
690
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
691 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
692 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
693 goto out;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
694 break;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
695
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
696 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
697 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
698 goto out;
1649
dbdff3d50a4e Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents: 1648
diff changeset
699
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
700 count = data;
1649
dbdff3d50a4e Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents: 1648
diff changeset
701 // fallthrough
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
702
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
703 case 3: // Y = 3, JTO = $0B
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
704 count += 2;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
705 data = 0;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
706 break;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
707
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
708 default: // Y = [5..8], JTO = $00
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
709 count++;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
710 data = codeBook2[n];
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
711 break;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
712 }
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
713 }
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
714
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
715 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
716 goto out;
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
717 }
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
718
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
719 finish:
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
720 dmFinishRLEBuffers(&dst, &src, &cfg);
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
721 res = dmC64DecodeGenericBMP(img, &dst, fmt);
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
722
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
723 out:
1722
de8e0a404c06 Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents: 1714
diff changeset
724 dmGrowBufFree(&dst);
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
725 return res;
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
726 }
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
727
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
728
1668
1741717b1ae5 Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents: 1665
diff changeset
729 #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
730 #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
731 #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
732 #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
733 #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
734
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
735
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
736 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
737 {
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
738 if (buf->len >= XX2_MIN_SIZE &&
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
739 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
740 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
741 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
742
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
743 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
744 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
745
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
746
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
747 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
748 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
749 int res;
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
750 DMGrowBuf tmp;
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
751
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
752 // 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
753 // 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
754 // 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
755 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
756 return DMERR_MALLOC;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
757
1748
9c4b3fecc510 Use the new DMGrowBuf functions in XX2 format buffer enlarging.
Matti Hamalainen <ccr@tnsp.org>
parents: 1747
diff changeset
758 tmp.len = tmp.size;
9c4b3fecc510 Use the new DMGrowBuf functions in XX2 format buffer enlarging.
Matti Hamalainen <ccr@tnsp.org>
parents: 1747
diff changeset
759 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
760 dmGrowBufFree(&tmp);
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
761 return res;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
762 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
763
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
764
1812
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
765 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
766 {
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
767 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
768 {
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
769 // Packed variant
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
770 if (fmt->size == 0 &&
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
771 dmCompareAddr16(buf, 2, fmt->addr + buf->len - 3) &&
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
772 dmCompareAddr16(buf, 4, 0x7ff2))
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
773 return DM_PROBE_SCORE_MAX;
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
774
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
775 // Unpacked variant
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
776 if (fmt->size != 0 && fmt->size == buf->len)
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
777 return DM_PROBE_SCORE_GOOD;
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
778 }
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
779
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
780 return DM_PROBE_SCORE_FALSE;
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
781 }
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
782
7460a9b804e9 Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents: 1806
diff changeset
783
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
784 #define FUNPAINT2_HEADER_SIZE (0x10)
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
785 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
786
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
787
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
788 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
789 {
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
790 if (buf->len > 30 &&
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
791 dmCompareAddr16(buf, 0, fmt->addr) &&
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
792 memcmp(buf->data + 2, fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) == 0)
1777
a7f9e12bcd9b Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents: 1776
diff changeset
793 {
a7f9e12bcd9b Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents: 1776
diff changeset
794 // Unpacked variant
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
795 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
796 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
797
a7f9e12bcd9b Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents: 1776
diff changeset
798 // Packed variant
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
799 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
800 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
801 }
a7f9e12bcd9b Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents: 1776
diff changeset
802
a7f9e12bcd9b Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents: 1776
diff changeset
803 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
804 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
805
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
806
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
807 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
808 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
809 int res;
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
810 DMGrowBuf tmp;
1579
4288b21e97b9 Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1578
diff changeset
811
4288b21e97b9 Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1578
diff changeset
812 // 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
813 if (buf->data[14])
1579
4288b21e97b9 Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1578
diff changeset
814 {
4288b21e97b9 Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1578
diff changeset
815 DMGrowBuf mem;
4288b21e97b9 Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1578
diff changeset
816 DMCompParams cfg;
4288b21e97b9 Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1578
diff changeset
817
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
818 cfg.func = fmt->name;
1712
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
819 cfg.type = DM_COMP_RLE_MARKER;
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
820 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1;
1f4ed247763d Indentation cosmetics.
Matti Hamalainen <ccr@tnsp.org>
parents: 1711
diff changeset
821 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
822
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
823 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
824 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
825
1598
b5e0f28f1842 Adjust Fun Paint 2 decoding now that the RLE decoding is fixed.
Matti Hamalainen <ccr@tnsp.org>
parents: 1594
diff changeset
826 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
827 &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
828 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
829
1579
4288b21e97b9 Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1578
diff changeset
830 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
831 dmGrowBufFree(&tmp);
1579
4288b21e97b9 Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1578
diff changeset
832 }
4288b21e97b9 Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1578
diff changeset
833 else
4288b21e97b9 Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1578
diff changeset
834 {
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
835 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
836 }
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
837
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
838 return res;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
839 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
840
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
841
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
842 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
843 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
844 // Add the header bits
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
845 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
846 !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
847 !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
848 return DMERR_MALLOC;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
849
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
850 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
851 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
852
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
853
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
854 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
855 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
856 int res;
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
857 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
858 DMCompParams cfg;
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
859
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
860 // 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
861 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
862 goto out;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
863
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
864 // 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
865 cfg.func = fmt->name;
1660
7555c8803529 More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents: 1653
diff changeset
866 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
867 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
868 cfg.rleMinCountB = 4;
1660
7555c8803529 More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents: 1653
diff changeset
869 cfg.rleMaxCountB = 255;
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
870
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
871 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
872
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
873 // Add the header bits
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
874 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
875 !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
876 !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
877 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
878 res = DMERR_MALLOC;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
879 goto out;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
880 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
881
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
882 // 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
883 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
884
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
885 out:
1707
a0986cfd6f9d More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents: 1697
diff changeset
886 dmGrowBufFree(&mem);
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
887 return res;
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
888 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
889
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
890
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
891 static Uint8 fmtGetPixelFunPaint2(
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
892 const DMC64Image *img, const int bmoffs, const int scroffs,
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
893 const int shift, const int bitmap, 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
894 {
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
895 const int vbank = (rasterY & 7) + (bitmap * 8);
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
896 (void) rasterX;
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
897
1577
632f1dbc83eb Get rid of some code duplication by merging functionality of certain pixel
Matti Hamalainen <ccr@tnsp.org>
parents: 1575
diff changeset
898 return dmC64GetGenericMCPixel(
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
899 img, bmoffs, scroffs, shift,
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
900 vbank, bitmap, 0,
1847
e3d1f16be4ee Using the newly introduced data block offset feature, unify the handling of
Matti Hamalainen <ccr@tnsp.org>
parents: 1846
diff changeset
901 img->extraData[0].data[rasterY] & 15);
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
902 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
903
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
904
1582
1f6aed186c4e Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents: 1581
diff changeset
905 static Uint8 fmtGetPixelBFLI(
1f6aed186c4e Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents: 1581
diff changeset
906 const DMC64Image *img, const int bmoffs, const int scroffs,
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
907 const int shift, const int bitmap, 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
908 {
1857
5d9dd663df8d Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1856
diff changeset
909 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
910 const int vbank = (rasterY & 7) + (vbb * 8);
1756
1a121154f41f Silence a warning about unused function argument.
Matti Hamalainen <ccr@tnsp.org>
parents: 1755
diff changeset
911 (void) bitmap;
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
912 (void) rasterX;
1582
1f6aed186c4e Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents: 1581
diff changeset
913
1f6aed186c4e Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents: 1581
diff changeset
914 return dmC64GetGenericMCPixel(
1857
5d9dd663df8d Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1856
diff changeset
915 img, bmoffs & 0x1fff, scroffs & 0x3ff,
5d9dd663df8d Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1856
diff changeset
916 shift, vbank, 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
917 }
1f6aed186c4e Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents: 1581
diff changeset
918
1f6aed186c4e Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents: 1581
diff changeset
919
1806
dcb12cd340d3 Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents: 1805
diff changeset
920 static Uint8 fmtGetPixelPentelPaint(
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
921 const DMC64Image *img, const int bmoffs, const int scroffs,
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
922 const int shift, const int bitmap, 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
923 {
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
924 const int ry = rasterY / C64_SPR_HEIGHT_PX;
01d7feb9f9ce Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 1857
diff changeset
925 const int yd = rasterY % C64_SPR_HEIGHT_PX;
01d7feb9f9ce Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 1857
diff changeset
926 const int rx = rasterX / C64_SPR_WIDTH_PX;
01d7feb9f9ce Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 1857
diff changeset
927 const int xd = rasterX % C64_SPR_WIDTH_PX;
01d7feb9f9ce Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 1857
diff changeset
928 const int offs = (ry * 8 + rx) * C64_SPR_SIZE + (yd * C64_SPR_WIDTH_UT) + (xd / 8);
01d7feb9f9ce Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 1857
diff changeset
929 const int mask = 1 << (7 - (rasterX & 7));
01d7feb9f9ce Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 1857
diff changeset
930
01d7feb9f9ce Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 1857
diff changeset
931 Uint8 color1 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, 0, bitmap, 0);
01d7feb9f9ce Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 1857
diff changeset
932 Uint8 color2 = img->extraData[0].data[offs] & mask ? 0x0f : 0;
01d7feb9f9ce Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 1857
diff changeset
933 Uint8 color3 = img->extraData[0].data[offs + C64_SPR_SIZE * 155] & mask ? img->d022 : 0;
01d7feb9f9ce Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 1857
diff changeset
934
01d7feb9f9ce Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents: 1857
diff changeset
935 return color3 ? color3 : ( color2 ? color2 : color1 );
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
936 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
937
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
938
1876
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
939 static Uint8 fmtGetPixelHCB(
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
940 const DMC64Image *img, const int bmoffs, const int scroffs,
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
941 const int shift, const int bitmap, const int rasterX, const int rasterY)
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
942 {
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
943 const int vbank = (rasterY / 4) & 1;
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
944 (void) bitmap;
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
945 (void) rasterX;
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
946
1877
f8b7baf3ff89 Some fixes to HCB support, now the background colors are supported correctly.
Matti Hamalainen <ccr@tnsp.org>
parents: 1876
diff changeset
947 return dmC64GetGenericMCPixel(
f8b7baf3ff89 Some fixes to HCB support, now the background colors are supported correctly.
Matti Hamalainen <ccr@tnsp.org>
parents: 1876
diff changeset
948 img, bmoffs, scroffs,
f8b7baf3ff89 Some fixes to HCB support, now the background colors are supported correctly.
Matti Hamalainen <ccr@tnsp.org>
parents: 1876
diff changeset
949 shift, vbank, 0, vbank,
1878
91cc631f959a Use only 4 lowest bits from HCB background color data.
Matti Hamalainen <ccr@tnsp.org>
parents: 1877
diff changeset
950 img->extraData[0].data[rasterY / 5] & 15);
1876
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
951 }
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
952
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
953
1752
fe3ae3fdf0f3 Rename a function.
Matti Hamalainen <ccr@tnsp.org>
parents: 1751
diff changeset
954 static Uint8 fmtGetPixelCrestHIFLIorCDHM(
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
955 const DMC64Image *img, const int bmoffs, const int scroffs,
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
956 const int shift, const int bitmap, 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
957 {
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
958 (void) rasterX;
1766
13e5c212eb2b Clean up fmtGetPixelCrestHIFLIorCDHM().
Matti Hamalainen <ccr@tnsp.org>
parents: 1765
diff changeset
959 return dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, rasterY & 7, bitmap, 0);
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
960 }
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
961
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
962
1734
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
963 static BOOL fmtECIGetLaceType(DMC64Image *img, const DMC64EncDecOp *op,
1984
e7f2ddaf94a6 Change encode and decode function format parameter type from DMC64ImageFormat to DMC64ImageCommonFormat.
Matti Hamalainen <ccr@tnsp.org>
parents: 1983
diff changeset
964 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
965 {
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
966 (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
967 (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
968 (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
969 img->laceType = D64_ILACE_COLOR;
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
970 return TRUE;
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
971 }
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
972
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
973
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
974 static Uint8 fmtGetPixelECI(
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
975 const DMC64Image *img, const int bmoffs, const int scroffs,
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
976 const int shift, const int bitmap, 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
977 {
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
978 const int vbank = rasterY & 7;
1734
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
979 Uint8
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
980 c1 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, vbank , 0, 0),
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
981 c2 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, vbank + 8, 1, 0);
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
982
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
983 (void) bitmap;
1764
52e31cfc1e36 Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents: 1763
diff changeset
984 (void) rasterX;
1734
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
985 return (c1 * C64_NCOLORS) + c2;
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
986 }
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
987
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
988
1931
410679d2fe8a "Enable" the image->c64 bitmap conversion path in gfxconv. It does not work
Matti Hamalainen <ccr@tnsp.org>
parents: 1930
diff changeset
989 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
990 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
991 {
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
992 if (!dmSetMixedColorC64Palette(dst))
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
993 return DMERR_MALLOC;
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
994
1931
410679d2fe8a "Enable" the image->c64 bitmap conversion path in gfxconv. It does not work
Matti Hamalainen <ccr@tnsp.org>
parents: 1930
diff changeset
995 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
996 }
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
997
183d503b17a7 Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1731
diff changeset
998
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
999 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
1000 {
1746
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1001 size_t i, n;
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1002
1739
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1003 // XXX TODO: Perhaps count statistics about used byte values
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1004 // and compare to value in buf[2] which is the RLE marker
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
1005 if (buf->len < 128 ||
1753
09641e7179f6 Attempt to avoid misprobes of some Crest Hires FLI designer files as ECI 1.0 files.
Matti Hamalainen <ccr@tnsp.org>
parents: 1752
diff changeset
1006 !dmCompareAddr16(buf, 0, fmt->addr) ||
1760
c944844e437f Improve fmtProbeECIPacked() probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1759
diff changeset
1007 // Try to avoid misprobe of Crest Hires FLI Designer and Cosmos Design format
1979
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1008 buf->len == 16386 || buf->len == 16385 ||
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1009 // Face Painter
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1010 buf->len == 10004)
1746
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1011 return DM_PROBE_SCORE_FALSE;
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1012
1780
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
1013 for (n = 0, i = 3; i < buf->len; i++)
5ea4713e9e0f Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents: 1779
diff changeset
1014 if (buf->data[i] == buf->data[2]) n++;
1746
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1015
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1016 if (n > 50)
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1017 return DM_PROBE_SCORE_GOOD;
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1018 if (n > 25)
1739
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1019 return DM_PROBE_SCORE_AVG;
1746
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1020 if (n > 10)
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1021 return DM_PROBE_SCORE_MAYBE;
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1022
dd57dd9430cb Improve ECI packed format probing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1745
diff changeset
1023 return DM_PROBE_SCORE_FALSE;
1739
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1024 }
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1025
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1026
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1027 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
1028 {
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1029 int res;
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1030 DMGrowBuf tmp;
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1031 DMGrowBuf mem;
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1032 DMCompParams cfg;
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1033
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1034 cfg.func = fmt->name;
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1035 cfg.type = DM_COMP_RLE_MARKER;
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1036 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
1037 cfg.rleMarkerB = buf->data[0];
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1038
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1039 if ((res = dmDecodeGenericRLEAlloc(
1747
5e928618fdc8 Change DMGrowBuf API somewhat and implement more copy operations.
Matti Hamalainen <ccr@tnsp.org>
parents: 1746
diff changeset
1040 &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
1041 res = dmC64DecodeGenericBMP(img, &mem, fmt);
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1042
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1043 dmGrowBufFree(&mem);
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1044 return res;
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1045 }
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1046
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1047
1912
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1048 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
1049 {
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1050 int res;
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1051 DMGrowBuf tmp;
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1052 DMCompParams cfg;
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1053
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1054 // 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
1055 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
1056 goto out;
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1057
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1058 // 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
1059 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
1060 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
1061 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
1062 cfg.rleMinCountB = 4;
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1063 cfg.rleMaxCountB = 255;
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1064
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1065 dmGenericRLEAnalyze(&tmp, &cfg);
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1066
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1067 // 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
1068 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
1069 {
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1070 res = DMERR_MALLOC;
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1071 goto out;
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1072 }
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1073
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1074 // 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
1075 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
1076
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1077 out:
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1078 dmGrowBufFree(&tmp);
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1079 return res;
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1080 }
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1081
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1082
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1083 //
1795
c8d690e8f9e9 Fix some typos in comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1792
diff changeset
1084 // Helper macros for defining screen memory layouts
c8d690e8f9e9 Fix some typos in comments.
Matti Hamalainen <ccr@tnsp.org>
parents: 1792
diff changeset
1085 // 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
1086 //
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1087 #define DEF_SCREEN_RAM(start, oindex, bindex, osize, bsize) { DO_COPY, DS_SCREEN_RAM, (start) + ((osize) * (oindex)), (bindex), (bsize), 0, NULL, NULL }
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1088 #define DEF_SCREEN_RAMS_8(start, sindex, osize, bsize) \
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1089 DEF_SCREEN_RAM((start), 0, (sindex + 0), (osize), (bsize)), \
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1090 DEF_SCREEN_RAM((start), 1, (sindex + 1), (osize), (bsize)), \
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1091 DEF_SCREEN_RAM((start), 2, (sindex + 2), (osize), (bsize)), \
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1092 DEF_SCREEN_RAM((start), 3, (sindex + 3), (osize), (bsize)), \
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1093 DEF_SCREEN_RAM((start), 4, (sindex + 4), (osize), (bsize)), \
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1094 DEF_SCREEN_RAM((start), 5, (sindex + 5), (osize), (bsize)), \
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1095 DEF_SCREEN_RAM((start), 6, (sindex + 6), (osize), (bsize)), \
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1096 DEF_SCREEN_RAM((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
1097
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1098
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1099
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1100 //
1861
752893fa6412 Update a comment.
Matti Hamalainen <ccr@tnsp.org>
parents: 1860
diff changeset
1101 // Many formats actually share memory layout and other specs, and there are
752893fa6412 Update a comment.
Matti Hamalainen <ccr@tnsp.org>
parents: 1860
diff changeset
1102 // packed and unpacked versions of several formats. We'll reuse these here
752893fa6412 Update a comment.
Matti Hamalainen <ccr@tnsp.org>
parents: 1860
diff changeset
1103 // 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
1104 //
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1105 DMC64ImageCommonFormat dmC64CommonFormats[] =
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1106 {
1815
2b68b6955635 Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents: 1813
diff changeset
1107 { // #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
1108 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
1109 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1110 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1111 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1112 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1113 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1114 { 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
1115 { 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
1116 { 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
1117 { 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
1118 { 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
1119 }
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1120 },
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1121
1788
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1122 { // #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
1123 D64_FMT_MC | D64_FMT_FLI,
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1124 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1125 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1126 NULL, NULL,
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1127 fmtGetPixelBlackMailFLI,
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1128 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1129 { 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
1130 { DO_COPY , DS_COLOR_RAM , 0x0100, 0, 0, 0, NULL, NULL },
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1131 DEF_SCREEN_RAMS_8(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
1132 { 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
1133 { 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
1134 }
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1135 },
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1136
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1137 { // #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
1138 D64_FMT_HIRES,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1139 C64_SCR_WIDTH , C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1140 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1141 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1142 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1143 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1144 { 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
1145 { 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
1146 { 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
1147 }
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1148 },
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1149
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
1150 { // #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
1151 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1152 C64_SCR_WIDTH, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1153 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1154 NULL, NULL,
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
1155 fmtGetPixelFunPaint2,
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1156 {
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1157 DEF_SCREEN_RAMS_8(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
1158 { 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
1159 { 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
1160 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL },
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1161 DEF_SCREEN_RAMS_8(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
1162 { 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
1163 { 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
1164 { 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
1165 { 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
1166 }
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1167 },
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1168
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1169 { // #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
1170 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
1171 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1172 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1173 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1174 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1175 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1176 { 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
1177 { 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
1178 { 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
1179 { 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
1180 { 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
1181 }
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1182 },
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1183
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1184 { // #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
1185 D64_FMT_MC | D64_FMT_ILACE,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1186 C64_SCR_WIDTH , C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1187 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1188 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1189 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1190 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1191 { 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
1192 { 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
1193 { 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
1194 { 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
1195 { DO_FUNC , 0 , 0x2742, 0, 1, 0, fmtDrazLaceGetLaceType, fmtDrazLaceSetLaceType },
1880
efe6e88a02f3 Cleanup.
Matti Hamalainen <ccr@tnsp.org>
parents: 1879
diff changeset
1196 { 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
1197 { 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
1198 }
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1199 },
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
1200
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1201 { // #6: TruePaint
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1202 D64_FMT_MC | D64_FMT_ILACE,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1203 C64_SCR_WIDTH , C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1204 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1205 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1206 fmtGetPixelTruePaint,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1207 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1208 { 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
1209 { 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
1210 { 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
1211 { 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
1212 { 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
1213 { 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
1214 { 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
1215 { 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
1216 }
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1217 },
1739
83f50e431206 Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1734
diff changeset
1218
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1219 { // #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
1220 D64_FMT_HIRES | D64_FMT_FLI,
1941
f530a858c06f Cosmetic.
Matti Hamalainen <ccr@tnsp.org>
parents: 1931
diff changeset
1221 C64_SCR_WIDTH, C64_SCR_HEIGHT,
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1222 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1223 fmtConvertECIBMP2Image, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1224 fmtGetPixelECI,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1225 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1226 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL },
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1227 DEF_SCREEN_RAMS_8(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
1228 { DO_COPY , DS_BITMAP_RAM , 0x4000, 1, 0, 0, NULL, NULL },
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1229 DEF_SCREEN_RAMS_8(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
1230 { 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
1231 { 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
1232 }
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1233 },
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1234
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1235 { // #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
1236 D64_FMT_HIRES | D64_FMT_FLI,
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1237 C64_SCR_WIDTH, 24*8, // Actually 296 x 192 (=24*8)
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1238 C64_SCR_CH_WIDTH, 24,
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1239 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1240 fmtGetPixelCrestHIFLIorCDHM,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1241 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1242 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL },
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1243 DEF_SCREEN_RAMS_8(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
1244 { 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
1245 }
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1246 },
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
1247
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
1248 { // #9: FLI Designer 1.x & 2.0
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
1249 D64_FMT_MC | D64_FMT_FLI,
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
1250 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
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
1251 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
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
1252 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
1253 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
1254 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1255 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL },
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1256 DEF_SCREEN_RAMS_8(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
1257 { 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
1258 { 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
1259 }
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
1260 },
1840
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1261
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1262 { // #10: Doodle
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1263 D64_FMT_HIRES,
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1264 C64_SCR_WIDTH , C64_SCR_HEIGHT,
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1265 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1266 NULL, NULL,
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1267 NULL,
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1268 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1269 { 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
1270 { 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
1271 { 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
1272 }
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1273 },
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1274 };
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1275
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1276
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1277 //
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1278 // 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
1279 //
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1280 DMC64ImageFormat dmC64ImageFormats[] =
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1281 {
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1282 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1283 "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
1284 fmtProbeDrazPaint20Packed,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1285 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
1286 { }, &dmC64CommonFormats[4]
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1287 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1288
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1289 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1290 "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
1291 NULL,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1292 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
1293 { }, &dmC64CommonFormats[4]
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1294 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1295
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1296 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1297 "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
1298 fmtProbeDrazLace10Packed,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1299 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
1300 { }, &dmC64CommonFormats[5]
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1301 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1302
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1303 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1304 "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
1305 NULL,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1306 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
1307 { }, &dmC64CommonFormats[5]
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1308 },
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1309
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1310 {
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1311 "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
1312 fmtProbeBDP5Packed,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1313 fmtDecodeBDP5Packed, fmtEncodeBDP5Packed,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1314 { }, &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
1315 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1316
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1317 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1318 "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
1319 NULL,
0b0870a216e9 Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents: 1573
diff changeset
1320 NULL, NULL,
0b0870a216e9 Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents: 1573
diff changeset
1321 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1322 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
1323 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1324 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1325 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1326 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1327 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1328 { 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
1329 { 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
1330 { 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
1331 { 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
1332 { 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
1333 },
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1334 },
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1335 NULL
1574
0b0870a216e9 Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents: 1573
diff changeset
1336 },
0b0870a216e9 Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents: 1573
diff changeset
1337
0b0870a216e9 Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents: 1573
diff changeset
1338 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1339 "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
1340 NULL,
0b0870a216e9 Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents: 1573
diff changeset
1341 NULL, NULL,
0b0870a216e9 Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents: 1573
diff changeset
1342 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1343 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
1344 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1345 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1346 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1347 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1348 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1349 { 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
1350 { 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
1351 { 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
1352 { 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
1353 { 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
1354 },
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1355 },
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1356 NULL
1574
0b0870a216e9 Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents: 1573
diff changeset
1357 },
0b0870a216e9 Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents: 1573
diff changeset
1358
0b0870a216e9 Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents: 1573
diff changeset
1359 {
1816
8d7b424197bc Allow writing of unpacked True Paint format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1815
diff changeset
1360 "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
1361 NULL,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1362 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
1363 { }, &dmC64CommonFormats[6]
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
1364 },
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
1365
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
1366 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1367 "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
1368 fmtProbeTruePaintPacked,
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
1369 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
1370 { }, &dmC64CommonFormats[6]
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1371 },
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1372
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1373 {
1815
2b68b6955635 Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents: 1813
diff changeset
1374 "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
1375 fmtProbeKoalaPainter,
1646
415c732dc14c Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents: 1636
diff changeset
1376 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
1377 { }, &dmC64CommonFormats[0]
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1378 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1379
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1380 {
1839
666b27999570 As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents: 1838
diff changeset
1381 "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
1382 fmtProbeKoalaPainterPacked,
1839
666b27999570 As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents: 1838
diff changeset
1383 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
1384 { }, &dmC64CommonFormats[0]
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1385 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1386
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1387 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1388 "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
1389 NULL,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1390 NULL, NULL,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1391 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1392 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
1393 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1394 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1395 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1396 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1397 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1398 { 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
1399 { 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
1400 { 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
1401 { 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
1402 { 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
1403 { 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
1404 },
1593
a77876a07425 Oops, missed this from the last commit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1592
diff changeset
1405 },
a77876a07425 Oops, missed this from the last commit.
Matti Hamalainen <ccr@tnsp.org>
parents: 1592
diff changeset
1406 NULL
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1407 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1408
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1409 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1410 "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
1411 NULL,
841ee79030fa Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1754
diff changeset
1412 NULL, NULL,
841ee79030fa Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1754
diff changeset
1413 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1414 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
1415 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1416 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1417 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1418 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1419 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1420 { 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
1421 { 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
1422 { 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
1423 { 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
1424 { 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
1425 }
1755
841ee79030fa Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1754
diff changeset
1426 },
841ee79030fa Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1754
diff changeset
1427 NULL
841ee79030fa Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1754
diff changeset
1428 },
841ee79030fa Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1754
diff changeset
1429
841ee79030fa Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1754
diff changeset
1430 {
1985
5817e3335f53 Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents: 1984
diff changeset
1431 "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
1432 fmtProbeMicroIllustrator,
1758
8014e4cbebfe Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents: 1757
diff changeset
1433 NULL, NULL,
8014e4cbebfe Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents: 1757
diff changeset
1434 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1435 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
1436 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1437 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1438 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1439 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1440 {
1983
214c7bd8692f Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents: 1982
diff changeset
1441 { 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
1442 { 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
1443 { 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
1444 // 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
1445 { 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
1446 { 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
1447 { 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
1448 }
1758
8014e4cbebfe Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents: 1757
diff changeset
1449 },
8014e4cbebfe Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents: 1757
diff changeset
1450 NULL
8014e4cbebfe Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents: 1757
diff changeset
1451 },
8014e4cbebfe Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents: 1757
diff changeset
1452
8014e4cbebfe Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents: 1757
diff changeset
1453 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1454 "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
1455 NULL,
aa6a858db6bd Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1753
diff changeset
1456 NULL, NULL,
aa6a858db6bd Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1753
diff changeset
1457 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1458 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
1459 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1460 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1461 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1462 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1463 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1464 { 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
1465 { 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
1466 { 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
1467 { 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
1468 { 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
1469 }
1754
aa6a858db6bd Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1753
diff changeset
1470 },
aa6a858db6bd Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1753
diff changeset
1471 NULL
aa6a858db6bd Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1753
diff changeset
1472 },
aa6a858db6bd Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1753
diff changeset
1473
aa6a858db6bd Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1753
diff changeset
1474 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1475 "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
1476 NULL,
847bd77a538d Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1762
diff changeset
1477 NULL, NULL,
847bd77a538d Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1762
diff changeset
1478 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1479 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
1480 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1481 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1482 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1483 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1484 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1485 { 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
1486 { 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
1487 { 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
1488 // 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
1489 { 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
1490 { 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
1491 }
1763
847bd77a538d Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1762
diff changeset
1492 },
847bd77a538d Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1762
diff changeset
1493 NULL
847bd77a538d Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1762
diff changeset
1494 },
847bd77a538d Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1762
diff changeset
1495
847bd77a538d Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1762
diff changeset
1496 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1497 "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
1498 fmtProbeSaracenPaint,
1769
bf22cd877c13 Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1768
diff changeset
1499 NULL, NULL,
bf22cd877c13 Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1768
diff changeset
1500 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1501 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
1502 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1503 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1504 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1505 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1506 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1507 { 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
1508 { 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
1509 { 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
1510 { 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
1511 { 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
1512 }
1769
bf22cd877c13 Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1768
diff changeset
1513 },
bf22cd877c13 Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1768
diff changeset
1514 NULL
bf22cd877c13 Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1768
diff changeset
1515 },
bf22cd877c13 Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1768
diff changeset
1516
bf22cd877c13 Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1768
diff changeset
1517 {
1980
2cf79254b8e4 Confirm the Blazing Paddles d020/bgcolor positions and remove the broken flag.
Matti Hamalainen <ccr@tnsp.org>
parents: 1979
diff changeset
1518 "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
1519 NULL,
a176dea422cb Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1769
diff changeset
1520 NULL, NULL,
a176dea422cb Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1769
diff changeset
1521 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1522 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
1523 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1524 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1525 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1526 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1527 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1528 { 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
1529 // 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
1530 { 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
1531 { 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
1532 { 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
1533 { 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
1534 { 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
1535 }
1770
a176dea422cb Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1769
diff changeset
1536 },
a176dea422cb Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1769
diff changeset
1537 NULL
a176dea422cb Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1769
diff changeset
1538 },
a176dea422cb Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1769
diff changeset
1539
a176dea422cb Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1769
diff changeset
1540 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1541 "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
1542 NULL,
b69f3d97db9e Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents: 1760
diff changeset
1543 NULL, NULL,
b69f3d97db9e Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents: 1760
diff changeset
1544 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1545 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
1546 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1547 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1548 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1549 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1550 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1551 { 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
1552 { 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
1553 { 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
1554 { 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
1555 { 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
1556 { 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
1557 }
1762
b69f3d97db9e Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents: 1760
diff changeset
1558 },
b69f3d97db9e Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents: 1760
diff changeset
1559 NULL
b69f3d97db9e Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents: 1760
diff changeset
1560 },
b69f3d97db9e Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents: 1760
diff changeset
1561
b69f3d97db9e Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents: 1760
diff changeset
1562 {
1779
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1563 "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
1564 NULL,
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1565 NULL, NULL,
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1566 {
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1567 D64_FMT_MC,
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1568 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1569 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1570 NULL, NULL,
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1571 NULL,
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1572 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1573 { 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
1574 { 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
1575 { 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
1576 { 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
1577 { 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
1578 { 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
1579 }
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1580 },
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1581 NULL
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1582 },
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1583
20bf4140eaa1 Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents: 1778
diff changeset
1584 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1585 "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
1586 fmtProbeAmicaPaintPacked,
1538
af729e29a6f6 Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents: 1535
diff changeset
1587 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
1588 { }, &dmC64CommonFormats[0]
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1589 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1590
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1591 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1592 "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
1593 NULL,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1594 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
1595 { }, &dmC64CommonFormats[0]
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1596 },
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1597
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1598 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1599 "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
1600 NULL,
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1601 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
1602 { }, &dmC64CommonFormats[0]
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1603 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1604
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1605 {
1819
c12bd223000e Enable write support for some formats that should be workable.
Matti Hamalainen <ccr@tnsp.org>
parents: 1816
diff changeset
1606 "art", "Art Studio (unpacked)", 0x2000, 9009, DM_FMT_RDWR,
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1607 NULL,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1608 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 { }, &dmC64CommonFormats[2]
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1610 },
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1611
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1612 {
1819
c12bd223000e Enable write support for some formats that should be workable.
Matti Hamalainen <ccr@tnsp.org>
parents: 1816
diff changeset
1613 "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
1614 NULL,
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1615 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1616 { }, &dmC64CommonFormats[2]
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1617 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1618
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1619 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1620 "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
1621 fmtProbeDoodle,
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1622 NULL, NULL,
1840
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1623 { }, &dmC64CommonFormats[10]
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1624 },
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1625
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1626 {
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1627 "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
1628 fmtProbeDoodle,
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1629 fmtDecodeStaticRLEMarkerMode2, fmtEncodeStaticRLEMarkerMode2,
8d6bb48f2806 Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1839
diff changeset
1630 { }, &dmC64CommonFormats[10]
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1631 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1632
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1633 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1634 "mon", "Monomagic (unpacked)", 0x2000, 8194, DM_FMT_RDWR,
1670
ab4a38ba919f Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1669
diff changeset
1635 NULL,
ab4a38ba919f Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1669
diff changeset
1636 NULL, NULL,
ab4a38ba919f Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1669
diff changeset
1637 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1638 D64_FMT_HIRES,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1639 C64_SCR_WIDTH , C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1640 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1641 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1642 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1643 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1644 { 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
1645 { 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
1646 // 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
1647 { 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
1648 }
1670
ab4a38ba919f Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1669
diff changeset
1649 },
ab4a38ba919f Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1669
diff changeset
1650 NULL
ab4a38ba919f Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1669
diff changeset
1651 },
ab4a38ba919f Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1669
diff changeset
1652
ab4a38ba919f Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1669
diff changeset
1653 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1654 "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
1655 NULL,
dd9528cdd14a Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents: 1670
diff changeset
1656 NULL, NULL,
dd9528cdd14a Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents: 1670
diff changeset
1657 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1658 D64_FMT_HIRES,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1659 C64_SCR_WIDTH , C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1660 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1661 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1662 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1663 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1664 { 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
1665 { 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
1666 { 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
1667 }
1671
dd9528cdd14a Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents: 1670
diff changeset
1668 },
dd9528cdd14a Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents: 1670
diff changeset
1669 NULL
dd9528cdd14a Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents: 1670
diff changeset
1670 },
dd9528cdd14a Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents: 1670
diff changeset
1671
dd9528cdd14a Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents: 1670
diff changeset
1672 {
1915
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1673 "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
1674 fmtProbeGigapaintHires,
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1675 NULL, NULL,
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1676 {
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1677 D64_FMT_HIRES,
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1678 C64_SCR_WIDTH , C64_SCR_HEIGHT,
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1679 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1680 NULL, NULL,
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1681 NULL,
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1682 {
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1683 { 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
1684 { 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
1685 { 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
1686 }
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1687 },
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1688 NULL
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1689 },
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1690
788cfc7096f3 Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1912
diff changeset
1691 {
1857
5d9dd663df8d Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1856
diff changeset
1692 "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
1693 NULL,
1f6aed186c4e Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents: 1581
diff changeset
1694 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
1695 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1696 D64_FMT_MC | D64_FMT_FLI,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1697 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT * 2,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1698 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1699 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1700 fmtGetPixelBFLI,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1701 {
1857
5d9dd663df8d Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1856
diff changeset
1702 { DO_COPY , DS_COLOR_RAM , 0x0001, 0, 0x400 , 0, NULL, NULL },
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1703 DEF_SCREEN_RAMS_8(0x0401, 0, 0x400, 0),
1857
5d9dd663df8d Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1856
diff changeset
1704 { DO_COPY , DS_BITMAP_RAM , 0x2401, 0, 0x2000, 0, NULL, NULL },
5d9dd663df8d Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1856
diff changeset
1705 DEF_SCREEN_RAMS_8(0x4401, 8, 0x400, 0x400),
5d9dd663df8d Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1856
diff changeset
1706 { 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
1707 { 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
1708 }
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1709 },
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1710 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
1711 },
1f6aed186c4e Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents: 1581
diff changeset
1712
1f6aed186c4e Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents: 1581
diff changeset
1713 {
1788
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1714 "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
1715 NULL,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1716 NULL, NULL,
1788
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1717 { }, &dmC64CommonFormats[1]
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1718 },
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1719
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1720 {
1832
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
1721 "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
1722 fmtProbeBlackMailFLIPacked,
1832
843d3a593f05 Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1819
diff changeset
1723 fmtDecodeBlackMailFLIPacked, fmtEncodeBlackMailFLIPacked,
1788
04e13949b314 Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1780
diff changeset
1724 { }, &dmC64CommonFormats[1]
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1725 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1726
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1727 {
2014
a49f7e83edcb Fix FBI FLI Designer format names to match v1.x and v2.
Matti Hamalainen <ccr@tnsp.org>
parents: 1985
diff changeset
1728 "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
1729 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
1730 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
1731 { }, &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
1732 },
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
1733
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
1734 {
2014
a49f7e83edcb Fix FBI FLI Designer format names to match v1.x and v2.
Matti Hamalainen <ccr@tnsp.org>
parents: 1985
diff changeset
1735 "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
1736 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
1737 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
1738 { }, &dmC64CommonFormats[9]
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1739 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1740
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1741 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1742 "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
1743 NULL,
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1744 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
1745 { }, &dmC64CommonFormats[7]
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1746 },
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1747
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1748 {
1912
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1749 "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
1750 fmtProbeECIPacked,
1912
8d006508e6c1 Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1880
diff changeset
1751 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
1752 { }, &dmC64CommonFormats[7]
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1753 },
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1754
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1755 {
1979
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1756 "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
1757 NULL,
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1758 NULL, NULL,
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1759 { // 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
1760 D64_FMT_MC,
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1761 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1762 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1763 NULL, NULL,
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1764 NULL,
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1765 {
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1766 { 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
1767 { 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
1768 { 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
1769 { 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
1770 { 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
1771 { 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
1772 }
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1773 },
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1774 NULL
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1775 },
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1776
5fc3da6061be Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents: 1946
diff changeset
1777 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1778 "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
1779 NULL,
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1780 NULL, NULL,
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1781 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1782 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
1783 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1784 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1785 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1786 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1787 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1788 { 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
1789 { 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
1790 { 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
1791 { 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
1792 { 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
1793 }
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1794 },
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1795 NULL
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1796 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1797
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1798 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1799 "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
1800 fmtProbeFormatXX2,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1801 fmtDecodeFormatXX2, NULL,
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1802 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1803 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
1804 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
1805 XX2_WIDTH_CH , XX2_HEIGHT_CH,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1806 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1807 NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1808 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1809 { 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
1810 { 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
1811 { 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
1812 { 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
1813 { 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
1814 }
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1815 },
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1816 NULL
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1817 },
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1818
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1819 {
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
1820 "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, DM_FMT_RDWR,
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
1821 fmtProbeFunPaint2,
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
1822 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
1823 { }, &dmC64CommonFormats[3]
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1824 },
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1825
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1826 {
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
1827 "fp2p", "FunPaint II (packed)", 0x3ff0, 0, DM_FMT_RDWR,
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
1828 fmtProbeFunPaint2,
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
1829 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
1830 { }, &dmC64CommonFormats[3]
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1831 },
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1832
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1833 {
1776
aa427e68e114 Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents: 1775
diff changeset
1834 "gun", "GunPaint (unpacked)", 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
1835 fmtProbeGunPaint,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1836 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1837 {
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1838 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1839 C64_SCR_WIDTH, C64_SCR_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1840 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1841 NULL, NULL,
1850
3d6917948061 Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents: 1849
diff changeset
1842 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
1843 {
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1844 DEF_SCREEN_RAMS_8(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
1845 { 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
1846 { 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
1847 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL },
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1848 DEF_SCREEN_RAMS_8(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
1849 { 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
1850 // 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
1851 // 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
1852 { 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
1853 { DO_FUNC , 0 , 0x2742, 0, 1 , 0, fmtTruePaintGetLaceType, NULL },
3c6f638ce402 Remove the useless distinction of DO_ENC_FUNC and DO_DEC_FUNC, as the
Matti Hamalainen <ccr@tnsp.org>
parents: 1915
diff changeset
1854 { DO_FUNC , 0 , fmtGunPaintMagicOffs, 0, fmtGunPaintMagicLen, 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
1855 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL },
1805
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1856 }
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1857 },
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1858 NULL
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1859 },
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1860
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1861 {
1877
f8b7baf3ff89 Some fixes to HCB support, now the background colors are supported correctly.
Matti Hamalainen <ccr@tnsp.org>
parents: 1876
diff changeset
1862 "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
1863 NULL,
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1864 NULL, NULL,
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1865 {
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1866 D64_FMT_MC | D64_FMT_FLI,
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1867 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1868 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1869 NULL, NULL,
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1870 fmtGetPixelHCB,
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1871 {
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1872 { 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
1873 { 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
1874 { 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
1875 { 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
1876 { DO_COPY , DS_BITMAP_RAM , 0x1000, 0, 0, 0, NULL, NULL },
1877
f8b7baf3ff89 Some fixes to HCB support, now the background colors are supported correctly.
Matti Hamalainen <ccr@tnsp.org>
parents: 1876
diff changeset
1877 { DO_COPY , DS_EXTRA_DATA , 0x2f40, 0, C64_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
1878 { 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
1879 }
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1880 },
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1881 NULL
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1882 },
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1883
a35f6e19f57a Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents: 1861
diff changeset
1884 {
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
1885 "pen", "Pentel Paint (unpacked)", 0x4800, 19845, DM_FMT_RD | DM_FMT_BROKEN,
1805
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1886 NULL,
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1887 NULL, NULL,
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1888 {
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1889 D64_FMT_HIRES | D64_FMT_FLI,
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1890 192, C64_SCR_HEIGHT,
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1891 24, C64_SCR_CH_HEIGHT,
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1892 NULL, NULL,
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1893 fmtGetPixelPentelPaint,
c510bc979947 Reindent operator lists.
Matti Hamalainen <ccr@tnsp.org>
parents: 1804
diff changeset
1894 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1895 { 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
1896 { 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
1897 { 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
1898 { 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
1899 { DO_SET_MEM_LO , DS_COLOR_RAM , 0x9582 - 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
1900 { DO_COPY , DS_EXTRA_DATA , 0x5ac0 - 0x4800, 0, C64_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
1901 { 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
1902 }
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1903 },
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1904 NULL
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1905 },
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1906
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1907 {
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
1908 "chid", "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
1909 NULL,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1910 NULL, NULL,
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1911 {
1775
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1912 D64_FMT_HIRES | D64_FMT_FLI,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1913 C64_SCR_WIDTH, C64_SCR_HEIGHT, // Actually 296 x 112 (=14*8)
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1914 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1915 NULL, NULL,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1916 fmtGetPixelCrestHIFLIorCDHM,
4e4d54135baf Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents: 1773
diff changeset
1917 {
1846
88cef7758303 Implement data block offset in certain DMC64EncDecOps. This allows us to
Matti Hamalainen <ccr@tnsp.org>
parents: 1845
diff changeset
1918 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL },
1856
37cac290ce8b Allow override of block size in DEF_SCREEN_RAMS_8() and DEF_SCREEN_RAM() macros.
Matti Hamalainen <ccr@tnsp.org>
parents: 1855
diff changeset
1919 DEF_SCREEN_RAMS_8(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
1920 { 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
1921 }
1592
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1922 },
91d1bb571fca Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents: 1590
diff changeset
1923 NULL
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1924 },
1803
7df833754fd1 Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1802
diff changeset
1925
7df833754fd1 Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1802
diff changeset
1926 {
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
1927 "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
1928 fmtProbeCosmosDesignsHiresManager,
7df833754fd1 Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1802
diff changeset
1929 NULL, NULL,
7df833754fd1 Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1802
diff changeset
1930 { }, &dmC64CommonFormats[8]
7df833754fd1 Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents: 1802
diff changeset
1931 },
1503
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1932 };
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1933
c7b9ef56319b Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff changeset
1934 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
1935