Mercurial > hg > dmlib
annotate tools/lib64fmts.c @ 1731:474055f25ab0
Move dmDefaultC64Palette back to lib64gfx.c
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 08 Jun 2018 22:07:05 +0300 |
parents | 12504f179749 |
children | 183d503b17a7 |
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 |
1594
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
13 static int fmtProbeKoalaPaintPacked(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) |
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 |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
16 if (len > 30 && |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
17 len != 10006 && |
1636
710961d02b8a
Fix packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1635
diff
changeset
|
18 len != 10003 && |
1594
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
19 dmCompareAddr16(buf, 0, fmt->addr)) |
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
20 return DM_PROBE_SCORE_MAX; |
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 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
26 static int fmtDecodeKoalaPaintPacked(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 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
48 static int fmtEncodeKoalaPaintPacked(DMGrowBuf *buf, const DMC64Image *img, const DMC64ImageFormat *fmt) |
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 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
73 static int fmtProbeDrazPaint20Packed(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
74 { |
1662 | 75 const Uint8 *ident = buf + 2; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
76 if (len > 22 && |
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, |
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
101 dmGrowBufCreateFromOffs(&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; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
117 const char *magicID = (fmt->type & D64_FMT_ILACE) ? "DRAZLACE! 1.0" : "DRAZPAINT 2.0"; |
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 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
149 static int fmtProbeDrazLace10Packed(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
150 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
151 if (len > 22 && |
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) && |
1662 | 153 memcmp(buf + 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 | |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
180 static int fmtProbeBDP5Packed(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
181 { |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
182 if (len > 20 && |
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) && |
1662 | 184 memcmp(buf + 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 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
203 if ((res = dmDecodeGenericRLEAlloc(&mem, |
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
204 dmGrowBufCreateFromOffs(&tmp, buf, 10), &cfg)) != DMERR_OK) |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
205 goto out; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
206 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
207 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
|
208 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
209 out: |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
210 dmGrowBufFree(&mem); |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
211 return res; |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
212 } |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
213 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
214 |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
215 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
|
216 { |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
217 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
218 DMGrowBuf mem; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
219 DMCompParams cfg; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
220 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
221 // 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
|
222 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
|
223 goto out; |
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 // 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
|
226 cfg.func = fmt->name; |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
227 cfg.type = DM_COMP_RLE_MARKER; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
228 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
|
229 cfg.rleMinCountB = 3; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
230 cfg.rleMaxCountB = 255; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
231 cfg.rleMinCountW = 256; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
232 cfg.rleMaxCountW = 1024; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
233 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
234 dmGenericRLEAnalyze(&mem, &cfg); |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
235 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
236 // 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
|
237 if (!dmGrowBufPut(buf, (Uint8 *) fmtBDP5MagicID, strlen(fmtBDP5MagicID)) || |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
238 !dmGrowBufPutU8(buf, cfg.rleMarkerB) || |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
239 !dmGrowBufPutU8(buf, cfg.rleMarkerW)) |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
240 { |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
241 res = DMERR_MALLOC; |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
242 goto out; |
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 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
245 // 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
|
246 res = dmEncodeGenericRLE(buf, &mem, &cfg); |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
247 |
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
248 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
249 dmGrowBufFree(&mem); |
1663
8ae32df3c184
Add support for BDP5 format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1662
diff
changeset
|
250 return res; |
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 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
254 static int fmtProbeGunPaint(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
255 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
256 if (len > 0x400 && |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
257 dmCompareAddr16(buf, 0, fmt->addr) && |
1662 | 258 memcmp(buf + 0x3ea, "GUNPAINT (JZ) ", 14) == 0) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
259 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
|
260 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
261 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
|
262 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
263 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
264 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
265 static int fmtProbeAmicaPaintPacked(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
266 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
267 size_t i, n; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
268 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
269 if (len < 2048 || !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
|
270 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
|
271 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
272 // 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
|
273 // as do some GunPaint images .. |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
274 if (len == 9002 || fmtProbeGunPaint(buf, len, fmt) > DM_PROBE_SCORE_GOOD) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
275 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
|
276 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
277 for (n = 0, i = 2; i < len; i++) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
278 if (buf[i] == 0xC2) n++; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
279 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
280 if (n > 50) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
281 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
|
282 if (n > 25) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
283 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
|
284 if (n > 10) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
285 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
|
286 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
287 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
|
288 } |
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 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
291 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
|
292 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
293 int res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
294 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
|
295 DMCompParams cfg; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
296 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
297 // 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
|
298 // so we need to do some crappy buffer expansion here .. |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
299 if ((res = dmGrowBufAlloc(&tmp, buf->len + 4, 4)) != DMERR_OK) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
300 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
301 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
302 memcpy(tmp.data, buf->data, buf->len); |
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
303 tmp.len = buf->len + 1; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
304 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
305 // 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
|
306 cfg.func = fmt->name; |
1712 | 307 cfg.type = DM_COMP_RLE_MARKER; |
308 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; | |
309 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
|
310 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
311 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
|
312 goto out; |
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 // 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
|
315 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
|
316 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
317 out: |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
318 dmGrowBufFree(&tmp); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
319 dmGrowBufFree(&mem); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
320 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
321 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
322 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
323 |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
324 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
|
325 { |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
326 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
327 DMGrowBuf mem; |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
328 DMCompParams cfg; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
329 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
330 // 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
|
331 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
|
332 goto out; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
333 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
334 // 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
|
335 cfg.func = fmt->name; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
336 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
|
337 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
|
338 cfg.rleMarkerB = 0xC2; |
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
339 cfg.rleMinCountB = 3; |
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
340 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
|
341 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
342 res = dmEncodeGenericRLE(buf, &mem, &cfg); |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
343 |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
344 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
345 dmGrowBufFree(&mem); |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
346 return res; |
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
347 } |
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 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
350 static int fmtProbeFLIDesigner(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
351 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
352 if (len == fmt->size && |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
353 (dmCompareAddr16(buf, 0, 0x3c00) || dmCompareAddr16(buf, 0, 0x3ff0))) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
354 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
|
355 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
356 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
|
357 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
358 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
359 |
1529
4068d87ca884
Rename some decoder functions.
Matti Hamalainen <ccr@tnsp.org>
parents:
1505
diff
changeset
|
360 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
|
361 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
|
362 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
363 (void) op; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
364 (void) buf; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
365 (void) fmt; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
366 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
|
367 return TRUE; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
368 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
369 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
370 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
371 static Uint8 fmtGetPixelTruePaint( |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
372 const DMC64Image *img, const int bmoffs, const int scroffs, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
373 const int vshift, const int vbitmap, const int raster) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
374 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
375 (void) raster; |
1577
632f1dbc83eb
Get rid of some code duplication by merging functionality of certain pixel
Matti Hamalainen <ccr@tnsp.org>
parents:
1575
diff
changeset
|
376 return dmC64GetGenericMCPixel(img, bmoffs, scroffs, vshift, 0, vbitmap, 0, img->bgcolor); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
377 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
378 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
379 |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
380 static int fmtProbeTruePaintPacked(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
381 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
382 // 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
|
383 // relocation of decompression code |
1684 | 384 static const Uint8 magicID[] = { |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
385 0x0b, 0x08, 0x09, 0x00, 0x9e, 0x32, 0x30, 0x35, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
386 0x39, 0x00, 0xa2, 0x00, 0x78, 0xbd, 0x1c, 0x08, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
387 0x9d, 0xf5, 0x00, 0xe8, 0xd0, 0xf7, 0xe6, 0x01, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
388 0x4c, 0x01, 0x01, 0xa5, 0xfe, 0xd0, 0x02, 0xc6, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
389 0xff, 0xc6, 0xfe |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
390 }; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
391 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
392 if (len >= 512 && dmCompareAddr16(buf, 0, fmt->addr) && |
1684 | 393 memcmp(buf + 2, magicID, sizeof(magicID)) == 0) |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
394 return DM_PROBE_SCORE_MAX; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
395 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
396 return DM_PROBE_SCORE_FALSE; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
397 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
398 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
399 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
400 // |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
401 // 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
|
402 // 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
|
403 // simplistic "codebook". |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
404 // |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
405 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
|
406 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
407 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
|
408 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
409 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
|
410 "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
|
411 } |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
412 else |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
413 return DMERR_OK; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
414 } |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
415 |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
416 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
417 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
|
418 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
419 int res = DMERR_OK; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
420 const Uint8 *codeBook1, *codeBook2; |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
421 DMGrowBuf dst, src; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
422 DMCompParams cfg; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
423 Uint8 data; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
424 |
1724 | 425 // 1b7e-67e8 decoded by original depacker |
426 // 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
|
427 cfg.func = fmt->name; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
428 cfg.type = DM_COMP_RLE_MARKER; |
1724 | 429 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
|
430 cfg.rleMarkerB = 0xfe; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
431 cfg.cropOutLen = 0x67e8 - 0x1c00; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
432 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
433 // 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
|
434 codeBook1 = psrc->data + 0x81 - 2; |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
435 codeBook2 = psrc->data + 0x85 - 2; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
436 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
437 // Allocate output buffer |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
438 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
|
439 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
440 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
441 // 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
|
442 // 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
|
443 dmGrowBufConstCopy(&src, psrc); |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
444 dmSetupRLEBuffers(&dst, &src, &cfg); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
445 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
446 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
|
447 { |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
448 unsigned int count = 1; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
449 BOOL found = FALSE; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
450 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
451 for (int n = 0; n < 8; n++) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
452 if (codeBook1[n] == data && !found) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
453 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
454 found = TRUE; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
455 switch (n) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
456 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
457 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
|
458 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
|
459 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
460 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
461 count = data; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
462 if (data == 0) |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
463 goto finish; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
464 |
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
465 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
466 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
467 case 1: // Y = 1, JTO = $17 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
468 count += 2; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
469 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
470 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
471 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
|
472 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
|
473 goto out; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
474 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
475 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
476 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
|
477 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
|
478 goto out; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
479 |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
480 count = data; |
1649
dbdff3d50a4e
Clean up fmtDecodeTruePaintPacked() a bit, and fix GCC warnings about
Matti Hamalainen <ccr@tnsp.org>
parents:
1648
diff
changeset
|
481 // fallthrough |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
482 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
483 case 3: // Y = 3, JTO = $0B |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
484 count += 2; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
485 data = 0; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
486 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
487 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
488 default: // Y = [5..8], JTO = $00 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
489 count++; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
490 data = codeBook2[n]; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
491 break; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
492 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
493 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
494 |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
495 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
|
496 goto out; |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
497 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
498 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
499 finish: |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
500 dmFinishRLEBuffers(&dst, &src, &cfg); |
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
501 res = dmC64DecodeGenericBMP(img, &dst, fmt); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
502 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
503 out: |
1722
de8e0a404c06
Refactor fmtDecodeTruePaintPacked() to use more generic DMGrowBuf functions
Matti Hamalainen <ccr@tnsp.org>
parents:
1714
diff
changeset
|
504 dmGrowBufFree(&dst); |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
505 return res; |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
506 } |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
507 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
508 |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
509 #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
|
510 #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
|
511 #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
|
512 #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
|
513 #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
|
514 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
515 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
516 static int fmtProbeFormatXX2(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
517 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
518 if (len >= XX2_MIN_SIZE && len <= XX2_MIN_SIZE + 8 && |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
519 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
|
520 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
|
521 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
522 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
|
523 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
524 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
525 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
526 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
|
527 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
528 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
529 DMGrowBuf tmp; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
530 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
531 // 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
|
532 // 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
|
533 // Otherwise allocate len bytes. |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
534 size_t nlen = buf->len < XX2_MIN_SIZE ? XX2_MIN_SIZE : buf->len; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
535 Uint8 *mem = dmMalloc0(nlen); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
536 if (mem == NULL) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
537 return DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
538 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
539 memcpy(mem, buf->data, buf->len); |
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
540 res = dmC64DecodeGenericBMP(img, dmGrowBufCreateFrom(&tmp, mem, nlen), fmt); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
541 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
542 dmFree(mem); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
543 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
544 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
545 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
546 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
547 #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
|
548 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
|
549 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
550 |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
551 static int fmtProbeFunPaint2(const Uint8 *buf, const size_t len, const DMC64ImageFormat *fmt) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
552 { |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
553 if (len > 30 && |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
554 dmCompareAddr16(buf, 0, fmt->addr) && |
1662 | 555 memcmp(buf + 2, fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) == 0) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
556 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
|
557 else |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
558 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
|
559 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
560 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
561 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
562 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
|
563 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
564 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
565 DMGrowBuf tmp; |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
566 |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
567 // 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
|
568 if (buf->data[14]) |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
569 { |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
570 DMGrowBuf mem; |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
571 DMCompParams cfg; |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
572 |
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
|
573 cfg.func = fmt->name; |
1712 | 574 cfg.type = DM_COMP_RLE_MARKER; |
575 cfg.flags = DM_RLE_BYTE_RUNS | DM_RLE_ORDER_1; | |
576 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
|
577 |
1598
b5e0f28f1842
Adjust Fun Paint 2 decoding now that the RLE decoding is fixed.
Matti Hamalainen <ccr@tnsp.org>
parents:
1594
diff
changeset
|
578 if ((res = dmDecodeGenericRLEAlloc( |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
579 &mem, dmGrowBufCreateFromOffs(&tmp, buf, FUNPAINT2_HEADER_SIZE), &cfg)) == DMERR_OK) |
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
580 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
|
581 |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
582 dmGrowBufFree(&mem); |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
583 } |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
584 else |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
585 { |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
586 res = dmC64DecodeGenericBMP(img, dmGrowBufCreateFromOffs(&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
|
587 } |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
588 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
589 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
590 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
591 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
592 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
593 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
|
594 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
595 // 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
|
596 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
597 !dmGrowBufPutU8(buf, 0)) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
598 return DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
599 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
600 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
|
601 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
602 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
603 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
604 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
|
605 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
606 int res; |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
607 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
|
608 DMCompParams cfg; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
609 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
610 // 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
|
611 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
|
612 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
613 |
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
|
614 // 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
|
615 cfg.func = fmt->name; |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
616 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
|
617 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
|
618 cfg.rleMinCountB = 3; |
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
619 cfg.rleMaxCountB = 255; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
620 |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
621 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
|
622 |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
623 // 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
|
624 if (!dmGrowBufPut(buf, (Uint8 *) fmtFunPaint2MagicID, strlen(fmtFunPaint2MagicID)) || |
1660
7555c8803529
More work on improving the generic RLE decoder/encoder.
Matti Hamalainen <ccr@tnsp.org>
parents:
1653
diff
changeset
|
625 !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
|
626 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
627 res = DMERR_MALLOC; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
628 goto out; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
629 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
630 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
631 // 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
|
632 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
|
633 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
634 out: |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
635 dmGrowBufFree(&mem); |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
636 return res; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
637 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
638 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
639 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
640 static Uint8 fmtGetPixelFunPaint2( |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
641 const DMC64Image *img, const int bmoffs, const int scroffs, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
642 const int vshift, const int vbitmap, const int raster) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
643 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
644 const int vbank = (raster & 7) + (vbitmap * 8); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
645 int vr, vb; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
646 if (raster < 100) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
647 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
648 vb = 0; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
649 vr = raster; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
650 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
651 else |
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 vb = 0; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
654 vr = raster - 100; |
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 |
1577
632f1dbc83eb
Get rid of some code duplication by merging functionality of certain pixel
Matti Hamalainen <ccr@tnsp.org>
parents:
1575
diff
changeset
|
657 return dmC64GetGenericMCPixel( |
632f1dbc83eb
Get rid of some code duplication by merging functionality of certain pixel
Matti Hamalainen <ccr@tnsp.org>
parents:
1575
diff
changeset
|
658 img, bmoffs, scroffs, vshift, |
632f1dbc83eb
Get rid of some code duplication by merging functionality of certain pixel
Matti Hamalainen <ccr@tnsp.org>
parents:
1575
diff
changeset
|
659 vbank, vbitmap, 0, |
1588
ca087c0cc9c4
Refactor the c64 format memory handling a bit for more flexibility.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
660 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
|
661 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
662 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
663 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
664 static Uint8 fmtGetPixelGunPaint( |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
665 const DMC64Image *img, const int bmoffs, const int scroffs, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
666 const int vshift, const int vbitmap, const int raster) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
667 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
668 const int vbank = (raster & 7);// + (vbitmap * 8); |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
669 int vr, vb; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
670 if (raster < 177) |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
671 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
672 vb = 0; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
673 vr = raster; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
674 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
675 else |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
676 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
677 vb = 0; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
678 vr = raster - 177; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
679 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
680 |
1577
632f1dbc83eb
Get rid of some code duplication by merging functionality of certain pixel
Matti Hamalainen <ccr@tnsp.org>
parents:
1575
diff
changeset
|
681 return dmC64GetGenericMCPixel( |
632f1dbc83eb
Get rid of some code duplication by merging functionality of certain pixel
Matti Hamalainen <ccr@tnsp.org>
parents:
1575
diff
changeset
|
682 img, bmoffs, scroffs, vshift, |
632f1dbc83eb
Get rid of some code duplication by merging functionality of certain pixel
Matti Hamalainen <ccr@tnsp.org>
parents:
1575
diff
changeset
|
683 vbank, vbitmap, 0, |
1588
ca087c0cc9c4
Refactor the c64 format memory handling a bit for more flexibility.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
684 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
|
685 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
686 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
687 |
1582
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
688 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
|
689 const DMC64Image *img, const int bmoffs, const int scroffs, |
1633 | 690 const int vshift, const int bitmap, const int raster) |
1582
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
691 { |
1633 | 692 const int vbb = bmoffs > 0x1fff ? 1 : 0; |
1582
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
693 const int vbank = (raster & 7) + (vbb * 8); |
1633 | 694 const int vbmoffs = bmoffs & 0x1fff; |
695 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
|
696 |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
697 //fprintf(stderr, "bmoffs=%d, scroffs=%d, vshift=%d, vbitmap=%d, raster=%d\n", vbmoffs, vscroffs, vshift, vbb, raster); |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
698 |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
699 return dmC64GetGenericMCPixel( |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
700 img, vbmoffs, vscroffs, vshift, |
1633 | 701 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
|
702 } |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
703 |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
704 |
1581 | 705 static Uint8 fmtGetPixelBlackMailFLI( |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
706 const DMC64Image *img, const int bmoffs, const int scroffs, |
1633 | 707 const int shift, const int bitmap, const int raster) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
708 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
709 const int vbank = raster & 7; |
1577
632f1dbc83eb
Get rid of some code duplication by merging functionality of certain pixel
Matti Hamalainen <ccr@tnsp.org>
parents:
1575
diff
changeset
|
710 |
632f1dbc83eb
Get rid of some code duplication by merging functionality of certain pixel
Matti Hamalainen <ccr@tnsp.org>
parents:
1575
diff
changeset
|
711 return dmC64GetGenericMCPixel( |
1633 | 712 img, bmoffs, scroffs, shift, |
713 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
|
714 img->extraData[0].data[raster] & 15); |
1503
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 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
717 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
718 static Uint8 fmtGetPixelFLIDesigner( |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
719 const DMC64Image *img, const int bmoffs, const int scroffs, |
1633 | 720 const int shift, const int bitmap, const int raster) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
721 { |
1633 | 722 return dmC64GetGenericMCPixel(img, bmoffs, scroffs, shift, raster & 7, 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
|
723 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
724 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
725 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
726 static Uint8 fmtGetPixelCHFLI( |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
727 const DMC64Image *img, const int bmoffs, const int scroffs, |
1633 | 728 const int shift, const int bitmap, const int raster) |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
729 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
730 const int vbank = raster & 7; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
731 |
1633 | 732 if ((img->bitmap[bitmap].data[bmoffs] >> shift) & 1) |
1588
ca087c0cc9c4
Refactor the c64 format memory handling a bit for more flexibility.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
733 return img->screen[vbank].data[scroffs] >> 4; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
734 else |
1588
ca087c0cc9c4
Refactor the c64 format memory handling a bit for more flexibility.
Matti Hamalainen <ccr@tnsp.org>
parents:
1586
diff
changeset
|
735 return img->screen[vbank].data[scroffs] & 15; |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
736 } |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
737 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
738 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
739 // |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
740 // Helper macros for defining screen ram layouts |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
741 // common for FLI type foramts |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
742 // |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
743 #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
|
744 #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
|
745 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
|
746 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
|
747 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
|
748 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
|
749 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
|
750 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
|
751 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
|
752 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
|
753 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
754 |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
755 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
756 // |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
757 // 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
|
758 // unpacked versions of several formats. We'll reuse these here through |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
759 // this common formats ops array, referred from dmC64ImageFormats[] |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
760 // |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
761 const DMC64EncDecOpList dmC64CommonFormatOps[] = |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
762 { |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
763 { // #0: Koala Paint type memory layout |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
764 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
765 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
766 { DO_COPY , DS_COLOR_RAM , 0x2328, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
767 { DO_SET_MEM , DS_BGCOL , 0x2710, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
768 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
769 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
770 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
771 { // #1: Amica Paint, Run Paint, etc. layout |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
772 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
773 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
774 { DO_COPY , DS_COLOR_RAM , 0x2328, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
775 { DO_SET_MEM , DS_BGCOL , 0x2710, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
776 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
777 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
778 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
779 { // #2: Art Studio etc. Hires |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
780 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
781 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
782 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
783 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
784 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
785 { // #3: FunPaint II |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
786 DEF_SCREEN_RAMS_8(0x0000, 0, 0x400), |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
787 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
788 { DO_COPY , DS_EXTRA_DATA , 0x3f40, 0, 100, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
789 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
790 DEF_SCREEN_RAMS_8(0x43e8, 8, 0x400), |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
791 { DO_COPY , DS_BITMAP_RAM , 0x63e8, 1, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
792 { DO_COPY , DS_EXTRA_DATA , 0x8328, 1, 100, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
793 { DO_DEC_FUNC , 0 , 0x2742, 0, 1, fmtTruePaintGetLaceType, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
794 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
795 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
796 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
797 { // #4: DrazPaint 1.x & 2 |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
798 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
799 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
800 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
801 { DO_SET_MEM , DS_BGCOL , 0x2740, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
802 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
803 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
804 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
805 { // #5: DrazLace 1.0 |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
806 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
807 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
808 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
809 { DO_SET_MEM , DS_BGCOL , 0x2740, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
810 { DO_COPY , DS_BITMAP_RAM , 0x2800, 1, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
811 { DO_DEC_FUNC , 0 , 0x2742, 0, 1, fmtDrazLaceGetLaceType, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
812 { DO_ENC_FUNC , 0 , 0x2742, 0, 1, NULL, fmtDrazLaceSetLaceType }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
813 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
814 }, |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
815 |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
816 { // #6: TruePaint |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
817 { DO_COPY , DS_SCREEN_RAM , 0x0000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
818 { DO_SET_MEM , DS_BGCOL , 0x03e8, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
819 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
820 { DO_COPY , DS_BITMAP_RAM , 0x2400, 1, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
821 { DO_COPY , DS_SCREEN_RAM , 0x4400, 1, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
822 { DO_COPY , DS_COLOR_RAM , 0x4800, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
823 { DO_DEC_FUNC , 0 , 0x0000, 0, 0, fmtTruePaintGetLaceType, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
824 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
825 }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
826 }; |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
827 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
828 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
829 // |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
830 // 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
|
831 // |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
832 const DMC64ImageFormat dmC64ImageFormats[] = |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
833 { |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
834 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
835 D64_FMT_MC, "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
|
836 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
837 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
838 fmtProbeDrazPaint20Packed, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
839 fmtDecodeDrazPaintPacked, fmtEncodeDrazPaintPacked, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
840 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
841 NULL, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
842 { }, &dmC64CommonFormatOps[4] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
843 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
844 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
845 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
846 D64_FMT_MC, "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
|
847 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
848 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
849 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
850 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
851 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
852 NULL, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
853 { }, &dmC64CommonFormatOps[4] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
854 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
855 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
856 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
857 D64_FMT_MC | D64_FMT_ILACE, "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
|
858 C64_SCR_WIDTH , C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
859 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
860 fmtProbeDrazLace10Packed, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
861 fmtDecodeDrazPaintPacked, fmtEncodeDrazPaintPacked, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
862 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
863 NULL, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
864 { }, &dmC64CommonFormatOps[5] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
865 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
866 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
867 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
868 D64_FMT_MC | D64_FMT_ILACE, "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
|
869 C64_SCR_WIDTH , C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
870 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
871 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
872 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
873 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
874 NULL, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
875 { }, &dmC64CommonFormatOps[5] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
876 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
877 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
878 { |
1665
0022e1a428ca
Enable BDP5 encoding support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1663
diff
changeset
|
879 D64_FMT_MC, "bdp5", "Boogie Down Paint 5 (packed)", 0x5000, 0, DM_FMT_RDWR, |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
880 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
881 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
882 fmtProbeBDP5Packed, |
1665
0022e1a428ca
Enable BDP5 encoding support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1663
diff
changeset
|
883 fmtDecodeBDP5Packed, fmtEncodeBDP5Packed, |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
884 NULL, NULL, |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
885 NULL, |
1652
70fde5e03c2e
BDP5 memory format is same as Koala, so reuse that.
Matti Hamalainen <ccr@tnsp.org>
parents:
1651
diff
changeset
|
886 { }, &dmC64CommonFormatOps[0] // Memory format is same as Koala |
1651
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
887 }, |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
888 |
6dd191d04ea8
Implement support for Boogie Down Paint 5 (packed) format.
Matti Hamalainen <ccr@tnsp.org>
parents:
1650
diff
changeset
|
889 { |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
890 D64_FMT_MC, "vid", "Vidcom 64 (unpacked)", 0x5800, 10050, DM_FMT_RDWR, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
891 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
892 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
893 NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
894 NULL, NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
895 NULL, NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
896 NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
897 { |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
898 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
899 { DO_SET_MEM , DS_BGCOL , 0x07e8, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
900 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
901 { DO_COPY , DS_SCREEN_RAM , 0x0400, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
902 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
903 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
904 NULL |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
905 }, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
906 |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
907 { |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
908 D64_FMT_MC, "p64", "Picasso 64 (unpacked)", 0x1800, 10050, DM_FMT_RDWR, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
909 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
910 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
911 NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
912 NULL, NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
913 NULL, NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
914 NULL, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
915 { |
1669 | 916 { DO_COPY , DS_COLOR_RAM , 0x0000, 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
|
917 { DO_SET_MEM , DS_BGCOL , 0x07fe, 0, 0, NULL, NULL }, |
1669 | 918 { DO_COPY , DS_BITMAP_RAM , 0x0800, 0, 0, NULL, NULL }, |
919 { DO_COPY , DS_SCREEN_RAM , 0x0400, 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
|
920 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
921 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
922 NULL |
1574
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
923 }, |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
924 |
0b0870a216e9
Add support for "Picasso 64" and "Vidcom 64" multicolor formats.
Matti Hamalainen <ccr@tnsp.org>
parents:
1573
diff
changeset
|
925 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
926 D64_FMT_MC | D64_FMT_ILACE, "mci", "Truepaint (unpacked)", 0x9c00, 19434, DM_FMT_RD, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
927 C64_SCR_WIDTH , C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
928 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
929 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
930 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
931 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
932 fmtGetPixelTruePaint, |
1646
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
933 { }, &dmC64CommonFormatOps[6] |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
934 }, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
935 |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
936 { |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
937 D64_FMT_MC | D64_FMT_ILACE, "mcip", "Truepaint (packed)", 0x0801, 0, DM_FMT_RD, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
938 C64_SCR_WIDTH , C64_SCR_HEIGHT, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
939 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
940 fmtProbeTruePaintPacked, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
941 fmtDecodeTruePaintPacked, NULL, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
942 NULL, NULL, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
943 fmtGetPixelTruePaint, |
415c732dc14c
Implement support for packed TruePaint images.
Matti Hamalainen <ccr@tnsp.org>
parents:
1636
diff
changeset
|
944 { }, &dmC64CommonFormatOps[6] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
945 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
946 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
947 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
948 D64_FMT_MC, "kla", "Koala Paint (unpacked)", 0x6000, 10003, DM_FMT_RDWR, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
949 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
950 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
951 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
952 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
953 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
954 NULL, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
955 { }, &dmC64CommonFormatOps[0] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
956 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
957 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
958 { |
1578
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
959 D64_FMT_MC, "klp", "Koala Paint (packed)", 0x6000, 0, DM_FMT_RDWR, |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
960 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
961 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
1594
afb49736615a
Implement packed Koala Painter probing.
Matti Hamalainen <ccr@tnsp.org>
parents:
1593
diff
changeset
|
962 fmtProbeKoalaPaintPacked, |
1578
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
963 fmtDecodeKoalaPaintPacked, fmtEncodeKoalaPaintPacked, |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
964 NULL, NULL, |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
965 NULL, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
966 { }, &dmC64CommonFormatOps[0] |
1578
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
967 }, |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
968 |
fb60abb09a65
Add support for packed Koala Painter files, though without probing now.
Matti Hamalainen <ccr@tnsp.org>
parents:
1577
diff
changeset
|
969 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
970 D64_FMT_MC, "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
|
971 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
972 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
973 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
974 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
975 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
976 NULL, |
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 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
979 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
980 { DO_COPY , DS_COLOR_RAM , 0x2338, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
981 { DO_SET_MEM , DS_BGCOL , 0x2329, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
982 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1593
a77876a07425
Oops, missed this from the last commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1592
diff
changeset
|
983 }, |
a77876a07425
Oops, missed this from the last commit.
Matti Hamalainen <ccr@tnsp.org>
parents:
1592
diff
changeset
|
984 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
985 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
986 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
987 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
988 D64_FMT_MC, "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
|
989 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
990 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
991 fmtProbeAmicaPaintPacked, |
1538
af729e29a6f6
Implement Amica Paint packed format encoding.
Matti Hamalainen <ccr@tnsp.org>
parents:
1535
diff
changeset
|
992 fmtDecodeAmicaPaintPacked, fmtEncodeAmicaPaintPacked, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
993 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
994 NULL, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
995 { }, &dmC64CommonFormatOps[1] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
996 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
997 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
998 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
999 D64_FMT_MC, "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
|
1000 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1001 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1002 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1003 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1004 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1005 NULL, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1006 { }, &dmC64CommonFormatOps[1] |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1007 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1008 |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1009 { |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1010 D64_FMT_MC, "ipc", "Interpaint MC (unpacked)", 0x4000, 10003, DM_FMT_RDWR, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1011 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1012 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1013 NULL, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1014 NULL, NULL, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1015 NULL, NULL, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1016 NULL, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1017 { }, &dmC64CommonFormatOps[1] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1018 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1019 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1020 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1021 D64_FMT_HIRES, "art", "Art Studio (unpacked)", 0x2000, 9009, DM_FMT_RD, |
1635 | 1022 C64_SCR_WIDTH , C64_SCR_HEIGHT, |
1023 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, | |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1024 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1025 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1026 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1027 NULL, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1028 { }, &dmC64CommonFormatOps[2] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1029 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1030 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1031 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1032 D64_FMT_HIRES, "iph", "Interpaint (unpacked)", 0x4000, 9002, DM_FMT_RD, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1033 C64_SCR_WIDTH , C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1034 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1035 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1036 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1037 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1038 NULL, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1039 { }, &dmC64CommonFormatOps[2] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1040 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1041 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1042 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1043 D64_FMT_HIRES, "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
|
1044 C64_SCR_WIDTH , C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1045 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1046 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1047 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1048 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1049 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1050 { |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1051 { DO_COPY , DS_SCREEN_RAM , 0x0000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1052 { DO_COPY , DS_BITMAP_RAM , 0x0400, 0, 0, NULL, NULL }, |
1669 | 1053 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1054 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1055 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1056 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1057 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1058 { |
1670
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1059 D64_FMT_HIRES, "mon", "Monomagic (unpacked)", 0x2000, 8194, DM_FMT_RDWR, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1060 C64_SCR_WIDTH , C64_SCR_HEIGHT, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1061 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1062 NULL, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1063 NULL, NULL, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1064 NULL, NULL, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1065 NULL, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1066 { |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1067 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, NULL, NULL }, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1068 { DO_SET_OP , DS_SCREEN_RAM , 0xCF , 0, 0, NULL, NULL }, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1069 // Default colors used by MM are --^^ |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1070 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1071 }, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1072 NULL |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1073 }, |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1074 |
ab4a38ba919f
Implement hires Mono Magic support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1669
diff
changeset
|
1075 { |
1671
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1076 D64_FMT_HIRES, "hir", "Plain hires (unpacked)", 0x2000, 8002, DM_FMT_RDWR, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1077 C64_SCR_WIDTH , C64_SCR_HEIGHT, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1078 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1079 NULL, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1080 NULL, NULL, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1081 NULL, NULL, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1082 NULL, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1083 { |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1084 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, NULL, NULL }, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1085 { DO_SET_OP , DS_SCREEN_RAM , 0xF0 , 0, 0, NULL, NULL }, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1086 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1087 }, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1088 NULL |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1089 }, |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1090 |
dd9528cdd14a
Add support for a plain hires format at $2000.
Matti Hamalainen <ccr@tnsp.org>
parents:
1670
diff
changeset
|
1091 { |
1582
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1092 D64_FMT_MC | D64_FMT_FLI, "bfli", "Big FLI (unpacked) [BROKEN]", 0x3bff, 33795, DM_FMT_RD, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1093 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT * 2, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1094 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1095 NULL, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1096 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
|
1097 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
|
1098 fmtGetPixelBFLI, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1099 { |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1100 { DO_COPY , DS_COLOR_RAM , 0x0001, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1101 DEF_SCREEN_RAMS_8(0x0401, 0, 0x400), |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1102 { DO_COPY , DS_BITMAP_RAM , 0x2401, 0, 0x1fff, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1103 DEF_SCREEN_RAMS_8(0x4401, 8, 0x400), |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1104 { DO_COPY , DS_BITMAP_RAM , 0x6401, 1, 0, NULL, NULL }, |
1669 | 1105 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1106 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1107 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
|
1108 }, |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1109 |
1f6aed186c4e
Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
Matti Hamalainen <ccr@tnsp.org>
parents:
1581
diff
changeset
|
1110 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1111 D64_FMT_MC | D64_FMT_FLI, "bml", "Blackmail 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
|
1112 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1113 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1114 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1115 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1116 NULL, NULL, |
1581 | 1117 fmtGetPixelBlackMailFLI, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1118 { |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1119 { DO_COPY , DS_EXTRA_DATA , 0x0000, 0, 200, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1120 { DO_COPY , DS_COLOR_RAM , 0x0100, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1121 DEF_SCREEN_RAMS_8(0x0500, 0, 0x400), |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1122 { DO_COPY , DS_BITMAP_RAM , 0x2500, 0, 0, NULL, NULL }, |
1669 | 1123 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1124 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1125 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1126 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1127 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1128 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1129 D64_FMT_MC | D64_FMT_FLI, "fli", "FLI Designer (unpacked)", 0, 17409, DM_FMT_RD, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1130 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1131 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1132 fmtProbeFLIDesigner, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1133 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1134 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1135 fmtGetPixelFLIDesigner, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1136 { |
1669 | 1137 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, NULL, NULL }, |
1138 DEF_SCREEN_RAMS_8(0x0400, 0, 0x400), | |
1139 { DO_COPY , DS_BITMAP_RAM , 0x2400, 0, 0, NULL, NULL }, | |
1140 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, | |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1141 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1142 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1143 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1144 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1145 { |
1723
13fe4010623f
Allow writing of xx1 and xx2 formats, as useless that is.
Matti Hamalainen <ccr@tnsp.org>
parents:
1722
diff
changeset
|
1146 D64_FMT_MC, "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
|
1147 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1148 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1149 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1150 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1151 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1152 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1153 { |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1154 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1155 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1156 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1157 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, NULL, NULL }, |
1707
a0986cfd6f9d
More consistently use DMGrowBuf in the lib64gfx APIs, and implement
Matti Hamalainen <ccr@tnsp.org>
parents:
1697
diff
changeset
|
1158 { DO_SET_OP , DS_EXTRA_DATA , 10240 , 0, 0, NULL, NULL }, |
1669 | 1159 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1160 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1161 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1162 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1163 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1164 { |
1723
13fe4010623f
Allow writing of xx1 and xx2 formats, as useless that is.
Matti Hamalainen <ccr@tnsp.org>
parents:
1722
diff
changeset
|
1165 D64_FMT_MC, "xx2", "Unknown $2000 format (unpacked)", 0x2000, 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
|
1166 XX2_WIDTH_CH * 4, XX2_HEIGHT_CH * 8, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1167 XX2_WIDTH_CH , XX2_HEIGHT_CH, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1168 fmtProbeFormatXX2, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1169 fmtDecodeFormatXX2, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1170 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1171 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1172 { |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1173 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, XX2_BSIZE, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1174 { DO_COPY , DS_SCREEN_RAM , XX2_BSIZE, 0, XX2_SIZE, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1175 { DO_COPY , DS_COLOR_RAM , XX2_BSIZE + XX2_SIZE, 0, XX2_SIZE, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1176 { DO_SET_OP , DS_BGCOL , 11 , 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1177 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1178 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1179 NULL |
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 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1183 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, |
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1184 "fp2", "FunPaint II (unpacked)", 0x3ff0, 33694, DM_FMT_RD, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1185 C64_SCR_WIDTH, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1186 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1187 fmtProbeFunPaint2, |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1188 fmtDecodeFunPaint2, fmtEncodeFunPaint2Unpacked, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1189 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1190 fmtGetPixelFunPaint2, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1191 { }, &dmC64CommonFormatOps[3] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1192 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1193 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1194 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1195 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, |
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1196 "fp2p", "FunPaint II (packed)", 0x3ff0, 0, DM_FMT_RD, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1197 C64_SCR_WIDTH, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1198 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
1579
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1199 NULL, |
4288b21e97b9
Improve and simplify Fun Paint 2 format support.
Matti Hamalainen <ccr@tnsp.org>
parents:
1578
diff
changeset
|
1200 fmtDecodeFunPaint2, fmtEncodeFunPaint2Packed, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1201 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1202 fmtGetPixelFunPaint2, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1203 { }, &dmC64CommonFormatOps[3] |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1204 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1205 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1206 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1207 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, |
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1208 "gun", "GunPaint (unpacked)", 0x4000, 0, DM_FMT_RD, |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1209 C64_SCR_WIDTH, C64_SCR_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1210 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1211 fmtProbeGunPaint, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1212 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1213 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1214 fmtGetPixelGunPaint, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1215 { |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1216 DEF_SCREEN_RAMS_8(0x0000, 0, 0x400), |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1217 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1218 { DO_COPY , DS_EXTRA_DATA , 0x3f4f, 0, 177, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1219 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1220 DEF_SCREEN_RAMS_8(0x4400, 8, 0x400), |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1221 { DO_COPY , DS_BITMAP_RAM , 0x6400, 1, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1222 { DO_COPY , DS_EXTRA_DATA , 0x47e8, 1, 20, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1223 { DO_DEC_FUNC , 0 , 0x2742, 0, 1, fmtTruePaintGetLaceType, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1224 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1225 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1226 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1227 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1228 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1229 { |
1545
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1230 D64_FMT_HIRES | D64_FMT_FLI, |
3b613fcbf3ff
Improve how format read/write capabilities are marked and shown.
Matti Hamalainen <ccr@tnsp.org>
parents:
1542
diff
changeset
|
1231 "chi", "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
|
1232 C64_SCR_WIDTH, 14 * 8, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1233 C64_SCR_CH_WIDTH , 14, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1234 NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1235 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1236 NULL, NULL, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1237 fmtGetPixelCHFLI, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1238 { |
1668
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1239 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, NULL, NULL }, |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1240 DEF_SCREEN_RAMS_8(0x2000, 0, 0x400), |
1741717b1ae5
Big overhaul to the enc/dec operator system to be more flexible.
Matti Hamalainen <ccr@tnsp.org>
parents:
1665
diff
changeset
|
1241 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL }, |
1592
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1242 }, |
91d1bb571fca
Implement common encdec ops lists for sharing oplists between formats that
Matti Hamalainen <ccr@tnsp.org>
parents:
1590
diff
changeset
|
1243 NULL |
1503
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1244 }, |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1245 }; |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1246 |
c7b9ef56319b
Factor all the c64 file format specific things into lib64fmt.c
Matti Hamalainen <ccr@tnsp.org>
parents:
diff
changeset
|
1247 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
|
1248 |