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