Mercurial > hg > dmlib
annotate tools/lib64fmts.c @ 2368:4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 07 Jan 2020 17:40:26 +0200 |
parents | 36226425aac1 |
children | 82cb32297ed2 |
rev | line source |
---|---|
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1 /* |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2 * Functions for reading and converting various restricted |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
3 * C64/etc and/or indexed/paletted graphics formats. |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
4 * Programmed and designed by Matti 'ccr' Hamalainen |
2120 | 5 * (C) Copyright 2012-2019 Tecnic Software productions (TNSP) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
6 * |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
7 * Please read file 'COPYING' for information on license and distribution. |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
8 */ |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
9 #include "lib64gfx.h" |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
10 |
2080
7e4087e2740d
Define macros DM_MEMCMP_SIZE() and DM_MEMCMP_LEN() as helpers.
Matti Hamalainen <ccr@tnsp.org>
parents:
2056
diff
changeset
|
11 #define DM_MEMCMP_SIZE(mptr, mcmp) memcmp((mptr), (mcmp), sizeof(mcmp)) |
7e4087e2740d
Define macros DM_MEMCMP_SIZE() and DM_MEMCMP_LEN() as helpers.
Matti Hamalainen <ccr@tnsp.org>
parents:
2056
diff
changeset
|
12 #define DM_MEMCMP_LEN(mptr, mcmp) memcmp((mptr), (mcmp), strlen(mcmp)) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
13 |
2301
d71185584d95
Comment the necessity of fmtProbeGigapaintHires()..
Matti Hamalainen <ccr@tnsp.org>
parents:
2300
diff
changeset
|
14 |
d71185584d95
Comment the necessity of fmtProbeGigapaintHires()..
Matti Hamalainen <ccr@tnsp.org>
parents:
2300
diff
changeset
|
15 // Basic probe, but return MAX score for this format |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
16 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
|
17 { |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
18 if (buf->len == fmt->size && |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
19 dmCompareAddr16(buf, 0, fmt->addr)) |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
20 return DM_PROBE_SCORE_MAX; |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
21 |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
22 return DM_PROBE_SCORE_FALSE; |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
23 } |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
24 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
25 |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
26 // 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
|
27 // 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
|
28 // before actual image data, but do not seem to be used in the image itself. |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
29 static const Uint8 fmtMicroIllustrator_MagicID_1[] = |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
30 { |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
31 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
|
32 }; |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
33 |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
34 static const Uint8 fmtMicroIllustrator_MagicID_2[] = |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
35 { |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
36 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
|
37 }; |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
38 |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
39 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
|
40 { |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
41 if (buf->len == fmt->size && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
42 DM_MEMCMP_SIZE(buf->data + 2, fmtMicroIllustrator_MagicID_1) == 0 |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
43 && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
44 DM_MEMCMP_SIZE(buf->data + 9, fmtMicroIllustrator_MagicID_2) == 0 |
1983
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
45 ) |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
46 return DM_PROBE_SCORE_MAX; |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
47 |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
48 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
|
49 } |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
50 |
214c7bd8692f
Rename "MIL" to "Micro Illustrator" and improve probing of that format, at
Matti Hamalainen <ccr@tnsp.org>
parents:
1982
diff
changeset
|
51 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
52 static int fmtEncodeMicroIllustrator(const DMC64EncDecOp *op, DMGrowBuf *buf, |
1985
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
53 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
|
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 (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
|
56 (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
|
57 (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
|
58 |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
59 memcpy(buf->data + 2, fmtMicroIllustrator_MagicID_1, sizeof(fmtMicroIllustrator_MagicID_1)); |
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
60 memcpy(buf->data + 9, fmtMicroIllustrator_MagicID_2, sizeof(fmtMicroIllustrator_MagicID_2)); |
1985
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
61 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
62 return DMERR_OK; |
1985
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
63 } |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
64 |
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
65 |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
66 static const Uint8 fmtMarqPETSCII_ID1[] = |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
67 { |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
68 0x01, 0x08, 0x0b, 0x08, 0xef, 0x00, 0x9e, 0x32, 0x30, 0x36, |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
69 0x31, 0x00, 0x00, 0x00, 0xa9, 0x0b, 0x8d, 0x11, 0xd0, |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
70 }; |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
71 |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
72 static const Uint8 fmtMarqPETSCII_ID2[] = |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
73 { |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
74 0xa9, 0x00, 0x8d, 0x18, 0xd0, // lda #? : sta $d018 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
75 0xa9, 0x00, 0x8d, 0x20, 0xd0, // lda #? : sta $d020 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
76 0xa9, 0x00, 0x8d, 0x21, 0xd0, // lda #? : sta $d021 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
77 }; |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
78 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
79 static const Uint8 fmtMarqPETSCII_ID3[] = |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
80 { |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
81 0xa2, 0x00, 0xa0, 0xfa, 0xbd, 0x61, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
82 0x08, 0x9d, 0x00, 0x04, 0xbd, 0x5b, 0x09, 0x9d, 0xfa, 0x04, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
83 0xbd, 0x55, 0x0a, 0x9d, 0xf4, 0x05, 0xbd, 0x4f, 0x0b, 0x9d, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
84 0xee, 0x06, 0xbd, 0x49, 0x0c, 0x9d, 0x00, 0xd8, 0xbd, 0x43, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
85 0x0d, 0x9d, 0xfa, 0xd8, 0xbd, 0x3d, 0x0e, 0x9d, 0xf4, 0xd9, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
86 0xbd, 0x37, 0x0f, 0x9d, 0xee, 0xda, 0xe8, 0x88, 0xd0, 0xcc, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
87 0xa9, 0x1b, 0x8d, 0x11, 0xd0, 0x4c, 0x5e, 0x08, |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
88 }; |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
89 |
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
90 |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
91 static int fmtProbeMarqPETSCII(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
92 { |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
93 (void) fmt; |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
94 |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
95 if (buf->len == 2098 && |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
96 DM_MEMCMP_SIZE(buf->data, fmtMarqPETSCII_ID1) == 0 && |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
97 DM_MEMCMP_SIZE(buf->data + sizeof(fmtMarqPETSCII_ID1) + |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
98 sizeof(fmtMarqPETSCII_ID2), fmtMarqPETSCII_ID3) == 0 |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
99 ) |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
100 return DM_PROBE_SCORE_MAX; |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
101 |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
102 return DM_PROBE_SCORE_FALSE; |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
103 } |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
104 |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
105 |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
106 static int fmtDecodeHiresPETSCIICharsetData(const DMC64EncDecOp *op, DMC64Image *img, |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
107 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
108 { |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
109 (void) fmt; |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
110 Uint8 val; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
111 |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
112 switch (buf->data[op->offs]) |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
113 { |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
114 case 0x14: val = 0; break; // upper case |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
115 case 0x17: val = 1; break; // lower case |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
116 default: |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
117 return DMERR_INVALID_DATA; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
118 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
119 |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
120 img->extraInfo[D64_EI_CHAR_CASE] = val; |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
121 img->extraInfo[D64_EI_MODE] = D64_FMT_HIRES | D64_FMT_CHAR; |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
122 img->extraInfo[D64_EI_CHAR_CUSTOM] = 0; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
123 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
124 return DMERR_OK; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
125 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
126 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
127 |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
128 static int fmtEncodeHiresPETSCIICharsetData( |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
129 const DMC64EncDecOp *op, DMGrowBuf *buf, const DMC64Image *img) |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
130 { |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
131 Uint8 val; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
132 |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
133 switch (img->extraInfo[D64_EI_CHAR_CASE]) |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
134 { |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
135 case 0: val = 0x14; break; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
136 case 1: val = 0x17; break; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
137 default: return DMERR_INVALID_DATA; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
138 } |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
139 |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
140 buf->data[op->offs + 2] = val; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
141 |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
142 return DMERR_OK; |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
143 } |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
144 |
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
145 |
2366
1e6e018b6487
Rename some functions to be more consistent with their intent.
Matti Hamalainen <ccr@tnsp.org>
parents:
2363
diff
changeset
|
146 static int fmtEncodeMarqPETSCIIData(const DMC64EncDecOp *op, DMGrowBuf *buf, |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
147 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
148 { |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
149 (void) fmt; |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
150 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
151 memcpy(buf->data, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
152 fmtMarqPETSCII_ID1, sizeof(fmtMarqPETSCII_ID1)); |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
153 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
154 memcpy(buf->data + sizeof(fmtMarqPETSCII_ID1), |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
155 fmtMarqPETSCII_ID2, sizeof(fmtMarqPETSCII_ID2)); |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
156 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
157 memcpy(buf->data + sizeof(fmtMarqPETSCII_ID1) + sizeof(fmtMarqPETSCII_ID2), |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
158 fmtMarqPETSCII_ID3, sizeof(fmtMarqPETSCII_ID3)); |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
159 |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
160 return fmtEncodeHiresPETSCIICharsetData(op, buf, img); |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
161 } |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
162 |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
163 |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
164 static const Uint8 fmtPetsciiKrisszHu_ID1[] = |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
165 { |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
166 0x01, 0x08, 0x0b, 0x08, 0x0A, 0x00, 0x9E, 0x32, 0x30, 0x36, |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
167 0x31, 0x00, 0x00, 0x00, 0xA9, |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
168 }; |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
169 |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
170 static const Uint8 fmtPetsciiKrisszHu_ID2[] = |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
171 { |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
172 0x8d, 0x11, 0xd0, 0xa9, 0x80, 0x8d, 0x91, 0x02, 0xa9, 0x18, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
173 }; |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
174 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
175 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
176 static int fmtProbePetsciiKrisszHu(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
177 { |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
178 (void) fmt; |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
179 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
180 if (buf->len == 10193 && |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
181 DM_MEMCMP_SIZE(buf->data, fmtPetsciiKrisszHu_ID1) == 0 && |
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
182 DM_MEMCMP_SIZE(buf->data + 0x10, fmtPetsciiKrisszHu_ID2) == 0 |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
183 ) |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
184 return DM_PROBE_SCORE_MAX; |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
185 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
186 return DM_PROBE_SCORE_FALSE; |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
187 } |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
188 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
189 |
2366
1e6e018b6487
Rename some functions to be more consistent with their intent.
Matti Hamalainen <ccr@tnsp.org>
parents:
2363
diff
changeset
|
190 static int fmtDecodePetsciiKrisszHuData(const DMC64EncDecOp *op, DMC64Image *img, |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
191 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
192 { |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
193 (void) op; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
194 (void) buf; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
195 (void) fmt; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
196 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
197 const Uint8 *data = img->extraData[0].data; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
198 switch (data[0x0028 - 2]) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
199 { |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
200 case 0x00: |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
201 img->extraInfo[D64_EI_MODE] = D64_FMT_HIRES | D64_FMT_CHAR; |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
202 img->d020 = data[0x001e - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
203 img->bgcolor = data[0x0023 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
204 break; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
205 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
206 case 0xd8: |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
207 img->extraInfo[D64_EI_MODE] = D64_FMT_MC | D64_FMT_CHAR; |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
208 img->d020 = data[0x001e - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
209 img->bgcolor = data[0x0023 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
210 img->d022 = data[0x002d - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
211 img->d023 = data[0x0032 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
212 break; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
213 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
214 case 0x01: |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
215 img->extraInfo[D64_EI_MODE] = D64_FMT_ECM | D64_FMT_CHAR; |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
216 img->d020 = data[0x001e - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
217 img->bgcolor = data[0x0023 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
218 img->d022 = data[0x0028 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
219 img->d023 = data[0x002d - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
220 img->d024 = data[0x0032 - 2]; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
221 break; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
222 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
223 default: |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
224 return DMERR_INVALID_DATA; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
225 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
226 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
227 // XXX TODO this format saves the charset data (for 256 chars) |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
228 // in the PRG and there is no direct indication whether it is |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
229 // a customized one or copy of C64 ROM charset .. we could |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
230 // implement a hash-based detection at some point. |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
231 img->extraInfo[D64_EI_CHAR_CASE] = 0; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
232 img->extraInfo[D64_EI_CHAR_CUSTOM] = 1; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
233 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
234 return DMERR_OK; |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
235 } |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
236 |
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
237 |
2366
1e6e018b6487
Rename some functions to be more consistent with their intent.
Matti Hamalainen <ccr@tnsp.org>
parents:
2363
diff
changeset
|
238 static int fmtDecodeUPETSCIIData(const DMC64EncDecOp *op, DMC64Image *img, |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
239 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
240 { |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
241 (void) op; |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
242 (void) buf; |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
243 (void) fmt; |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
244 |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
245 img->extraInfo[D64_EI_MODE] = D64_FMT_HIRES | D64_FMT_CHAR; |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
246 img->extraInfo[D64_EI_CHAR_CUSTOM] = 0; |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
247 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
248 return DMERR_OK; |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
249 } |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
250 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
251 |
2367
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
252 static const Uint8 fmtCocaPETSCII_ID1[] = |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
253 { |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
254 0x01, 0x08, 0x0b, 0x08, 0x0a, 0x00, 0x9e, 0x32, 0x30, 0x36, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
255 0x31, 0x00, 0x00, 0x00, 0x78, 0xa2, 0x00, 0xbd, 0x5a, 0x08, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
256 0x9d, 0x00, 0x04, 0xbd, 0x5a, 0x09, 0x9d, 0x00, 0x05, 0xbd, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
257 0x5a, 0x0a, 0x9d, 0x00, 0x06, 0xbd, 0x5a, 0x0b, 0x9d, 0x00, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
258 0x07, 0xbd, 0x5a, 0x0c, 0x9d, 0x00, 0xd8, 0xbd, 0x5a, 0x0d, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
259 0x9d, 0x00, 0xd9, 0xbd, 0x5a, 0x0e, 0x9d, 0x00, 0xda, 0xbd, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
260 0x5a, 0x0f, 0x9d, 0x00, 0xdb, 0xe8, 0xd0, 0xcd, 0xad, 0x42, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
261 0x0c, 0x8d, 0x20, 0xd0, 0xad, 0x43, 0x0c, 0x8d, 0x21, 0xd0, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
262 0xad, 0x44, 0x0c, 0x8d, 0x18, 0xd0, 0x4c, 0x55, 0x08 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
263 }; |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
264 |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
265 |
2367
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
266 static int fmtProbeCocaPETSCII(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
267 { |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
268 (void) fmt; |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
269 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
270 if (buf->len == 2115 && |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
271 DM_MEMCMP_SIZE(buf->data, fmtCocaPETSCII_ID1) == 0 && |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
272 buf->data[0x0c44 - 0x0801 + 2] == 0x14) |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
273 return DM_PROBE_SCORE_MAX; |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
274 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
275 return DM_PROBE_SCORE_FALSE; |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
276 } |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
277 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
278 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
279 static int fmtEncodeCocaPETSCIIData(const DMC64EncDecOp *op, DMGrowBuf *buf, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
280 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
281 { |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
282 (void) fmt; |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
283 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
284 memcpy(buf->data, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
285 fmtCocaPETSCII_ID1, sizeof(fmtCocaPETSCII_ID1)); |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
286 |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
287 return fmtEncodeHiresPETSCIICharsetData(op, buf, img); |
2367
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
288 } |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
289 |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
290 |
2015
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
291 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
|
292 { |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
293 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
|
294 |
2112
9dc2976e9fa3
Improve probing of packed and unpacked Koala files. Many converters and
Matti Hamalainen <ccr@tnsp.org>
parents:
2080
diff
changeset
|
295 if (buf->len == 10003 || |
9dc2976e9fa3
Improve probing of packed and unpacked Koala files. Many converters and
Matti Hamalainen <ccr@tnsp.org>
parents:
2080
diff
changeset
|
296 buf->len == 10004) |
2015
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
297 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
|
298 |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
299 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
|
300 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
|
301 |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
302 return score; |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
303 } |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
304 |
c5a88bb4ee3f
Improve unpacked Koala Painter format support for variants that have a
Matti Hamalainen <ccr@tnsp.org>
parents:
2014
diff
changeset
|
305 |
1815
2b68b6955635
Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents:
1813
diff
changeset
|
306 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
|
307 { |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
308 // 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
|
309 if (buf->len > 30 && |
2112
9dc2976e9fa3
Improve probing of packed and unpacked Koala files. Many converters and
Matti Hamalainen <ccr@tnsp.org>
parents:
2080
diff
changeset
|
310 buf->len < 10002 && |
1594
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
311 dmCompareAddr16(buf, 0, fmt->addr)) |
1771 | 312 return DM_PROBE_SCORE_GOOD; |
1594
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
313 |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
314 return DM_PROBE_SCORE_FALSE; |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
315 } |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
316 |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
317 |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
318 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
|
319 { |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
320 if (buf->len > 32 && |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
321 (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
|
322 { |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
323 // 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
|
324 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
|
325 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
|
326 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
|
327 return DM_PROBE_SCORE_MAX; |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
328 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
329 // Unpacked variant |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
330 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
|
331 return DM_PROBE_SCORE_MAX; |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
332 } |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
333 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
334 return DM_PROBE_SCORE_FALSE; |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
335 } |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
336 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
337 |
2161
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
338 static int fmtProbeArtStudio(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
339 { |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
340 if ((buf->len == fmt->size || buf->len == 9002) && |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
341 dmCompareAddr16(buf, 0, 0x2000)) |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
342 return DM_PROBE_SCORE_MAX; |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
343 |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
344 return DM_PROBE_SCORE_FALSE; |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
345 } |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
346 |
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
347 |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
348 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
|
349 { |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
350 int res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
351 DMGrowBuf mem; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
352 DMCompParams cfg; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
353 |
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
|
354 cfg.func = fmt->name; |
1712 | 355 cfg.type = DM_COMP_RLE_MARKER; |
356 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
|
357 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
|
358 |
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
359 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
|
360 goto out; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
361 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
362 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
|
363 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
364 out: |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
365 dmGrowBufFree(&mem); |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
366 return res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
367 } |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
368 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
369 |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
370 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
|
371 { |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
372 int res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
373 DMGrowBuf tmp; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
374 DMCompParams cfg; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
375 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
376 // 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
|
377 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
|
378 goto out; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
379 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
380 // 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
|
381 cfg.func = fmt->name; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
382 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
|
383 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
|
384 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
|
385 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
386 cfg.rleMaxCountB = 255; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
387 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
|
388 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
389 out: |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
390 dmGrowBufFree(&tmp); |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
391 return res; |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
392 } |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
393 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
394 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
395 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
|
396 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
397 const Uint8 *ident = buf->data + 2; |
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
398 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
|
399 dmCompareAddr16(buf, 0, fmt->addr) && |
2080
7e4087e2740d
Define macros DM_MEMCMP_SIZE() and DM_MEMCMP_LEN() as helpers.
Matti Hamalainen <ccr@tnsp.org>
parents:
2056
diff
changeset
|
400 DM_MEMCMP_LEN(ident, "DRAZPAINT ") == 0 && |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
401 ident[11] == '.' && ( |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
402 (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
|
403 (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
|
404 )) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
405 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
|
406 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
407 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
|
408 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
409 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
410 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
411 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
|
412 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
413 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
414 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
|
415 DMCompParams cfg; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
416 |
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
|
417 cfg.func = fmt->name; |
1712 | 418 cfg.type = DM_COMP_RLE_MARKER; |
419 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; | |
420 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
|
421 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
422 if ((res = dmDecodeGenericRLEAlloc(&mem, |
1747
5e928618fdc8
Change DMGrowBuf API somewhat and implement more copy operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
1746
diff
changeset
|
423 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
|
424 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
425 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
426 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
|
427 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
428 out: |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
429 dmGrowBufFree(&mem); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
430 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
431 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
432 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
433 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
434 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
|
435 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
436 int res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
437 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
|
438 DMCompParams cfg; |
2265
48b48251610a
Refactor how the image "mode/type" is handled. It is still not perfect for
Matti Hamalainen <ccr@tnsp.org>
parents:
2238
diff
changeset
|
439 const char *magicID = (fmt->format->mode & D64_FMT_ILACE) ? "DRAZLACE! 1.0" : "DRAZPAINT 2.0"; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
440 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
441 // 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
|
442 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
|
443 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
444 |
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
|
445 // 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
|
446 cfg.func = fmt->name; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
447 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
|
448 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
|
449 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
450 cfg.rleMaxCountB = 255; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
451 |
2329
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
452 if ((res = dmGenericRLEAnalyze(&tmp, &cfg)) != DMERR_OK) |
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
453 goto out; |
1661
dc3fbd130db7
RLE analyze was ran before setting up the compression config. Oops. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1660
diff
changeset
|
454 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
455 // 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
|
456 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
|
457 !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
|
458 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
459 res = DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
460 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
461 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
462 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
463 // 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
|
464 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
|
465 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
466 out: |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
467 dmGrowBufFree(&tmp); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
468 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
469 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
470 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
471 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
472 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
|
473 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
474 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
|
475 dmCompareAddr16(buf, 0, fmt->addr) && |
2080
7e4087e2740d
Define macros DM_MEMCMP_SIZE() and DM_MEMCMP_LEN() as helpers.
Matti Hamalainen <ccr@tnsp.org>
parents:
2056
diff
changeset
|
476 DM_MEMCMP_LEN(buf->data + 2, "DRAZLACE! 1.0") == 0) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
477 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
|
478 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
479 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
|
480 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
481 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
482 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
483 static int fmtDrazLaceGetLaceType(const DMC64EncDecOp *op, DMC64Image *img, |
1984
e7f2ddaf94a6
Change encode and decode function format parameter type from DMC64ImageFormat to DMC64ImageCommonFormat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1983
diff
changeset
|
484 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
|
485 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
486 (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
|
487 |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
488 img->extraInfo[D64_EI_ILACE_TYPE] = buf->data[op->offs] ? D64_ILACE_RES : D64_ILACE_COLOR; |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
489 return DMERR_OK; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
490 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
491 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
492 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
493 static int fmtDrazLaceSetLaceType(const DMC64EncDecOp *op, DMGrowBuf *buf, |
1984
e7f2ddaf94a6
Change encode and decode function format parameter type from DMC64ImageFormat to DMC64ImageCommonFormat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1983
diff
changeset
|
494 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) |
1535 | 495 { |
496 (void) fmt; | |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
497 buf->data[op->offs] = (img->extraInfo[D64_EI_ILACE_TYPE] == D64_ILACE_RES) ? 1 : 0; |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
498 return DMERR_OK; |
1535 | 499 } |
500 | |
501 | |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
502 static int fmtGetPixelDrazLace(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
503 const DMC64Image *img, const int rasterX, const int rasterY) |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
504 { |
2313
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
505 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
506 (void) vshift; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
507 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
508 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 509 bmoffs, scroffs, |
2313
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
510 6 - (rasterX & 6), 0, |
2133 | 511 rasterX & 1, 0, img->bgcolor); |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
512 } |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
513 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
514 |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
515 static const char *fmtBDP5_MagicID = "BDP 5.00"; |
1662 | 516 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
517 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
|
518 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
519 if (buf->len > 20 && |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
520 dmCompareAddr16(buf, 0, fmt->addr) && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
521 DM_MEMCMP_LEN(buf->data + 2, fmtBDP5_MagicID) == 0) |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
522 return DM_PROBE_SCORE_MAX; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
523 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
524 return DM_PROBE_SCORE_FALSE; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
525 } |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
526 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
527 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
528 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
|
529 { |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
530 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
531 DMGrowBuf mem, tmp; |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
532 DMCompParams cfg; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
533 |
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
|
534 cfg.func = fmt->name; |
1712 | 535 cfg.type = DM_COMP_RLE_MARKER; |
536 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_WORD_RUNS | DM_RLE_ORDER_1; | |
537 cfg.rleMarkerB = buf->data[8]; | |
538 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
|
539 |
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
|
540 // 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
|
541 // 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
|
542 // 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
|
543 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
|
544 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
|
545 |
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
|
546 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
|
547 |
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
|
548 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
|
549 goto out; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
550 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
551 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
|
552 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
553 out: |
1792
905c09049fe6
Oops, forgot to free the buffer allocated in the BDP5 decoder. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1791
diff
changeset
|
554 dmGrowBufFree(&tmp); |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
555 dmGrowBufFree(&mem); |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
556 return res; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
557 } |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
558 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
559 |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
560 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
|
561 { |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
562 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
563 DMGrowBuf mem; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
564 DMCompParams cfg; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
565 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
566 // 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
|
567 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
|
568 goto out; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
569 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
570 // 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
|
571 cfg.func = fmt->name; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
572 cfg.type = DM_COMP_RLE_MARKER; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
573 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
|
574 cfg.rleMinCountB = 4; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
575 cfg.rleMaxCountB = 255; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
576 cfg.rleMinCountW = 256; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
577 cfg.rleMaxCountW = 1024; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
578 |
2329
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
579 if ((res = dmGenericRLEAnalyze(&mem, &cfg)) != DMERR_OK) |
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
580 goto out; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
581 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
582 // Add the header bits |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
583 if (!dmGrowBufPut(buf, (Uint8 *) fmtBDP5_MagicID, strlen(fmtBDP5_MagicID)) || |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
584 !dmGrowBufPutU8(buf, cfg.rleMarkerB) || |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
585 !dmGrowBufPutU8(buf, cfg.rleMarkerW)) |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
586 { |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
587 res = DMERR_MALLOC; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
588 goto out; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
589 } |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
590 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
591 // 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
|
592 res = dmEncodeGenericRLE(buf, &mem, &cfg); |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
593 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
594 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
595 dmGrowBufFree(&mem); |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
596 return res; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
597 } |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
598 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
599 |
2185
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
600 static const char *fmtGunPaint_MagicID = "GUNPAINT (JZ) "; |
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
601 #define fmtGunPaint_MagicLen (16) |
6ba6ca5632d2
Make GunPaint v1.1 writing more accurate.
Matti Hamalainen <ccr@tnsp.org>
parents:
2178
diff
changeset
|
602 #define fmtGunPaint_MagicOffs (0x03e8) |
1776
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
603 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
604 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
|
605 { |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
606 if (buf->len > fmtGunPaint_MagicOffs + fmtGunPaint_MagicLen && |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
607 dmCompareAddr16(buf, 0, fmt->addr) && |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
608 memcmp(buf->data + fmtGunPaint_MagicOffs + 2, fmtGunPaint_MagicID, fmtGunPaint_MagicLen) == 0) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
609 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
|
610 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
611 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
|
612 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
613 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
614 |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
615 static int fmtEncodeGunPaint(const DMC64EncDecOp *op, DMGrowBuf *buf, |
1984
e7f2ddaf94a6
Change encode and decode function format parameter type from DMC64ImageFormat to DMC64ImageCommonFormat.
Matti Hamalainen <ccr@tnsp.org>
parents:
1983
diff
changeset
|
616 const DMC64Image *img, const DMC64ImageCommonFormat *fmt) |
1776
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
617 { |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
618 (void) op; |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
619 (void) img; |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
620 (void) fmt; |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
621 |
1946 | 622 // Here we assume that the op triggering this function is |
623 // at the end of the oplist, so the memory is allocated, | |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
624 memcpy(buf->data + fmtGunPaint_MagicOffs + 2, fmtGunPaint_MagicID, fmtGunPaint_MagicLen); |
2114
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
625 |
27cf33c3a646
Return actual error code from enc and dec functions instead of just BOOL.
Matti Hamalainen <ccr@tnsp.org>
parents:
2113
diff
changeset
|
626 return DMERR_OK; |
1776
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
627 } |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
628 |
aa427e68e114
Theoretically fix Gun Paint format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1775
diff
changeset
|
629 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
630 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
|
631 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
632 size_t i, n; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
633 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
634 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
|
635 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
|
636 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
637 // 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
|
638 // as do some GunPaint images .. |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
639 if (buf->len == 9002 || |
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
640 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
|
641 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
|
642 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
643 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
|
644 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
|
645 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
646 if (n > 50) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
647 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
|
648 if (n > 25) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
649 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
|
650 if (n > 10) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
651 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
|
652 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
653 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
|
654 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
655 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
656 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
657 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
|
658 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
659 int res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
660 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
|
661 DMCompParams cfg; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
662 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
663 // 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
|
664 // 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
|
665 if (dmGrowBufCopy(&tmp, buf, 1) == NULL) |
768fddda73e9
Convert fmtDecodeAmicaPaintPacked() to use the new DMGrowBuf functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1749
diff
changeset
|
666 return DMERR_MALLOC; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
667 |
1751
768fddda73e9
Convert fmtDecodeAmicaPaintPacked() to use the new DMGrowBuf functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1749
diff
changeset
|
668 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
|
669 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
670 // 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
|
671 cfg.func = fmt->name; |
1712 | 672 cfg.type = DM_COMP_RLE_MARKER; |
673 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; | |
674 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
|
675 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
676 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
|
677 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
678 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
679 // 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
|
680 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
|
681 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
682 out: |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
683 dmGrowBufFree(&tmp); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
684 dmGrowBufFree(&mem); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
685 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
686 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
687 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
688 |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
689 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
|
690 { |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
691 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
692 DMGrowBuf mem; |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
693 DMCompParams cfg; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
694 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
695 // 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
|
696 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
|
697 goto out; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
698 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
699 // 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
|
700 cfg.func = fmt->name; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
701 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
|
702 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
|
703 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
|
704 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
705 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
|
706 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
707 res = dmEncodeGenericRLE(buf, &mem, &cfg); |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
708 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
709 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
710 dmGrowBufFree(&mem); |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
711 return res; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
712 } |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
713 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
714 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
715 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
|
716 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
717 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
|
718 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
|
719 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
|
720 |
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
721 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
|
722 } |
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
723 |
5d7c89ad0bb4
Improve Saracen Paint support by adding a probe function that accounts for
Matti Hamalainen <ccr@tnsp.org>
parents:
1771
diff
changeset
|
724 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
725 static int fmtGetPixelFLIDesigner(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
726 const DMC64Image *img, const int rasterX, const int rasterY) |
1806
dcb12cd340d3
Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1805
diff
changeset
|
727 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
728 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
729 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
730 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 731 bmoffs, scroffs, |
732 vshift, rasterY & 7, | |
733 0, 0, img->bgcolor); | |
1806
dcb12cd340d3
Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1805
diff
changeset
|
734 } |
dcb12cd340d3
Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1805
diff
changeset
|
735 |
dcb12cd340d3
Add missing Pentel Paint getpixel function.
Matti Hamalainen <ccr@tnsp.org>
parents:
1805
diff
changeset
|
736 |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
737 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
|
738 { |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
739 if (buf->len > 16 && |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
740 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
|
741 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
|
742 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
|
743 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
|
744 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
745 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
|
746 } |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
747 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
748 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
749 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
|
750 { |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
751 int res; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
752 DMGrowBuf dst, src; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
753 DMCompParams cfg; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
754 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
755 cfg.func = fmt->name; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
756 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
|
757 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
|
758 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
|
759 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
|
760 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
|
761 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
762 // 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
|
763 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
|
764 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
765 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
|
766 goto out; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
767 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
768 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
|
769 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
770 out: |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
771 dmGrowBufFree(&dst); |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
772 return res; |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
773 } |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
774 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
775 |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
776 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
|
777 { |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
778 int res; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
779 DMGrowBuf tmp1, tmp2; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
780 DMCompParams cfg; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
781 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
782 dmGrowBufInit(&tmp1); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
783 dmGrowBufInit(&tmp2); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
784 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
785 // 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
|
786 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
|
787 goto out; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
788 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
789 // 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
|
790 cfg.func = fmt->name; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
791 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
|
792 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
|
793 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
|
794 cfg.rleMinCountB = 4; |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
795 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
|
796 |
2329
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
797 if ((res = dmGenericRLEAnalyze(&tmp1, &cfg)) != DMERR_OK) |
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
798 goto out; |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
799 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
800 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
|
801 goto out; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
802 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
803 // 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
|
804 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
|
805 !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
|
806 !dmGrowBufPutU16LE(buf, 0x7f3f) || |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
807 !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
|
808 { |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
809 res = DMERR_MALLOC; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
810 goto out; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
811 } |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
812 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
813 out: |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
814 dmGrowBufFree(&tmp1); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
815 dmGrowBufFree(&tmp2); |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
816 return res; |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
817 } |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
818 |
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
819 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
820 static int fmtGetPixelBlackMailFLI(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
821 const DMC64Image *img, const int rasterX, const int rasterY) |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
822 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
823 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
824 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
825 Uint8 bgcol = (unsigned) rasterY < img->extraData[0].size ? |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
826 img->extraData[0].data[rasterY] : img->bgcolor; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
827 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
828 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 829 bmoffs, scroffs, |
830 vshift, rasterY & 7, | |
2222
75b5bb490f38
Add & 15 to deeper helper functions and remove it from unnecessary places.
Matti Hamalainen <ccr@tnsp.org>
parents:
2208
diff
changeset
|
831 0, 0, bgcol); |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
832 } |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
833 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
834 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
835 static int fmtGetPixelTruePaint(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
836 const DMC64Image *img, const int rasterX, const int rasterY) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
837 { |
2313
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
838 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
839 (void) vshift; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
840 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
841 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 842 bmoffs, scroffs, |
2313
866e036d7706
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2311
diff
changeset
|
843 6 - (rasterX & 6), 0, |
2133 | 844 rasterX & 1, 0, img->bgcolor); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
845 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
846 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
847 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
848 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
|
849 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
850 // 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
|
851 // relocation of decompression code |
1684 | 852 static const Uint8 magicID[] = { |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
853 0x0b, 0x08, 0x09, 0x00, 0x9e, 0x32, 0x30, 0x35, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
854 0x39, 0x00, 0xa2, 0x00, 0x78, 0xbd, 0x1c, 0x08, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
855 0x9d, 0xf5, 0x00, 0xe8, 0xd0, 0xf7, 0xe6, 0x01, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
856 0x4c, 0x01, 0x01, 0xa5, 0xfe, 0xd0, 0x02, 0xc6, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
857 0xff, 0xc6, 0xfe |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
858 }; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
859 |
1789
9f5c5ab0e85e
Adjust True Paint probing to be slightly more forgiving vs. file size.
Matti Hamalainen <ccr@tnsp.org>
parents:
1788
diff
changeset
|
860 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
|
861 dmCompareAddr16(buf, 0, fmt->addr) && |
2080
7e4087e2740d
Define macros DM_MEMCMP_SIZE() and DM_MEMCMP_LEN() as helpers.
Matti Hamalainen <ccr@tnsp.org>
parents:
2056
diff
changeset
|
862 DM_MEMCMP_SIZE(buf->data + 2, magicID) == 0) |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
863 return DM_PROBE_SCORE_MAX; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
864 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
865 return DM_PROBE_SCORE_FALSE; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
866 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
867 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
868 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
869 // |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
870 // 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
|
871 // 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
|
872 // simplistic "codebook". |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
873 // |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
874 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
|
875 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
876 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
|
877 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
878 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
|
879 "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
|
880 } |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
881 else |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
882 return DMERR_OK; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
883 } |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
884 |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
885 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
886 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
|
887 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
888 int res = DMERR_OK; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
889 const Uint8 *codeBook1, *codeBook2; |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
890 DMGrowBuf dst, src; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
891 DMCompParams cfg; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
892 Uint8 data; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
893 |
1724 | 894 // 1b7e-67e8 decoded by original depacker |
895 // 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
|
896 cfg.func = fmt->name; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
897 cfg.type = DM_COMP_RLE_MARKER; |
1724 | 898 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
|
899 cfg.rleMarkerB = 0xfe; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
900 cfg.cropOutLen = 0x67e8 - 0x1c00; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
901 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
902 // 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
|
903 codeBook1 = psrc->data + 0x81 - 2; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
904 codeBook2 = psrc->data + 0x85 - 2; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
905 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
906 // Allocate output buffer |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
907 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
|
908 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
909 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
910 // 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
|
911 // 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
|
912 dmGrowBufConstCopy(&src, psrc); |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
913 dmSetupRLEBuffers(&dst, &src, &cfg); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
914 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
915 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
|
916 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
917 unsigned int count = 1; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
918 BOOL found = FALSE; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
919 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
920 for (int n = 0; n < 8; n++) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
921 if (codeBook1[n] == data && !found) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
922 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
923 found = TRUE; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
924 switch (n) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
925 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
926 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
|
927 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
|
928 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
929 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
930 count = data; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
931 if (data == 0) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
932 goto finish; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
933 |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
934 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
935 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
936 case 1: // Y = 1, JTO = $17 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
937 count += 2; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
938 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
939 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
940 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
|
941 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
|
942 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
943 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
944 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
945 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
|
946 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
|
947 goto out; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
948 |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
949 count = data; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
950 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
951 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
952 case 3: // Y = 3, JTO = $0B |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
953 count += 2; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
954 data = 0; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
955 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
956 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
957 default: // Y = [5..8], JTO = $00 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
958 count++; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
959 data = codeBook2[n]; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
960 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
961 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
962 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
963 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
964 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
|
965 goto out; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
966 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
967 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
968 finish: |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
969 dmFinishRLEBuffers(&dst, &src, &cfg); |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
970 res = dmC64DecodeGenericBMP(img, &dst, fmt); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
971 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
972 out: |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
973 dmGrowBufFree(&dst); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
974 return res; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
975 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
976 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
977 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
978 static int fmtGetPixelFlinterlazer(DMC64ScanLine *scan, |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
979 const DMC64Image *img, const int rasterX, const int rasterY) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
980 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
981 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
982 const int vbank = rasterY & 7; |
2302 | 983 Uint8 color1, color2, bgcol = img->bgcolor; |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
984 int res; |
2300
a494e4a4b6bc
Minor improvements to Flinterlazer support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2299
diff
changeset
|
985 |
a494e4a4b6bc
Minor improvements to Flinterlazer support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2299
diff
changeset
|
986 if ((res = dmC64GetGenericMCPixel(&color1, img, bmoffs, scroffs, vshift, vbank , 0, 0, bgcol)) != DMERR_OK || |
a494e4a4b6bc
Minor improvements to Flinterlazer support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2299
diff
changeset
|
987 (res = dmC64GetGenericMCPixel(&color2, img, bmoffs, scroffs, vshift, vbank + 8, 1, 0, bgcol)) != DMERR_OK) |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
988 return res; |
2300
a494e4a4b6bc
Minor improvements to Flinterlazer support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2299
diff
changeset
|
989 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
990 *(scan->col) = (color1 * D64_NCOLORS) + color2; |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
991 return DMERR_OK; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
992 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
993 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
994 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
995 enum |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
996 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
997 I_BRK = 0x00, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
998 I_RTS = 0x60, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
999 I_LDA_IMD = 0xa9, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1000 I_STA_ABS = 0x8d, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1001 }; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1002 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1003 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1004 static int fmtDecode6502SpeedCode(const DMGrowBuf *buf, DMC64Image *img, const int cbank) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1005 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1006 size_t reg_pc = 0; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1007 Uint8 reg_accu = 0;//, reg_x = 0, reg_y = 0; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1008 Uint16 reg_ptr; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1009 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1010 while (reg_pc < buf->size) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1011 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1012 Uint8 instr = buf->data[reg_pc++]; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1013 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1014 switch (instr) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1015 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1016 case I_LDA_IMD: |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1017 if (reg_pc >= buf->size) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1018 goto out; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1019 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1020 reg_accu = buf->data[reg_pc++]; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1021 break; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1022 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1023 case I_STA_ABS: |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1024 if (reg_pc >= buf->size) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1025 goto out; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1026 reg_ptr = buf->data[reg_pc++]; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1027 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1028 if (reg_pc >= buf->size) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1029 goto out; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1030 reg_ptr |= buf->data[reg_pc++] << 8; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1031 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1032 if (reg_ptr >= 0xd800 && reg_ptr <= 0xdbff) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1033 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1034 img->color[cbank].data[reg_ptr - 0xd800] = reg_accu; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1035 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1036 break; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1037 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1038 case I_RTS: |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1039 return DMERR_OK; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1040 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1041 default: |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1042 return DMERR_INVALID_DATA; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1043 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1044 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1045 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1046 out: |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1047 return DMERR_INVALID_DATA; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1048 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1049 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1050 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1051 static int fmtDecodeFlinterlazer(const DMC64EncDecOp *op, DMC64Image *img, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1052 const DMGrowBuf *buf, const DMC64ImageCommonFormat *fmt) |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1053 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1054 DMGrowBuf tmp; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1055 (void) op; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1056 (void) fmt; |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1057 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1058 // Flinterlazer stores color RAMs as speedcode, so we need to |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1059 // decode some 6510 instructions to get the data. |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1060 return fmtDecode6502SpeedCode( |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1061 dmGrowBufConstCopyOffsSize(&tmp, buf, 0, 0x17b2), img, 0); |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1062 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1063 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
1064 |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1065 #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
|
1066 #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
|
1067 #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
|
1068 #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
|
1069 #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
|
1070 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1071 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1072 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
|
1073 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1074 if (buf->len >= XX2_MIN_SIZE && |
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1075 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
|
1076 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
|
1077 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
|
1078 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1079 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
|
1080 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1081 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1082 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1083 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
|
1084 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1085 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1086 DMGrowBuf tmp; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1087 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1088 // 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
|
1089 // 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
|
1090 // 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
|
1091 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
|
1092 return DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1093 |
1748
9c4b3fecc510
Use the new DMGrowBuf functions in XX2 format buffer enlarging.
Matti Hamalainen <ccr@tnsp.org>
parents:
1747
diff
changeset
|
1094 tmp.len = tmp.size; |
9c4b3fecc510
Use the new DMGrowBuf functions in XX2 format buffer enlarging.
Matti Hamalainen <ccr@tnsp.org>
parents:
1747
diff
changeset
|
1095 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
|
1096 dmGrowBufFree(&tmp); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1097 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1098 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1099 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1100 |
1812
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1101 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
|
1102 { |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1103 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
|
1104 { |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1105 // Packed variant |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1106 if (fmt->size == 0 && |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1107 dmCompareAddr16(buf, 2, fmt->addr + buf->len - 3) && |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1108 dmCompareAddr16(buf, 4, 0x7ff2)) |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1109 return DM_PROBE_SCORE_MAX; |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1110 |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1111 // Unpacked variant |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1112 if (fmt->size != 0 && fmt->size == buf->len) |
2168
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1113 { |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1114 // In the unpacked format the first 0x40 bytes should be 0xff |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1115 for (size_t offs = 2; offs < 0x42; offs++) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1116 if (buf->data[offs] != 0xff) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1117 return DM_PROBE_SCORE_GOOD; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1118 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1119 return DM_PROBE_SCORE_MAX; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1120 } |
1812
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1121 } |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1122 |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1123 return DM_PROBE_SCORE_FALSE; |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1124 } |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1125 |
7460a9b804e9
Oops. Add missing fmtProbeCosmosDesignsHiresManager() function. :S
Matti Hamalainen <ccr@tnsp.org>
parents:
1806
diff
changeset
|
1126 |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1127 static int fmtDecodeCosmosDesignsHiresManagerPacked(DMC64Image *img, const DMGrowBuf *psrc, const DMC64ImageFormat *fmt) |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1128 { |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1129 int res; |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1130 DMGrowBuf tmp; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1131 Uint8 data, *dstBuf; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1132 const size_t baseAddr = 0x4000; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1133 const size_t dstSize = 0x8000 - baseAddr; |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1134 size_t dstOffs, srcOffs, ncount; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1135 |
2149 | 1136 // Allocate output buffer |
1137 if ((dstBuf = dmMalloc0(dstSize)) == NULL) | |
1138 { | |
1139 return dmError(DMERR_MALLOC, | |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1140 "Could not allocate memory for RLE decoding buffer.\n"); |
2149 | 1141 } |
1142 | |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1143 // Setup input and output offsets |
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1144 srcOffs = psrc->len - 1; |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1145 dstOffs = 0x7ff2 - baseAddr - 1; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1146 |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1147 while (dstOffs > 0 && srcOffs > 0) |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1148 { |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1149 // Get one byte of data |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1150 data = psrc->data[srcOffs]; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1151 |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1152 // Current data byte tells us the mode |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1153 if (data == 0) |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1154 { |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1155 // RLE run |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1156 if (srcOffs < 3) |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1157 { |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1158 res = dmError(DMERR_INVALID_DATA, |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1159 "RLE: Invalid data/out of data for run sequence.\n"); |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1160 goto out; |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1161 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1162 |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1163 ncount = psrc->data[--srcOffs]; |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1164 data = psrc->data[--srcOffs]; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1165 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1166 if (dstOffs < ncount) |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1167 goto finish; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1168 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1169 dstOffs -= ncount; |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1170 |
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1171 for (size_t n = 0; n < ncount + 1; n++) |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1172 dstBuf[dstOffs + n] = data; |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1173 |
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1174 srcOffs--; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1175 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1176 else |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1177 { |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1178 // Literal run of data bytes |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1179 ncount = data; |
2150
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1180 if (srcOffs < ncount) |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1181 ncount = srcOffs; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1182 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1183 if (dstOffs < ncount) |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1184 ncount = dstOffs; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1185 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1186 srcOffs -= ncount; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1187 dstOffs -= ncount - 1; |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1188 |
b4fbb90937f7
Fix Cosmos Designs Hires Manager unpacker. What a mess. Ugh.
Matti Hamalainen <ccr@tnsp.org>
parents:
2149
diff
changeset
|
1189 for (size_t n = 0; n < ncount; n++) |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
1190 dstBuf[dstOffs + n] = psrc->data[srcOffs + n]; |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1191 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1192 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1193 |
2149 | 1194 finish: |
1195 | |
2152
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1196 // Fixups that the original decoder does, not necessary really |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1197 dstBuf[0x7ff0 - baseAddr] = 0x03; |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1198 dstBuf[0x7ffe - baseAddr] = dstBuf[4]; |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1199 |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1200 for (size_t n = 0; n < 0x40; n++) |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1201 dstBuf[n] = 0xff; |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1202 |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1203 for (size_t n = 0; n < 0x100; n++) |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1204 dstBuf[0x40 + n] = 0x00; |
44d7e8e2483c
Add in some fixups that the original CDHM decoder does, although these seem to be unnecessary.
Matti Hamalainen <ccr@tnsp.org>
parents:
2151
diff
changeset
|
1205 |
2188 | 1206 res = dmC64DecodeGenericBMP(img, dmGrowBufConstCreateFrom(&tmp, dstBuf, dstSize), fmt); |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1207 |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1208 out: |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1209 dmFree(dstBuf); |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1210 return res; |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1211 } |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1212 |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
1213 |
2188 | 1214 static const char *fmtFunPaint2_MagicID = "FUNPAINT (MT) "; |
1215 #define fmtFunPaint2_Header_Size (0x10) | |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1216 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1217 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1218 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
|
1219 { |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1220 if (buf->len > 30 && |
2188 | 1221 DM_MEMCMP_LEN(buf->data + 2, fmtFunPaint2_MagicID) == 0) |
1777
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1222 { |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1223 // Unpacked variant |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1224 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
|
1225 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
|
1226 |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1227 // Packed variant |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1228 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
|
1229 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
|
1230 } |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1231 |
a7f9e12bcd9b
Improve probing of FunPaint 2 packed vs. unpacked format variants.
Matti Hamalainen <ccr@tnsp.org>
parents:
1776
diff
changeset
|
1232 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
|
1233 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1234 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1235 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1236 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
|
1237 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1238 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1239 DMGrowBuf tmp; |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1240 |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1241 // 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
|
1242 if (buf->data[14]) |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1243 { |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1244 DMGrowBuf mem; |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1245 DMCompParams cfg; |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1246 |
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
|
1247 cfg.func = fmt->name; |
1712 | 1248 cfg.type = DM_COMP_RLE_MARKER; |
1249 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; | |
1250 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
|
1251 |
2188 | 1252 dmGrowBufCopyOffs(&tmp, buf, fmtFunPaint2_Header_Size, 1); |
1749
feaf5cf07603
Apparently Fun Paint 2 also saves one byte less than it should with the
Matti Hamalainen <ccr@tnsp.org>
parents:
1748
diff
changeset
|
1253 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
|
1254 |
1598
b5e0f28f1842
Adjust Fun Paint 2 decoding now that the RLE decoding is fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1594
diff
changeset
|
1255 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
|
1256 &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
|
1257 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
|
1258 |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1259 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
|
1260 dmGrowBufFree(&tmp); |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1261 } |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1262 else |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1263 { |
2188 | 1264 res = dmC64DecodeGenericBMP(img, dmGrowBufConstCopyOffs(&tmp, buf, fmtFunPaint2_Header_Size), fmt); |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1265 } |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1266 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1267 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1268 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1269 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1270 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1271 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
|
1272 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1273 // Add the header bits |
2188 | 1274 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2_MagicID, strlen(fmtFunPaint2_MagicID)) || |
1838
d02514ceed91
Fix Fun Paint 2 packed variant writing, it was missing one byte (the "is packed" flag).
Matti Hamalainen <ccr@tnsp.org>
parents:
1834
diff
changeset
|
1275 !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
|
1276 !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
|
1277 return DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1278 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1279 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
|
1280 } |
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 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1283 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
|
1284 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1285 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1286 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
|
1287 DMCompParams cfg; |
1503
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 // 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
|
1290 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
|
1291 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1292 |
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
|
1293 // 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
|
1294 cfg.func = fmt->name; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
1295 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
|
1296 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
|
1297 cfg.rleMinCountB = 4; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
1298 cfg.rleMaxCountB = 255; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1299 |
2329
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
1300 if ((res = dmGenericRLEAnalyze(&mem, &cfg)) != DMERR_OK) |
0085ce04788b
Add return value (error code) to dmGenericRLEAnalyze() and pass it through where used.
Matti Hamalainen <ccr@tnsp.org>
parents:
2314
diff
changeset
|
1301 goto out; |
1661
dc3fbd130db7
RLE analyze was ran before setting up the compression config. Oops. Fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1660
diff
changeset
|
1302 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1303 // Add the header bits |
2188 | 1304 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2_MagicID, strlen(fmtFunPaint2_MagicID)) || |
1838
d02514ceed91
Fix Fun Paint 2 packed variant writing, it was missing one byte (the "is packed" flag).
Matti Hamalainen <ccr@tnsp.org>
parents:
1834
diff
changeset
|
1305 !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
|
1306 !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
|
1307 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1308 res = DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1309 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1310 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1311 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1312 // 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
|
1313 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
|
1314 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1315 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1316 dmGrowBufFree(&mem); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1317 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1318 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1319 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1320 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1321 static int fmtGetPixelFunPaint2(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1322 const DMC64Image *img, const int rasterX, const int rasterY) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1323 { |
2306
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1324 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1325 const int bitmap = rasterX & 1; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1326 Uint8 bgcol = (unsigned) rasterY < img->extraData[0].size ? |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1327 img->extraData[0].data[rasterY] : img->bgcolor; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1328 |
2306
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1329 (void) vshift; |
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1330 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1331 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 1332 bmoffs, scroffs, |
2306
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1333 6 - (rasterX & 6), |
e798a41f27a5
Clean up some code duplication.
Matti Hamalainen <ccr@tnsp.org>
parents:
2302
diff
changeset
|
1334 yb + (bitmap * 8), |
2222
75b5bb490f38
Add & 15 to deeper helper functions and remove it from unnecessary places.
Matti Hamalainen <ccr@tnsp.org>
parents:
2208
diff
changeset
|
1335 bitmap, 0, bgcol); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1336 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1337 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1338 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1339 static int fmtGetPixelBFLI(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1340 const DMC64Image *img, const int rasterX, const int rasterY) |
1582
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1341 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1342 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
1857
5d9dd663df8d
Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1856
diff
changeset
|
1343 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
|
1344 const int vbank = (rasterY & 7) + (vbb * 8); |
1582
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1345 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1346 return dmC64GetGenericMCPixel(scan->col, img, |
2133 | 1347 bmoffs & 0x1fff, scroffs & 0x3ff, |
1348 vshift, vbank, | |
1349 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
|
1350 } |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1351 |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1352 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1353 static int fmtGetPixelPentelPaint(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1354 const DMC64Image *img, const int rasterX, const int rasterY) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1355 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1356 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
2163 | 1357 const int spr_y = rasterY / D64_SPR_HEIGHT_PX; |
1358 const int spr_yd = rasterY % D64_SPR_HEIGHT_PX; | |
1359 const int spr_x = rasterX / D64_SPR_WIDTH_PX; | |
2166
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
1360 const int spr_xd = (rasterX % D64_SPR_WIDTH_PX) / 8; |
4c3fdc9c0056
Clean up some variable and constant names.
Matti Hamalainen <ccr@tnsp.org>
parents:
2165
diff
changeset
|
1361 const int offs = (spr_y * 8 + spr_x) * D64_SPR_SIZE + (spr_yd * D64_SPR_WIDTH_UT) + spr_xd; |
1860
01d7feb9f9ce
Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1857
diff
changeset
|
1362 const int mask = 1 << (7 - (rasterX & 7)); |
2163 | 1363 int res; |
1860
01d7feb9f9ce
Some work on Pentel Paint sprite layer support. Does not work very well yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
1857
diff
changeset
|
1364 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1365 Uint8 color1, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1366 color2 = img->extraData[0].data[offs] & mask ? 0x0f : 0, |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1367 color3 = img->extraData[0].data[offs + D64_SPR_SIZE * 155] & mask ? img->d022 : 0; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1368 |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1369 if ((res = dmC64GetGenericSCPixel(&color1, img, bmoffs, scroffs, vshift, 0, 0)) != DMERR_OK) |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1370 return res; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1371 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1372 *(scan->col) = color3 ? color3 : ( color2 ? color2 : color1 ); |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1373 return DMERR_OK; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1374 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1375 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1376 |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1377 // Horizontal character X-offset and scanline Y-offset |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1378 #define DM_CREST_SHFLI_IMG_XOFFS 14 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1379 #define DM_CREST_SHFLI_IMG_YOFFS 1 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1380 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1381 // True image width and height in character blocks |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1382 #define DM_CREST_SHFLI_IMG_WIDTH (4 * D64_SPR_WIDTH_UT) |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1383 #define DM_CREST_SHFLI_IMG_HEIGHT 21 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1384 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1385 #define DM_CREST_SHFLI_BANKS 8 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1386 #define DM_CREST_SHFLI_PTRS 8 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1387 |
2187
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1388 static const Uint8 fmtCrestSHFLI_Sprite_pointers[DM_CREST_SHFLI_BANKS][DM_CREST_SHFLI_PTRS] = |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1389 { |
2187
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1390 { 0x80, 0x84, 0x85, 0x89, 0x8A, 0x8E, 0x8F, 0x93 }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1391 { 0x94, 0x98, 0x99, 0x9D, 0x9E, 0xA2, 0xA3, 0xA7 }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1392 { 0xA8, 0xAC, 0xAD, 0xB1, 0xB2, 0xB6, 0xB7, 0xBB }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1393 { 0xBC, 0xC0, 0xC1, 0xC5, 0xC6, 0xCA, 0xCB, 0xCF }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1394 { 0xD0, 0xD4, 0xD5, 0xD9, 0xDA, 0xDE, 0xDF, 0xE3 }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1395 { 0xE4, 0xE8, 0xE9, 0xEA, 0xEB, 0xEC, 0xED, 0xEE }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1396 { 0xEF, 0xF0, 0xF1, 0xF2, 0xF3, 0xF4, 0xF5, 0xF6 }, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1397 { 0xF7, 0x1E, 0x2E, 0x3E, 0x4E, 0x5E, 0x6E, 0x7E }, |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1398 }; |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1399 |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1400 |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1401 static const Uint8 fmtCrestSHFLI_MagicID_Packed[] = |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1402 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1403 0x83, 0x92, 0x85, 0x93, 0x94, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1404 }; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1405 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1406 |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1407 static int fmtProbeCrestSHFLI(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1408 { |
2187
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1409 // Unpacked variant |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1410 if (buf->len == fmt->size && |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1411 dmCompareAddr16(buf, 0, fmt->addr)) |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1412 { |
2187
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1413 int score = DM_PROBE_SCORE_MAYBE; |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1414 for (int nbank = 0; nbank < DM_CREST_SHFLI_BANKS; nbank++) |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1415 { |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1416 if (memcmp(buf->data + 2 + (nbank * 0x0400) + 0x03f8, |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1417 fmtCrestSHFLI_Sprite_pointers[nbank], DM_CREST_SHFLI_PTRS) == 0) |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1418 score += DM_PROBE_SCORE_GOOD; |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1419 } |
ec47c60d26e2
Improve Crest Super Hires FLI probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2186
diff
changeset
|
1420 return score; |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1421 } |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1422 |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1423 // Packed variant |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1424 if (dmCompareAddr16(buf, 0, fmt->addr) && |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1425 buf->len > sizeof(fmtCrestSHFLI_MagicID_Packed) && |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1426 DM_MEMCMP_SIZE(buf->data + buf->len - sizeof(fmtCrestSHFLI_MagicID_Packed), fmtCrestSHFLI_MagicID_Packed) == 0) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1427 return DM_PROBE_SCORE_MAX; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1428 |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1429 return DM_PROBE_SCORE_FALSE; |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1430 } |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1431 |
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
1432 |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1433 static int fmtDecodeCrestSHFLIPacked(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1434 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1435 int res; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1436 DMGrowBuf tmp, mem; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1437 DMCompParams cfg; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1438 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1439 // Compression is typical RLE, with first byte being the RLE marker byte etc. |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1440 // However, as a difference to the uncompressed files, only the data of the |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1441 // 96 pixels wide area (4 sprite widths) x 168 tall is saved. |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1442 cfg.func = fmt->name; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1443 cfg.type = DM_COMP_RLE_MARKER; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1444 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1 | DM_RLE_ZERO_COUNT_MAX; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1445 cfg.rleMarkerB = buf->data[0]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1446 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1447 if ((res = dmDecodeGenericRLEAlloc( |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1448 &mem, dmGrowBufConstCopyOffs(&tmp, buf, 1), &cfg)) == DMERR_OK) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1449 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1450 const size_t fmtUncompSize = 0x1ff0; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1451 const size_t dstSize = 16 * 1024; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1452 Uint8 *dstBuf, *sptr, *dptr; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1453 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1454 // Check uncompressed size? |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1455 if (mem.len != fmtUncompSize) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1456 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1457 res = dmError(DMERR_INVALID_DATA, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1458 "%s: Unexpected uncompressed data size %d bytes (should be %d).\n", |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1459 cfg.func, mem.len, fmtUncompSize); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1460 goto out; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1461 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1462 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1463 // Allocate output buffer |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1464 if ((dstBuf = dmMalloc0(dstSize)) == NULL) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1465 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1466 res = dmError(DMERR_MALLOC, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1467 "%s: Could not allocate temporary memory buffer of %d bytes.\n", |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1468 cfg.func, dstSize); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1469 goto out; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1470 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1471 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1472 // Now that we have the uncompressed data (0x1ff0 bytes), we need to |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1473 // re-arrange it. The data is as follows .. |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1474 // |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1475 // 0x0000 - sprite data for 64 sprites |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1476 // 0x1000 - bitmap (12 * 21 bytes) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1477 // 0x1800 - screen RAMs (12 * 21 bytes) x 8 banks |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1478 // 0x1fe8 - sprite color #1 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1479 // 0x1fe9 - sprite color #2 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1480 // |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1481 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1482 // Copy sprite colors |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1483 sptr = mem.data + 0x1fe8; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1484 dptr = dstBuf + 0x03e8; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1485 dptr[0] = sptr[0]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1486 dptr[1] = sptr[1]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1487 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1488 // First, clear and set some defaults that are not saved in the file |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1489 for (int nbank = 0; nbank < DM_CREST_SHFLI_BANKS; nbank++) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1490 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1491 dptr = dstBuf + nbank * 0x0400; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1492 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1493 // Set preset screen RAM for other area |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1494 memset(dptr, 0xff, fmt->format->chWidth * fmt->format->chHeight); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1495 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1496 // Copy sprite data points |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1497 memcpy(dptr + 0x03f8, &fmtCrestSHFLI_Sprite_pointers[nbank], DM_CREST_SHFLI_PTRS); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1498 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1499 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1500 // Now we copy and transform the bitmap and screen RAM data. |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1501 for (int yc = 0; yc < DM_CREST_SHFLI_IMG_HEIGHT * 8; yc++) |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1502 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1503 const int syy = yc / 8; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1504 const int syd = yc & 7; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1505 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1506 // In the image the first visible scanline is unused, but in |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1507 // the compressed version data starts right away, so we offset |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1508 // the destination Y coordinate by one. |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1509 const int dyc = yc + DM_CREST_SHFLI_IMG_YOFFS; |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1510 const int dyy = dyc / 8; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1511 const int dyd = dyc & 7; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1512 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1513 // Format of the bitmap data is one horizontal pixel row (12 bytes) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1514 // times 21*8 rows, e.g. the data is "linear" rows of bytes and not |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1515 // arranged in usual c64 bitmap "char" order. Thus we reorder it. |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1516 sptr = mem.data + 0x1000 + DM_CREST_SHFLI_IMG_WIDTH * (syd + 8 * syy); |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1517 dptr = dstBuf + 0x2000 + DM_CREST_SHFLI_IMG_XOFFS * 8 + (fmt->format->chWidth * dyy * 8) + dyd; |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1518 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1519 for (int xc = 0; xc < DM_CREST_SHFLI_IMG_WIDTH; xc++) |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1520 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1521 dptr[xc * 8] = sptr[xc]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1522 sptr[xc] = 0xaa; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1523 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1524 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1525 // A bit similar arrangement is used for the screen RAM data. |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1526 // Each row of 12 bytes of data is for a bank. Next row is for |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1527 // next bank, etc. |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1528 sptr = mem.data + 0x1800 + DM_CREST_SHFLI_IMG_WIDTH * syd + DM_CREST_SHFLI_IMG_WIDTH * 8 * syy; |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1529 dptr = dstBuf + DM_CREST_SHFLI_IMG_XOFFS + 0x0400 * dyd + fmt->format->chWidth * dyy; |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1530 |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1531 for (int xc = 0; xc < DM_CREST_SHFLI_IMG_WIDTH; xc++) |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1532 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1533 dptr[xc] = sptr[xc]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1534 sptr[xc] = 0xaa; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1535 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1536 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1537 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1538 // The sprite data is also transformed similarly, data is |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1539 // in same scanline format as the bitmap. Thus we need to |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1540 // place it where it belongs based on the sprite pointers. |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1541 for (int yc = 0; yc < DM_CREST_SHFLI_IMG_HEIGHT * 8; yc++) |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1542 { |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1543 const int yd = yc % D64_SPR_HEIGHT_PX; |
2190
0447f4c6c32b
Fix a const discard issue.
Matti Hamalainen <ccr@tnsp.org>
parents:
2189
diff
changeset
|
1544 const Uint8 *sprPtrs = fmtCrestSHFLI_Sprite_pointers[yc % 8]; |
0447f4c6c32b
Fix a const discard issue.
Matti Hamalainen <ccr@tnsp.org>
parents:
2189
diff
changeset
|
1545 Uint8 *sp1, *sp2, *dp; |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1546 |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1547 dptr = dstBuf + D64_SPR_WIDTH_UT * yd; |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1548 sp1 = mem.data + DM_CREST_SHFLI_IMG_WIDTH * yc; |
2191 | 1549 sp2 = sp1 + 0x0800; |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1550 |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1551 for (int xc = 0; xc < DM_CREST_SHFLI_IMG_WIDTH / D64_SPR_WIDTH_UT; xc++) |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1552 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1553 dp = dptr + D64_SPR_SIZE * sprPtrs[xc]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1554 for (int xd = 0; xd < D64_SPR_WIDTH_UT; xd++) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1555 dp[xd] = *sp1++; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1556 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1557 dp = dptr + D64_SPR_SIZE * sprPtrs[xc + 4]; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1558 for (int xd = 0; xd < D64_SPR_WIDTH_UT; xd++) |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1559 dp[xd] = *sp2++; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1560 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1561 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1562 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1563 res = dmC64DecodeGenericBMP(img, dmGrowBufConstCreateFrom(&tmp, dstBuf, dstSize), fmt); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1564 dmFree(dstBuf); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1565 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1566 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1567 out: |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1568 dmGrowBufFree(&mem); |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1569 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1570 return res; |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1571 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1572 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1573 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1574 static int fmtGetSpritePixelCrestSHFLI(DMC64ScanLine *scan, |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1575 const DMC64Image *img, const int sindex, const int cindex, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1576 const int spr_xd, const int spr_yd, const int mask) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1577 { |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1578 const size_t offs = sindex * D64_SPR_SIZE + (D64_SPR_WIDTH_UT * spr_yd) + spr_xd; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1579 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1580 if (offs >= img->extraData[14].size) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1581 return DMERR_BOUNDS; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1582 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1583 if (img->extraData[14].data[offs] & mask) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1584 { |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1585 *(scan->col) = img->extraData[15].data[cindex]; |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1586 return DMERR_OK; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1587 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1588 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1589 return -1; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1590 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1591 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1592 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1593 static int fmtGetPixelCrestSHFLI(DMC64ScanLine *scan, |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1594 const DMC64Image *img, const int rasterX, const int rasterY) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1595 { |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1596 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1597 const int sprOffsetX = DM_CREST_SHFLI_IMG_XOFFS * 8, |
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1598 sprOffsetY = DM_CREST_SHFLI_IMG_YOFFS; |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1599 const int nbank = rasterY & 7; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1600 int res; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1601 |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1602 if (rasterY / 8 >= DM_CREST_SHFLI_IMG_HEIGHT) |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1603 { |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1604 *(scan->col) = 0x0f; |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1605 return DMERR_OK; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1606 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1607 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1608 if (rasterY >= sprOffsetY && |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1609 rasterX >= sprOffsetX && |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1610 rasterX < sprOffsetX + 4 * D64_SPR_WIDTH_PX) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1611 { |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1612 const int localX = rasterX - sprOffsetX, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1613 localY = rasterY - sprOffsetY; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1614 const int sbank = localY & 7; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1615 const int spr_yd = localY % D64_SPR_HEIGHT_PX; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1616 const int spr_x = localX / D64_SPR_WIDTH_PX; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1617 const int spr_xd = (localX % D64_SPR_WIDTH_PX) / 8; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1618 const int mask = 1 << (7 - (localX & 7)); |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1619 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1620 const int spr_offs = spr_x & 3; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1621 const int spr_index1 = img->extraData[sbank].data[spr_offs]; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1622 const int spr_index2 = img->extraData[sbank].data[spr_offs + 4]; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1623 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1624 if ((res = fmtGetSpritePixelCrestSHFLI(scan, img, spr_index1, 0, spr_xd, spr_yd, mask)) == DMERR_OK || |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1625 res != -1) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1626 return res; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1627 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1628 if ((res = fmtGetSpritePixelCrestSHFLI(scan, img, spr_index2, 1, spr_xd, spr_yd, mask)) == DMERR_OK || |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1629 res != -1) |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1630 return res; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1631 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1632 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1633 if ((res = dmC64GetGenericSCPixel(scan->col, img, bmoffs, scroffs, vshift, nbank, 0)) != DMERR_OK) |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1634 return res; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1635 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1636 return DMERR_OK; |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1637 } |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1638 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
1639 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1640 static int fmtGetPixelHCB(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1641 const DMC64Image *img, const int rasterX, const int rasterY) |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
1642 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1643 DM_C64_GENERIC_MC_PIXEL_DEFS(img) |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
1644 const int vbank = (rasterY / 4) & 1; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1645 const int ry = rasterY / 5; |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
1646 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1647 Uint8 bgcol = (unsigned) ry < img->extraData[0].size ? |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1648 img->extraData[0].data[ry] : img->bgcolor; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1649 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1650 return dmC64GetGenericMCPixel(scan->col, img, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1651 bmoffs, scroffs, |
2133 | 1652 vshift, vbank, |
2222
75b5bb490f38
Add & 15 to deeper helper functions and remove it from unnecessary places.
Matti Hamalainen <ccr@tnsp.org>
parents:
2208
diff
changeset
|
1653 0, vbank, bgcol); |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
1654 } |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
1655 |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
1656 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1657 static int fmtGetPixelCrestHIFLIorCDHM(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1658 const DMC64Image *img, const int rasterX, const int rasterY) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1659 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1660 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
2133 | 1661 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1662 return dmC64GetGenericSCPixel(scan->col, img, |
2133 | 1663 bmoffs, scroffs, |
1664 vshift, rasterY & 7, 0); | |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1665 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1666 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1667 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1668 static int fmtGetPixelECI(DMC64ScanLine *scan, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1669 const DMC64Image *img, const int rasterX, const int rasterY) |
1734
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1670 { |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1671 DM_C64_GENERIC_SC_PIXEL_DEFS(img) |
1764
52e31cfc1e36
Implement fake X raster position for the pixel getting functions. At some
Matti Hamalainen <ccr@tnsp.org>
parents:
1763
diff
changeset
|
1672 const int vbank = rasterY & 7; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1673 Uint8 color1, color2; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1674 int res; |
1734
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1675 |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1676 if ((res = dmC64GetGenericSCPixel(&color1, img, bmoffs, scroffs, vshift, vbank , 0)) != DMERR_OK || |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1677 (res = dmC64GetGenericSCPixel(&color2, img, bmoffs, scroffs, vshift, vbank + 8, 1)) != DMERR_OK) |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1678 return res; |
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1679 |
2343
94a653883a32
Change Uint8 pointer in getPixel functions to DMC64ScanLine pointer in
Matti Hamalainen <ccr@tnsp.org>
parents:
2331
diff
changeset
|
1680 *(scan->col) = (color1 * D64_NCOLORS) + color2; |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1681 return DMERR_OK; |
1734
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1682 } |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1683 |
183d503b17a7
Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1731
diff
changeset
|
1684 |
1780
5ea4713e9e0f
Change c64 format probing API to use DMGrowBuf.
Matti Hamalainen <ccr@tnsp.org>
parents:
1779
diff
changeset
|
1685 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
|
1686 { |
2168
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1687 int score = DM_PROBE_SCORE_FALSE; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1688 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1689 if (buf->len > 128 && |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1690 dmCompareAddr16(buf, 0, fmt->addr)) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1691 { |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1692 size_t i, n; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1693 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1694 // Count statistics about used byte values and compare to |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1695 // value in buf[2] which is the RLE marker |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1696 for (n = 0, i = 3; i < buf->len; i++) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1697 if (buf->data[i] == buf->data[2]) n++; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1698 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1699 if (n > 50) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1700 score = DM_PROBE_SCORE_GOOD; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1701 else |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1702 if (n > 25) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1703 score = DM_PROBE_SCORE_AVG; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1704 else |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1705 if (n > 10) |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1706 score = DM_PROBE_SCORE_MAYBE; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1707 } |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1708 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1709 if (// Try to avoid misprobe of Crest Hires FLI Designer and Cosmos Design format |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1710 buf->len == 16386 || |
1979
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
1711 // Face Painter |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
1712 buf->len == 10004) |
2168
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1713 score /= 3; |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1714 |
b4f4251eaaae
Improve probing resiliency of Cosmos Designs and ECI formats, and try to
Matti Hamalainen <ccr@tnsp.org>
parents:
2167
diff
changeset
|
1715 return score; |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1716 } |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1717 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1718 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1719 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
|
1720 { |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1721 int res; |
2170 | 1722 DMGrowBuf mem, tmp; |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1723 DMCompParams cfg; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1724 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1725 cfg.func = fmt->name; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1726 cfg.type = DM_COMP_RLE_MARKER; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1727 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
|
1728 cfg.rleMarkerB = buf->data[0]; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1729 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1730 if ((res = dmDecodeGenericRLEAlloc( |
1747
5e928618fdc8
Change DMGrowBuf API somewhat and implement more copy operations.
Matti Hamalainen <ccr@tnsp.org>
parents:
1746
diff
changeset
|
1731 &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
|
1732 res = dmC64DecodeGenericBMP(img, &mem, fmt); |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1733 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1734 dmGrowBufFree(&mem); |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1735 return res; |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1736 } |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1737 |
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1738 |
1912
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1739 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
|
1740 { |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1741 int res; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1742 DMGrowBuf tmp; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1743 DMCompParams cfg; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1744 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1745 // 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
|
1746 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
|
1747 goto out; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1748 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1749 // 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
|
1750 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
|
1751 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
|
1752 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
|
1753 cfg.rleMinCountB = 4; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1754 cfg.rleMaxCountB = 255; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1755 |
2331
6dc64deb6718
Missed on dmGenericRLEAnalyze() call from a previous commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2329
diff
changeset
|
1756 if ((res = dmGenericRLEAnalyze(&tmp, &cfg)) != DMERR_OK) |
6dc64deb6718
Missed on dmGenericRLEAnalyze() call from a previous commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2329
diff
changeset
|
1757 goto out; |
1912
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1758 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1759 // 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
|
1760 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
|
1761 { |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1762 res = DMERR_MALLOC; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1763 goto out; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1764 } |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1765 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1766 // 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
|
1767 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
|
1768 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1769 out: |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1770 dmGrowBufFree(&tmp); |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1771 return res; |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1772 } |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1773 |
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
1774 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1775 // |
1795
c8d690e8f9e9
Fix some typos in comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
1792
diff
changeset
|
1776 // Helper macros for defining screen memory layouts |
c8d690e8f9e9
Fix some typos in comments.
Matti Hamalainen <ccr@tnsp.org>
parents:
1792
diff
changeset
|
1777 // 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
|
1778 // |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1779 #define DEF_REPEAT_BLOCK(dtype, start, oindex, bindex, osize, bsize, oflags) \ |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1780 { DO_COPY, (dtype), (start) + ((osize) * (oindex)), (bindex), (bsize), 0, NULL, NULL, (oflags) } |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1781 |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1782 #define DEF_REPEAT_BLOCK_8(dtype, start, sindex, osize, bsize, oflags) \ |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1783 DEF_REPEAT_BLOCK((dtype), (start), 0, ((sindex) + 0), (osize), (bsize), (oflags)), \ |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1784 DEF_REPEAT_BLOCK((dtype), (start), 1, ((sindex) + 1), (osize), (bsize), (oflags)), \ |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1785 DEF_REPEAT_BLOCK((dtype), (start), 2, ((sindex) + 2), (osize), (bsize), (oflags)), \ |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1786 DEF_REPEAT_BLOCK((dtype), (start), 3, ((sindex) + 3), (osize), (bsize), (oflags)), \ |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1787 DEF_REPEAT_BLOCK((dtype), (start), 4, ((sindex) + 4), (osize), (bsize), (oflags)), \ |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1788 DEF_REPEAT_BLOCK((dtype), (start), 5, ((sindex) + 5), (osize), (bsize), (oflags)), \ |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1789 DEF_REPEAT_BLOCK((dtype), (start), 6, ((sindex) + 6), (osize), (bsize), (oflags)), \ |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1790 DEF_REPEAT_BLOCK((dtype), (start), 7, ((sindex) + 7), (osize), (bsize), (oflags)) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1791 |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1792 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1793 // |
1861 | 1794 // Many formats actually share memory layout and other specs, and there are |
1795 // packed and unpacked versions of several formats. We'll reuse these here | |
1796 // 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
|
1797 // |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1798 DMC64ImageCommonFormat dmC64CommonFormats[] = |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1799 { |
1815
2b68b6955635
Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents:
1813
diff
changeset
|
1800 { // #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
|
1801 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1802 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1803 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
1804 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1805 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1806 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1807 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1808 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1809 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1810 { DO_COPY , DS_COLOR_RAM , 0x2328, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1811 { DO_SET_MEM_LO , DS_BGCOL , 0x2710, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1812 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1813 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1814 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1815 |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1816 { // #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
|
1817 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1818 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1819 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
1820 2, 1, |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1821 NULL, NULL, |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1822 fmtGetPixelBlackMailFLI, |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1823 { |
2294 | 1824 { DO_COPY , DS_EXTRA_DATA , 0x0000, 0, 200 , 0, NULL, NULL, DF_NORMAL }, |
1825 { DO_COPY , DS_COLOR_RAM , 0x0100, 0, 0 , 0, NULL, NULL, DF_NORMAL }, | |
1826 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x0500, 0, 0x400, 0, DF_NORMAL), | |
1827 { DO_COPY , DS_BITMAP_RAM , 0x2500, 0, 0 , 0, NULL, NULL, DF_NORMAL }, | |
1828 | |
1829 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0 , 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, | |
1830 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, | |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
1831 } |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1832 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1833 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1834 { // #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
|
1835 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1836 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1837 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
1838 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1839 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1840 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1841 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1842 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1843 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1844 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1845 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1846 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1847 |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1848 { // #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
|
1849 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1850 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1851 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
1852 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1853 NULL, NULL, |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
1854 fmtGetPixelFunPaint2, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1855 { |
2224
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
1856 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x0000, 0, 0x400, 0, DF_NORMAL), |
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
1857 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
1858 { DO_COPY , DS_EXTRA_DATA , 0x3f48, 0, 100 , 0, NULL, NULL, DF_NORMAL }, |
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
1859 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
1860 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x43e8, 8, 0x400, 0, DF_NORMAL), |
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
1861 { DO_COPY , DS_BITMAP_RAM , 0x63e8, 1, 0 , 0, NULL, NULL, DF_NORMAL }, |
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
1862 { DO_COPY , DS_EXTRA_DATA , 0x8328, 0, 100 , 100, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
1863 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_RES, 0 , 0 , D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
1864 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2224
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
1865 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1866 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1867 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1868 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1869 { // #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
|
1870 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1871 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1872 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
1873 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1874 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1875 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1876 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1877 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1878 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1879 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1880 { DO_SET_MEM_LO , DS_BGCOL , 0x2740, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1881 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1882 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1883 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1884 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1885 { // #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
|
1886 D64_FMT_MC | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1887 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1888 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
1889 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1890 NULL, NULL, |
2129
2129d4ac6f45
Refactor c64 image rendering completely to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
2127
diff
changeset
|
1891 fmtGetPixelDrazLace, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1892 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1893 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1894 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1895 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1896 { DO_SET_MEM_LO , DS_BGCOL , 0x2740, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1897 { DO_FUNC , 0 , 0x2742, 0, 1, 0, fmtDrazLaceGetLaceType, fmtDrazLaceSetLaceType, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1898 { DO_COPY , DS_BITMAP_RAM , 0x2800, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1899 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1900 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1901 }, |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
1902 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1903 { // #6: TruePaint |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1904 D64_FMT_MC | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1905 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1906 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
1907 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1908 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1909 fmtGetPixelTruePaint, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1910 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1911 { DO_COPY , DS_SCREEN_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1912 { DO_SET_MEM_LO , DS_BGCOL , 0x03e8, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1913 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1914 { DO_COPY , DS_BITMAP_RAM , 0x2400, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1915 { DO_COPY , DS_SCREEN_RAM , 0x4400, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1916 { DO_COPY , DS_COLOR_RAM , 0x4800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
1917 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_RES, 0 , 0 , D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1918 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1919 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1920 }, |
1739
83f50e431206
Implement support for ECI packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1734
diff
changeset
|
1921 |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1922 { // #7: ECI Graphic Editor Hires FLI |
2224
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
1923 D64_FMT_HIRES | D64_FMT_FLI | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1924 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1925 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
1926 1, 1, |
2224
a36c81c3df85
Make color interlace type generate a mixed palette instead of using special
Matti Hamalainen <ccr@tnsp.org>
parents:
2222
diff
changeset
|
1927 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
|
1928 fmtGetPixelECI, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1929 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1930 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1931 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x2000, 0, 0x400, 0, DF_NORMAL), |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1932 { DO_COPY , DS_BITMAP_RAM , 0x4000, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1933 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x6000, 8, 0x400, 0, DF_NORMAL), |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
1934 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_COLOR, 0 , 0 , D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
1935 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1936 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1937 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1938 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1939 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1940 { // #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
|
1941 D64_FMT_HIRES | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1942 D64_SCR_WIDTH, 24*8, // Actually 296 x 192 (=24*8) |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1943 D64_SCR_CH_WIDTH, 24, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
1944 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1945 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1946 fmtGetPixelCrestHIFLIorCDHM, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1947 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1948 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1949 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x2000, 0, 0x400, 0, DF_NORMAL), |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
1950 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1951 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1952 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
1953 }, |
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
|
1954 |
2018 | 1955 { // #9: FBI Crew FLI Designer 1.x & 2.0 |
1834
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
1956 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1957 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1958 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
1959 2, 1, |
1834
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
1960 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
|
1961 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
|
1962 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1963 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1964 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x0400, 0, 0x400, 0, DF_NORMAL), |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1965 { DO_COPY , DS_BITMAP_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
1966 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1967 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1834
69871828838c
Separate the format entries for "FBI Crew FLI Designer 1.1" and "FLI Designer 2"
Matti Hamalainen <ccr@tnsp.org>
parents:
1832
diff
changeset
|
1968 } |
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
|
1969 }, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1970 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1971 { // #10: Doodle |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1972 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1973 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
1974 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
1975 1, 1, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1976 NULL, NULL, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1977 NULL, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1978 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1979 { DO_COPY , DS_SCREEN_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1980 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1981 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1982 } |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
1983 }, |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1984 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1985 { // #11: Crest Super Hires FLI Editor 1.0 (SHF) |
2314
87533af8db64
Add format flag for formats that use sprite layer.
Matti Hamalainen <ccr@tnsp.org>
parents:
2313
diff
changeset
|
1986 D64_FMT_HIRES | D64_FMT_FLI | D64_FMT_SPRITES, |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1987 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
2195
868b68c188e5
Cleanup Crest SHFLI decoding and use specific constants better.
Matti Hamalainen <ccr@tnsp.org>
parents:
2193
diff
changeset
|
1988 D64_SCR_CH_WIDTH, 24, |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1989 1, 1, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1990 NULL, NULL, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1991 fmtGetPixelCrestSHFLI, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
1992 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1993 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM, 0x0000, 0 , 0x0400, 0x0400, DF_NORMAL), |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1994 DEF_REPEAT_BLOCK_8(DS_EXTRA_DATA, 0x03f8, 0 , 0x0400, 8, DF_DECODE), // Sprite pointers for each bank |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1995 { DO_COPY , DS_EXTRA_DATA , 0x03e8, 15 , 2 , 0, NULL, NULL, DF_DECODE }, // 2 sprite colors |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1996 { DO_COPY , DS_EXTRA_DATA , 0x0000, 14 , 0x3e00, 0, NULL, NULL, DF_DECODE }, // Lazily copy whole data for sprite data |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1997 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0 , 0 , 0, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
1998 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
1999 { DO_LAST , 0 , 0 , 0 , 0 , 0, NULL, NULL, DF_NORMAL }, |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2000 } |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2001 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2002 }; |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2003 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2004 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2005 // |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2006 // 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
|
2007 // |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2008 DMC64ImageFormat dmC64ImageFormats[] = |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2009 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2010 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2011 "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
|
2012 fmtProbeDrazPaint20Packed, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2013 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
|
2014 { }, &dmC64CommonFormats[4] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2015 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2016 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2017 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2018 "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
|
2019 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2020 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
|
2021 { }, &dmC64CommonFormats[4] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2022 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2023 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2024 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2025 "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
|
2026 fmtProbeDrazLace10Packed, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2027 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
|
2028 { }, &dmC64CommonFormats[5] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2029 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2030 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2031 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2032 "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
|
2033 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2034 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
|
2035 { }, &dmC64CommonFormats[5] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2036 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2037 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2038 { |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2039 "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
|
2040 fmtProbeBDP5Packed, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2041 fmtDecodeBDP5Packed, fmtEncodeBDP5Packed, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2042 { }, &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
|
2043 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2044 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2045 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2046 "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
|
2047 NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2048 NULL, NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2049 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2050 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2051 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2052 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2053 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2054 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2055 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2056 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2057 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2058 { DO_SET_MEM_LO , DS_BGCOL , 0x07e8, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2059 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2060 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2061 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2062 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2063 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2064 NULL |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2065 }, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2066 |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2067 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2068 "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
|
2069 NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2070 NULL, NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2071 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2072 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2073 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2074 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2075 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2076 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2077 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2078 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2079 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2080 { DO_SET_MEM_LO , DS_BGCOL , 0x07fe, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2081 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2082 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2083 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2084 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2085 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2086 NULL |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2087 }, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2088 |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
2089 { |
1816
8d7b424197bc
Allow writing of unpacked True Paint format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1815
diff
changeset
|
2090 "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
|
2091 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2092 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
|
2093 { }, &dmC64CommonFormats[6] |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2094 }, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2095 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2096 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2097 "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
|
2098 fmtProbeTruePaintPacked, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2099 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
|
2100 { }, &dmC64CommonFormats[6] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2101 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2102 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2103 { |
1815
2b68b6955635
Rename "Koala Paint" to "Koala Painter".
Matti Hamalainen <ccr@tnsp.org>
parents:
1813
diff
changeset
|
2104 "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
|
2105 fmtProbeKoalaPainter, |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
2106 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
|
2107 { }, &dmC64CommonFormats[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2108 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2109 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2110 { |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
2111 "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
|
2112 fmtProbeKoalaPainterPacked, |
1839
666b27999570
As the Koala Painter plain RLE compression (without headers and static
Matti Hamalainen <ccr@tnsp.org>
parents:
1838
diff
changeset
|
2113 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
|
2114 { }, &dmC64CommonFormats[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2115 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2116 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2117 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2118 "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
|
2119 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2120 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2121 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2122 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2123 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2124 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2125 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2126 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2127 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2128 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2129 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2130 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2131 { DO_SET_MEM_LO , DS_D020 , 0x2328, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2132 { DO_SET_MEM_LO , DS_BGCOL , 0x2329, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2133 { DO_COPY , DS_COLOR_RAM , 0x2338, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2134 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2135 }, |
1593
a77876a07425
Oops, missed this from the last commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1592
diff
changeset
|
2136 }, |
a77876a07425
Oops, missed this from the last commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1592
diff
changeset
|
2137 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2138 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2139 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2140 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2141 "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
|
2142 NULL, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2143 NULL, NULL, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2144 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2145 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2146 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2147 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2148 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2149 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2150 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2151 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2152 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2153 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2154 { DO_SET_MEM_LO , DS_BGCOL , 0x23ff, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2155 { DO_COPY , DS_SCREEN_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2156 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2157 } |
1755
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2158 }, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2159 NULL |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2160 }, |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2161 |
841ee79030fa
Implement support for Image System unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1754
diff
changeset
|
2162 { |
1985
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
2163 "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
|
2164 fmtProbeMicroIllustrator, |
1758
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2165 NULL, NULL, |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2166 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2167 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2168 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2169 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2170 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2171 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2172 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2173 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2174 { DO_COPY , DS_SCREEN_RAM , 20 + 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2175 { DO_COPY , DS_COLOR_RAM , 20 + 1000 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2176 { DO_COPY , DS_BITMAP_RAM , 20 + 2000 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1985
5817e3335f53
Allow saving of Micro Illustrator format, but mark it "broken" again due to
Matti Hamalainen <ccr@tnsp.org>
parents:
1984
diff
changeset
|
2177 // XXX TODO: Unknown where the background color is set, so default to 0x00 |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2178 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2179 { DO_SET_MEM_LO , DS_BGCOL , 20 + 0x3e8 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2180 { DO_SET_MEM_LO , DS_BGCOL , 20 + 0x3e9 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2181 { DO_SET_MEM_LO , DS_BGCOL , 20 + 0x3ea , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2182 { DO_SET_MEM_LO , DS_BGCOL , 20 + 0x3eb , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2183 { DO_FUNC , 0 , 0 , 0, 0, 0, NULL, fmtEncodeMicroIllustrator, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2184 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2185 } |
1758
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2186 }, |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2187 NULL |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2188 }, |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2189 |
8014e4cbebfe
Add mostly working support for unknown unpacked multicolor format "MIL".
Matti Hamalainen <ccr@tnsp.org>
parents:
1757
diff
changeset
|
2190 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2191 "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
|
2192 NULL, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2193 NULL, NULL, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2194 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2195 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2196 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2197 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2198 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2199 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2200 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2201 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2202 { DO_COPY , DS_BITMAP_RAM , 0x0000 + 0x111, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2203 { DO_COPY , DS_SCREEN_RAM , 0x1f40 + 0x111, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2204 { DO_COPY , DS_COLOR_RAM , 0x2328 + 0x111, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2205 { DO_SET_MEM_LO , DS_BGCOL , 0x2710 + 0x111, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2206 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2207 } |
1754
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2208 }, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2209 NULL |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2210 }, |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2211 |
aa6a858db6bd
Implement support for CPU-Paint unpacked format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1753
diff
changeset
|
2212 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2213 "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
|
2214 NULL, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2215 NULL, NULL, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2216 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2217 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2218 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2219 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2220 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2221 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2222 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2223 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2224 { DO_COPY , DS_SCREEN_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2225 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2226 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2227 // XXX TODO: Not sure if the background color is hardcoded .. |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2228 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2229 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2230 } |
1763
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2231 }, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2232 NULL |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2233 }, |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2234 |
847bd77a538d
Implement Rainbow Painter format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1762
diff
changeset
|
2235 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2236 "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
|
2237 fmtProbeSaracenPaint, |
1769
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2238 NULL, NULL, |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2239 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2240 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2241 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2242 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2243 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2244 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2245 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2246 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2247 { DO_COPY , DS_SCREEN_RAM , 0x7800 - 0x7800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2248 { DO_SET_MEM_LO , DS_BGCOL , 0x7bf0 - 0x7800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2249 { DO_COPY , DS_BITMAP_RAM , 0x7c00 - 0x7800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2250 { DO_COPY , DS_COLOR_RAM , 0x9c00 - 0x7800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2251 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2252 } |
1769
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2253 }, |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2254 NULL |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2255 }, |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2256 |
bf22cd877c13
Add support for Saracen Paint multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1768
diff
changeset
|
2257 { |
1980
2cf79254b8e4
Confirm the Blazing Paddles d020/bgcolor positions and remove the broken flag.
Matti Hamalainen <ccr@tnsp.org>
parents:
1979
diff
changeset
|
2258 "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
|
2259 NULL, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2260 NULL, NULL, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2261 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2262 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2263 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2264 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2265 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2266 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2267 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2268 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2269 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1980
2cf79254b8e4
Confirm the Blazing Paddles d020/bgcolor positions and remove the broken flag.
Matti Hamalainen <ccr@tnsp.org>
parents:
1979
diff
changeset
|
2270 // Both d020 and bgcolor confirmed by tests |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2271 { DO_SET_MEM_LO , DS_D020 , 0x1f7f, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2272 { DO_SET_MEM_LO , DS_BGCOL , 0x1f80, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2273 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2274 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2275 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2276 } |
1770
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2277 }, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2278 NULL |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2279 }, |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2280 |
a176dea422cb
Add partially broken support for Blazing Paddles multicolor format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1769
diff
changeset
|
2281 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2282 "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
|
2283 NULL, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2284 NULL, NULL, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2285 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2286 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2287 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2288 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2289 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2290 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2291 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2292 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2293 { DO_COPY , DS_BITMAP_RAM , 0x4000 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2294 { DO_COPY , DS_SCREEN_RAM , 0x6000 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2295 { DO_SET_MEM_LO , DS_D020 , 0x5f40 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2296 { DO_SET_MEM_LO , DS_COLOR_RAM , 0x5f43 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2297 { DO_SET_MEM_LO , DS_BGCOL , 0x5f44 + 0x72 - 0x4000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2298 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2299 } |
1762
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2300 }, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2301 NULL |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2302 }, |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2303 |
b69f3d97db9e
Implement support for "PMG" format, a crippled variant of standard c64
Matti Hamalainen <ccr@tnsp.org>
parents:
1760
diff
changeset
|
2304 { |
1779
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2305 "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
|
2306 NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2307 NULL, NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2308 { |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2309 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2310 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2311 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2312 2, 1, |
1779
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2313 NULL, NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2314 NULL, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2315 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2316 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2317 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2318 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2319 { DO_SET_MEM_LO , DS_D020 , 0x27fe, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2320 { DO_SET_MEM_LO , DS_BGCOL , 0x27ff, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2321 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1779
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2322 } |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2323 }, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2324 NULL |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2325 }, |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2326 |
20bf4140eaa1
Add support for another plain multicolor variant, "Wigmore Artist 64".
Matti Hamalainen <ccr@tnsp.org>
parents:
1778
diff
changeset
|
2327 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2328 "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
|
2329 fmtProbeAmicaPaintPacked, |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
2330 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
|
2331 { }, &dmC64CommonFormats[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2332 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2333 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2334 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2335 "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
|
2336 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2337 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
|
2338 { }, &dmC64CommonFormats[0] |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2339 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2340 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2341 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2342 "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
|
2343 NULL, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2344 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
|
2345 { }, &dmC64CommonFormats[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2346 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2347 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2348 { |
1819
c12bd223000e
Enable write support for some formats that should be workable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1816
diff
changeset
|
2349 "art", "Art Studio (unpacked)", 0x2000, 9009, DM_FMT_RDWR, |
2161
6a6344f8f535
Add support for one more Art Studio hires variant.
Matti Hamalainen <ccr@tnsp.org>
parents:
2152
diff
changeset
|
2350 fmtProbeArtStudio, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2351 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
|
2352 { }, &dmC64CommonFormats[2] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2353 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2354 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2355 { |
1819
c12bd223000e
Enable write support for some formats that should be workable.
Matti Hamalainen <ccr@tnsp.org>
parents:
1816
diff
changeset
|
2356 "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
|
2357 NULL, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2358 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2359 { }, &dmC64CommonFormats[2] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2360 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2361 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2362 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2363 "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
|
2364 fmtProbeDoodle, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2365 NULL, NULL, |
1840
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2366 { }, &dmC64CommonFormats[10] |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2367 }, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2368 |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2369 { |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2370 "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
|
2371 fmtProbeDoodle, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2372 fmtDecodeStaticRLEMarkerMode2, fmtEncodeStaticRLEMarkerMode2, |
8d6bb48f2806
Implement support for packed variant of Doodle format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1839
diff
changeset
|
2373 { }, &dmC64CommonFormats[10] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2374 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2375 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2376 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2377 "mon", "Monomagic (unpacked)", 0x2000, 8194, DM_FMT_RDWR, |
1670
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2378 NULL, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2379 NULL, NULL, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2380 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2381 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2382 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2383 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2384 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2385 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2386 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2387 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2388 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2389 { DO_SET_OP , DS_SCREEN_RAM , 0xCF , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2390 // Default colors used by MM are --^^ |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2391 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2392 } |
1670
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2393 }, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2394 NULL |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2395 }, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2396 |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
2397 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2398 "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
|
2399 NULL, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2400 NULL, NULL, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2401 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2402 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2403 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2404 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2405 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2406 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2407 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2408 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2409 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2410 { DO_SET_OP , DS_SCREEN_RAM , 0xF0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2411 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2412 } |
1671
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2413 }, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2414 NULL |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2415 }, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2416 |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
2417 { |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2418 "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
|
2419 fmtProbeGigapaintHires, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2420 NULL, NULL, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2421 { |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2422 D64_FMT_HIRES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2423 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2424 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2425 1, 1, |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2426 NULL, NULL, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2427 NULL, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2428 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2429 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2430 { DO_SET_OP , DS_SCREEN_RAM , 0x0F , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2431 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1915
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2432 } |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2433 }, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2434 NULL |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2435 }, |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2436 |
788cfc7096f3
Add support for Gigapaint hires (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1912
diff
changeset
|
2437 { |
1857
5d9dd663df8d
Fix Pu-239 BFLI / BigFLI support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1856
diff
changeset
|
2438 "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
|
2439 NULL, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
2440 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
|
2441 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2442 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2443 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT * 2, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2444 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2445 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2446 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2447 fmtGetPixelBFLI, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2448 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2449 { DO_COPY , DS_COLOR_RAM , 0x0001, 0, 0x400 , 0, NULL, NULL, DF_NORMAL }, |
2307 | 2450 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x0401, 0, 0x400 , 0, DF_NORMAL), |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2451 { DO_COPY , DS_BITMAP_RAM , 0x2401, 0, 0x2000, 0, NULL, NULL, DF_NORMAL }, |
2307 | 2452 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x4401, 8, 0x400 , 0x400, DF_NORMAL), |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2453 { DO_COPY , DS_BITMAP_RAM , 0x6401, 1, 0x2000, 0, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2454 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2455 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2456 } |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2457 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2458 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
|
2459 }, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
2460 |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
2461 { |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2462 "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
|
2463 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2464 NULL, NULL, |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2465 { }, &dmC64CommonFormats[1] |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2466 }, |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2467 |
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2468 { |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
2469 "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
|
2470 fmtProbeBlackMailFLIPacked, |
1832
843d3a593f05
Implement write support for Black Mail FLI Designer packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1819
diff
changeset
|
2471 fmtDecodeBlackMailFLIPacked, fmtEncodeBlackMailFLIPacked, |
1788
04e13949b314
Implement support for packed variant of Black Mail FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1780
diff
changeset
|
2472 { }, &dmC64CommonFormats[1] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2473 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2474 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2475 { |
2308
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
2476 "dfed", "Dolphins FLI Editor v3.2 (unpacked)", 0x3b00, 17665, DM_FMT_RDWR, |
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
2477 NULL, |
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
2478 NULL, NULL, |
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
2479 { }, &dmC64CommonFormats[1] |
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
2480 }, |
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
2481 |
28701abacc31
Add support for Dolphins FLI Editor v3.2 (unpacked), which is exactly(?)
Matti Hamalainen <ccr@tnsp.org>
parents:
2307
diff
changeset
|
2482 { |
2014
a49f7e83edcb
Fix FBI FLI Designer format names to match v1.x and v2.
Matti Hamalainen <ccr@tnsp.org>
parents:
1985
diff
changeset
|
2483 "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
|
2484 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
|
2485 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
|
2486 { }, &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
|
2487 }, |
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
|
2488 |
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
|
2489 { |
2014
a49f7e83edcb
Fix FBI FLI Designer format names to match v1.x and v2.
Matti Hamalainen <ccr@tnsp.org>
parents:
1985
diff
changeset
|
2490 "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
|
2491 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
|
2492 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
|
2493 { }, &dmC64CommonFormats[9] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2494 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2495 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2496 { |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2497 "flnt", "Flinterlazer 1.0 (unpacked)", 0x284e, 38812, DM_FMT_RD | DM_FMT_BROKEN, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2498 NULL, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2499 NULL, NULL, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2500 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2501 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2502 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2503 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2504 2, 1, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2505 NULL, NULL, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2506 fmtGetPixelFlinterlazer, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2507 { |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2508 { DO_COPY , DS_COLOR_RAM , 0x0000 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2509 { DO_COPY , DS_COLOR_RAM , 0x0000 , 1, 0 , 0, NULL, NULL, DF_NORMAL }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2510 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2511 { DO_COPY , DS_BITMAP_RAM , 0x4000 - 0x284e, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2512 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x6000 - 0x284e, 0, 0x400, 0, DF_NORMAL), |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2513 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2514 { DO_COPY , DS_BITMAP_RAM , 0x8000 - 0x284e, 1, 0 , 0, NULL, NULL, DF_NORMAL }, |
2300
a494e4a4b6bc
Minor improvements to Flinterlazer support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2299
diff
changeset
|
2515 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0xA000 - 0x284e, 8, 0x400, 0, DF_NORMAL), |
2299
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2516 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2517 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_COLOR, 0 , 0 , D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2518 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8 , 0, 0 , D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2519 { DO_FUNC , 0 , 0 , 0, 0, 0, fmtDecodeFlinterlazer, NULL, DF_NORMAL }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2520 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2521 } |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2522 }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2523 NULL |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2524 }, |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2525 |
ad019d930401
Add initial (broken) read support for Flinterlazer 1.0 images.
Matti Hamalainen <ccr@tnsp.org>
parents:
2294
diff
changeset
|
2526 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2527 "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
|
2528 NULL, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2529 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
|
2530 { }, &dmC64CommonFormats[7] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2531 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2532 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2533 { |
2311
d0608fbd85bc
Change ECI Graphic Editor 1.0 (packed) extension from "ecp" to "ecip".
Matti Hamalainen <ccr@tnsp.org>
parents:
2308
diff
changeset
|
2534 "ecip", "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
|
2535 fmtProbeECIPacked, |
1912
8d006508e6c1
Implement write support for ECI Graphic Editor 1.0 packed format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1880
diff
changeset
|
2536 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
|
2537 { }, &dmC64CommonFormats[7] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2538 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2539 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2540 { |
1979
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2541 "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
|
2542 NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2543 NULL, NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2544 { // 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
|
2545 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2546 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2547 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2548 2, 1, |
1979
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2549 NULL, NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2550 NULL, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2551 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2552 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2553 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2554 { DO_COPY , DS_COLOR_RAM , 0x2328, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2555 { DO_SET_MEM_LO , DS_BGCOL , 0x2710, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2556 { DO_SET_MEM_LO , DS_D020 , 0x2711, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2557 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1979
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2558 } |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2559 }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2560 NULL |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2561 }, |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2562 |
5fc3da6061be
Add support for Face Painter format (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
1946
diff
changeset
|
2563 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2564 "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
|
2565 NULL, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2566 NULL, NULL, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2567 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2568 D64_FMT_MC, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2569 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2570 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2571 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2572 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2573 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2574 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2575 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2576 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2577 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2578 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2579 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2580 } |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2581 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2582 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2583 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2584 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2585 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2586 "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
|
2587 fmtProbeFormatXX2, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2588 fmtDecodeFormatXX2, NULL, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2589 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2590 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
|
2591 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
|
2592 XX2_WIDTH_CH , XX2_HEIGHT_CH, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2593 2, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2594 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2595 NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2596 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2597 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, XX2_BSIZE, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2598 { DO_COPY , DS_SCREEN_RAM , XX2_BSIZE, 0, XX2_SIZE, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2599 { DO_COPY , DS_COLOR_RAM , XX2_BSIZE + XX2_SIZE, 0, XX2_SIZE, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2600 { DO_SET_OP , DS_BGCOL , 11 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2601 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2602 } |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2603 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2604 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2605 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2606 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2607 { |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2608 "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, DM_FMT_RDWR, |
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2609 fmtProbeFunPaint2, |
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2610 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
|
2611 { }, &dmC64CommonFormats[3] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2612 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2613 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2614 { |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2615 "fp2p", "FunPaint II (packed)", 0x3ff0, 0, DM_FMT_RDWR, |
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2616 fmtProbeFunPaint2, |
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2617 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
|
2618 { }, &dmC64CommonFormats[3] |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2619 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2620 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2621 { |
2191 | 2622 "gun", "GunPaint 1.1 (unpacked)", 0x4000, 33603, DM_FMT_RDWR, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2623 fmtProbeGunPaint, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2624 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2625 { |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2626 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2627 D64_SCR_WIDTH, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2628 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2629 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2630 NULL, NULL, |
1850
3d6917948061
Backed out changeset 914dbb50139f
Matti Hamalainen <ccr@tnsp.org>
parents:
1849
diff
changeset
|
2631 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
|
2632 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2633 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x0000, 0, 0x400, 0, DF_NORMAL), |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2634 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2635 { DO_COPY , DS_EXTRA_DATA , 0x3f4f, 0, 177, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2636 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2637 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x4400, 8, 0x400, 0, DF_NORMAL), |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2638 { DO_COPY , DS_BITMAP_RAM , 0x6400, 1, 0 , 0, NULL, NULL, DF_NORMAL }, |
1847
e3d1f16be4ee
Using the newly introduced data block offset feature, unify the handling of
Matti Hamalainen <ccr@tnsp.org>
parents:
1846
diff
changeset
|
2639 // 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
|
2640 // XXX TODO: According to some, the last 4 should be same .. |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2641 { DO_SET_MEM , DS_EXTRA_DATA , 0 , 0, 3 , 20+177, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2642 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_RES , 0, 0 , D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, |
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2643 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8 , 0, 0 , D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2644 { DO_FUNC , 0 , 0 , 0, 0 , 0, NULL, fmtEncodeGunPaint, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2645 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
1805 | 2646 } |
2647 }, | |
2648 NULL | |
2649 }, | |
2650 | |
2651 { | |
1877
f8b7baf3ff89
Some fixes to HCB support, now the background colors are supported correctly.
Matti Hamalainen <ccr@tnsp.org>
parents:
1876
diff
changeset
|
2652 "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
|
2653 NULL, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2654 NULL, NULL, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2655 { |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2656 D64_FMT_MC | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2657 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2658 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2659 2, 1, |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2660 NULL, NULL, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2661 fmtGetPixelHCB, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2662 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2663 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2664 { DO_COPY , DS_COLOR_RAM , 0x0400, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2665 { DO_COPY , DS_SCREEN_RAM , 0x0800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2666 { DO_COPY , DS_SCREEN_RAM , 0x0c00, 1, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2667 { DO_COPY , DS_BITMAP_RAM , 0x1000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2668 { DO_COPY , DS_EXTRA_DATA , 0x2f40, 0, D64_SCR_HEIGHT / 4, 0, NULL, NULL, DF_NORMAL }, |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2669 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8 , 0, 0 , D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2670 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1876
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2671 } |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2672 }, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2673 NULL |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2674 }, |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2675 |
a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1861
diff
changeset
|
2676 { |
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
|
2677 "pen", "Pentel Paint (unpacked)", 0x4800, 19845, DM_FMT_RD | DM_FMT_BROKEN, |
1805 | 2678 NULL, |
2679 NULL, NULL, | |
2680 { | |
2314
87533af8db64
Add format flag for formats that use sprite layer.
Matti Hamalainen <ccr@tnsp.org>
parents:
2313
diff
changeset
|
2681 D64_FMT_HIRES | D64_FMT_FLI | D64_FMT_SPRITES, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2682 192, D64_SCR_HEIGHT, |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2683 24, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2684 2, 1, |
1805 | 2685 NULL, NULL, |
2686 fmtGetPixelPentelPaint, | |
2687 { | |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2688 { DO_COPY , DS_BITMAP_RAM , 0x0000 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2689 { DO_SET_OP , DS_SCREEN_RAM , 0x10 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2690 { DO_SET_MEM_LO , DS_BGCOL , 0x9580 - 0x4800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2691 { DO_SET_MEM_LO , DS_D022 , 0x9581 - 0x4800, 0, 0, 0, NULL, NULL, DF_NORMAL }, // Sprite color |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2692 { DO_SET_MEM_LO , DS_COLOR_RAM , 0x9582 - 0x4800, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2693 { DO_COPY , DS_EXTRA_DATA , 0x5ac0 - 0x4800, 0, D64_SPR_SIZE * 235, 0, NULL, NULL, DF_NORMAL }, // Sprite data |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2694 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8 , 0, 0 , D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2695 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2696 } |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2697 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2698 NULL |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2699 }, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2700 |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2701 { |
2169
271850d7dd9b
Rename "Crest Hires FLI Designer (unpacked)" format short name to "chfd" from "chid".
Matti Hamalainen <ccr@tnsp.org>
parents:
2168
diff
changeset
|
2702 "chfd", "Crest Hires FLI Designer (unpacked)", 0x4000, 16386, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2703 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2704 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2705 { |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2706 D64_FMT_HIRES | D64_FMT_FLI, |
2125
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2707 D64_SCR_WIDTH, D64_SCR_HEIGHT, // Actually 296 x 112 (=14*8) |
56d4dc81774b
Rename various C64_* constants to D64_*.
Matti Hamalainen <ccr@tnsp.org>
parents:
2121
diff
changeset
|
2708 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
2056
c27ed6465022
Add pixel aspect ratio information for C64 formats. Not used yet.
Matti Hamalainen <ccr@tnsp.org>
parents:
2033
diff
changeset
|
2709 1, 1, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2710 NULL, NULL, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2711 fmtGetPixelCrestHIFLIorCDHM, |
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2712 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2713 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2714 DEF_REPEAT_BLOCK_8(DS_SCREEN_RAM , 0x2000, 0, 0x400, 0, DF_NORMAL), |
2238
5db6e0b63b35
Change again how the interlace type information is stored. Now store it in
Matti Hamalainen <ccr@tnsp.org>
parents:
2224
diff
changeset
|
2715 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8 , 0, 0 , D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2716 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL, DF_NORMAL }, |
1775
4e4d54135baf
Refactor the c64 bitmap format definitions handling to be more flexible. Again.
Matti Hamalainen <ccr@tnsp.org>
parents:
1773
diff
changeset
|
2717 } |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2718 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
2719 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2720 }, |
1803
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
2721 |
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
2722 { |
2197
23dd0e0fe25d
Enable write support for Crest Super Hires FLI unpacked format (only
Matti Hamalainen <ccr@tnsp.org>
parents:
2196
diff
changeset
|
2723 "cshf", "Crest Super Hires FLI Editor v1.0 (unpacked)", 0x4000, 15874, DM_FMT_RDWR, |
2167
9d362ea1a606
Add probe function for Crest Super Hires FLI Editor v1.0 (unpacked).
Matti Hamalainen <ccr@tnsp.org>
parents:
2166
diff
changeset
|
2724 fmtProbeCrestSHFLI, |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2725 NULL, NULL, |
2189
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2726 { }, &dmC64CommonFormats[11] |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2727 }, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2728 |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2729 { |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2730 "cshfp", "Crest Super Hires FLI Editor v1.0 (packed)", 0xa000, 0, DM_FMT_RD, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2731 fmtProbeCrestSHFLI, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2732 fmtDecodeCrestSHFLIPacked, NULL, |
83391646ff16
Add read support for packed version of Crest Super Hires FLI format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2188
diff
changeset
|
2733 { }, &dmC64CommonFormats[11] |
2165
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2734 }, |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2735 |
3d3094ba21c5
Add read-only support for Crest Super Hires FLI Editor v1.0 (unpacked) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2164
diff
changeset
|
2736 { |
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
|
2737 "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
|
2738 fmtProbeCosmosDesignsHiresManager, |
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
2739 NULL, NULL, |
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
2740 { }, &dmC64CommonFormats[8] |
7df833754fd1
Add Cosmos Designs Hires Manager unpacked format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1802
diff
changeset
|
2741 }, |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
2742 |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2743 { |
2151
0a7ebb7198e3
Few additional cleanups in the CDHM decoder, and mark the format support as not-broken anymore.
Matti Hamalainen <ccr@tnsp.org>
parents:
2150
diff
changeset
|
2744 "cdhp", "Cosmos Designs Hires Manager (packed)", 0x4000, 0, DM_FMT_RD, |
2141
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
2745 fmtProbeCosmosDesignsHiresManager, |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
2746 fmtDecodeCosmosDesignsHiresManagerPacked, NULL, |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
2747 { }, &dmC64CommonFormats[8] |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
2748 }, |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
2749 |
009ee261704c
Add somewhat broken support for decoding packed Cosmos Designs Hires Manager files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2139
diff
changeset
|
2750 { |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
2751 "mrqp", "Marq's PETSCII editor (unpacked)", 0x0801, 0, DM_FMT_RDWR, |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2752 fmtProbeMarqPETSCII, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2753 NULL, NULL, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2754 { |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2755 D64_FMT_HIRES | D64_FMT_CHAR, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2756 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2757 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2758 1, 1, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2759 NULL, NULL, |
2172
de88333acc44
Move the PETSCII getpixel function to lib64gfx.c and remove the
Matti Hamalainen <ccr@tnsp.org>
parents:
2170
diff
changeset
|
2760 NULL, |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2761 { |
2134
5daed72fd211
Improve Marq's PETSCII prg export support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2133
diff
changeset
|
2762 // For offset values see petscii/m_c64.pde :: save_prg() |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
2763 { DO_FUNC , 0 , 20 - 2, 0, 0, 0, NULL, fmtEncodeMarqPETSCIIData, DF_NORMAL }, |
2287
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
2764 { DO_COPY , DS_SCREEN_RAM , 0x60 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
631bbd451d08
Add write support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2265
diff
changeset
|
2765 { DO_COPY , DS_COLOR_RAM , 0x60 + 1000,0,0, 0, NULL, NULL, DF_NORMAL }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2766 { DO_SET_MEM_LO , DS_D020 , 25 - 2, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2767 { DO_SET_MEM_LO , DS_BGCOL , 30 - 2, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
2768 { DO_FUNC , 0 , 20 - 2, 0, 0, 0, fmtDecodeHiresPETSCIICharsetData, NULL, DF_NORMAL }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2769 |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2770 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2130
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2771 } |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2772 }, |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2773 NULL |
3b5be00759ed
Add initial (and incomplete) support for Marq's PETSCII editor PRG export format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2129
diff
changeset
|
2774 }, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2775 |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2776 { |
2363
5d68a104635d
Change "Unknown PETSCII (unpacked)" to "Unknown PETSCII editor (unpacked)"
Matti Hamalainen <ccr@tnsp.org>
parents:
2362
diff
changeset
|
2777 "upet", "Unknown PETSCII editor (unpacked)", 0x0801, 2499, DM_FMT_RD, |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2778 NULL, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2779 NULL, NULL, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2780 { |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2781 D64_FMT_HIRES | D64_FMT_CHAR, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2782 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2783 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2784 1, 1, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2785 NULL, NULL, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2786 NULL, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2787 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2788 { DO_COPY , DS_SCREEN_RAM , 0x01ab, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2789 { DO_COPY , DS_COLOR_RAM , 0x01ab + 1000, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2790 |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2791 { DO_SET_MEM_LO , DS_D020 , 0x01a9, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2792 { DO_SET_MEM_LO , DS_BGCOL , 0x01aa, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2366
1e6e018b6487
Rename some functions to be more consistent with their intent.
Matti Hamalainen <ccr@tnsp.org>
parents:
2363
diff
changeset
|
2793 { DO_FUNC , 0 , 0 , 0, 0, 0, fmtDecodeUPETSCIIData, NULL, DF_NORMAL }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2794 |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2795 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2173
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2796 } |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2797 }, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2798 NULL |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2799 }, |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2800 |
a5c4eb5c7309
Add read support for unknown PETSCII PRG export format (could be earlier version
Matti Hamalainen <ccr@tnsp.org>
parents:
2172
diff
changeset
|
2801 { |
2138
fdd0fd7dc0e6
Some more work on charmap and PETSCII support.
Matti Hamalainen <ccr@tnsp.org>
parents:
2135
diff
changeset
|
2802 "pkhu", "petscii.krissz.hu editor (unpacked)", 0x0801, 0, DM_FMT_RD, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2803 fmtProbePetsciiKrisszHu, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2804 NULL, NULL, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2805 { |
2139
84780a9d8d17
Improve and fix charmap format decoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
2138
diff
changeset
|
2806 D64_FMT_CHAR, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2807 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2808 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2809 1, 1, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2810 NULL, NULL, |
2172
de88333acc44
Move the PETSCII getpixel function to lib64gfx.c and remove the
Matti Hamalainen <ccr@tnsp.org>
parents:
2170
diff
changeset
|
2811 NULL, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2812 { |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2813 { DO_COPY , DS_SCREEN_RAM , 0x2001 - 2, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2814 { DO_COPY , DS_COLOR_RAM , 0x23e9 - 2, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2815 |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2816 { DO_COPY , DS_EXTRA_DATA , 0x0000 , 0, 0x0100, 0, NULL, NULL, DF_NORMAL }, |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2817 { DO_COPY , DS_CHAR_DATA , 0x1801 - 2, 0, 0x0800, 0, NULL, NULL, DF_NORMAL }, |
2366
1e6e018b6487
Rename some functions to be more consistent with their intent.
Matti Hamalainen <ccr@tnsp.org>
parents:
2363
diff
changeset
|
2818 { DO_FUNC , 0 , 0 , 0, 0 , 0, fmtDecodePetsciiKrisszHuData, NULL, DF_NORMAL }, |
2196
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2819 |
28871f500e84
Add new "flags" field to DMC64EncDecOp, defined by DF_* that can be used to
Matti Hamalainen <ccr@tnsp.org>
parents:
2195
diff
changeset
|
2820 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2135
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2821 } |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2822 }, |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2823 NULL |
cb4689d9ceed
Add initial (and incomplete) support for petscii.krissz.hu PETSCII editor PRG export files.
Matti Hamalainen <ccr@tnsp.org>
parents:
2134
diff
changeset
|
2824 }, |
2362
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2825 |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2826 { |
2367
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
2827 "poca", "Petscii Coca editor (unpacked)", 0x0801, 0, DM_FMT_RDWR, |
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
2828 fmtProbeCocaPETSCII, |
2362
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2829 NULL, NULL, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2830 { |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2831 D64_FMT_HIRES | D64_FMT_CHAR, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2832 D64_SCR_WIDTH , D64_SCR_HEIGHT, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2833 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2834 1, 1, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2835 NULL, NULL, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2836 NULL, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2837 { |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
2838 { DO_FUNC , 0 , 0x0c44 - 0x0801, 0, 0, 0, NULL, fmtEncodeCocaPETSCIIData, DF_NORMAL }, |
2362
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2839 { DO_COPY , DS_SCREEN_RAM , 0x085a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2840 { DO_COPY , DS_COLOR_RAM , 0x0c5a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2367
36226425aac1
Fix Petscii Coca editor format writing.
Matti Hamalainen <ccr@tnsp.org>
parents:
2366
diff
changeset
|
2841 |
2362
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2842 { DO_SET_MEM_LO , DS_D020 , 0x0c42 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2843 { DO_SET_MEM_LO , DS_BGCOL , 0x0c43 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL }, |
2368
4cd67faadbd3
Fix encoding and improve decoding of character set case (upper/lower) for two PETSCII formats. Also generalize the functions a bit.
Matti Hamalainen <ccr@tnsp.org>
parents:
2367
diff
changeset
|
2844 { DO_FUNC , 0 , 0x0c44 - 0x0801, 0, 0, 0, fmtDecodeHiresPETSCIICharsetData, NULL, DF_NORMAL }, |
2362
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2845 |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2846 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2847 } |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2848 }, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2849 NULL |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2850 }, |
6119b9b560fb
Add support for Petscii Coca (Cola) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
2343
diff
changeset
|
2851 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2852 }; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2853 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
2854 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
|
2855 |