comparison tools/lib64fmts.c @ 2620:2aa885371c13

Reorganize the format list a bit.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 29 Nov 2023 10:53:01 +0200
parents c9741a11d1cd
children da81e524162e
comparison
equal deleted inserted replaced
2619:e00a9e1f26c0 2620:2aa885371c13
8 */ 8 */
9 #include "lib64gfx.h" 9 #include "lib64gfx.h"
10 10
11 #define DM_MEMCMP_SIZE(mptr, mcmp) memcmp((mptr), (mcmp), sizeof(mcmp)) 11 #define DM_MEMCMP_SIZE(mptr, mcmp) memcmp((mptr), (mcmp), sizeof(mcmp))
12 #define DM_MEMCMP_LEN(mptr, mcmp) memcmp((mptr), (mcmp), strlen(mcmp)) 12 #define DM_MEMCMP_LEN(mptr, mcmp) memcmp((mptr), (mcmp), strlen(mcmp))
13
14
15 #define XX2_MIN_SIZE 4000
16 #define XX2_WIDTH_CH 40
17 #define XX2_HEIGHT_CH 10
18 #define XX2_SIZE (XX2_WIDTH_CH * XX2_HEIGHT_CH)
19 #define XX2_BSIZE (XX2_SIZE * 8)
20
21
22 static int fmtProbeFormatXX2(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
23 {
24 if (buf->len >= XX2_MIN_SIZE &&
25 buf->len <= XX2_MIN_SIZE + 8 &&
26 dmCompareAddr16(buf, 0, fmt->addr))
27 return DM_PROBE_SCORE_MAYBE;
28
29 return DM_PROBE_SCORE_FALSE;
30 }
31
32
33 static int fmtDecodeFormatXX2(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
34 {
35 int res;
36 DMGrowBuf tmp;
37
38 // If there is only data for less than XX2_MIN_SIZE bytes,
39 // allocate a buffer of that size and copy data there.
40 // Otherwise allocate len bytes.
41 if (dmGrowBufCopy(&tmp, buf, buf->len < XX2_MIN_SIZE ? XX2_MIN_SIZE - buf->len : 0) == NULL)
42 return DMERR_MALLOC;
43
44 tmp.len = tmp.size;
45 res = dmC64DecodeGenericBMP(img, &tmp, fmt);
46 dmGrowBufFree(&tmp);
47 return res;
48 }
49
50
51 static const Uint8 fmtFormatXX3_MagicID_1[] =
52 {
53 0x01, 0x08, 0x0B, 0x08, 0xF0, 0x02, 0x9E, 0x32,
54 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xA9, 0x14,
55 0x8D, 0x18, 0xD0, 0xA2, 0x00, 0xA9, 0x20, 0x9D,
56 0x00, 0x04, 0x9D, 0x00, 0x05, 0x9D, 0x00, 0x06,
57 };
58
59 static int fmtProbeFormatXX3(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
60 {
61 if (buf->len == fmt->size &&
62 DM_MEMCMP_SIZE(buf->data, fmtFormatXX3_MagicID_1) == 0
63 )
64 return DM_PROBE_SCORE_MAX;
65
66 return DM_PROBE_SCORE_FALSE;
67 }
68
69
70 static const Uint8 fmtFormatXX4_MagicID_1[] =
71 {
72 0x00, 0x1f, 0x78, 0xa9, 0x3b, 0x8d, 0x11, 0xd0,
73 0xa9, 0x18, 0x8d, 0x16, 0xd0, 0xa9, 0x18, 0x8d,
74 };
75
76 static int fmtProbeFormatXX4(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
77 {
78 if (buf->len >= fmt->size &&
79 DM_MEMCMP_SIZE(buf->data, fmtFormatXX4_MagicID_1) == 0
80 )
81 return DM_PROBE_SCORE_MAX;
82
83 return DM_PROBE_SCORE_FALSE;
84 }
85
86
87 static const Uint8 fmtFormatXX5_MagicID_1[] =
88 {
89 0x00, 0x10, 0xa9, 0x01, 0x8d, 0x86, 0x02, 0x20,
90 0x44, 0xe5, 0xa9, 0x16, 0x8d, 0x18, 0xd0, 0xa2,
91 };
92
93 static int fmtProbeFormatXX5(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
94 {
95 if (buf->len >= fmt->size &&
96 DM_MEMCMP_SIZE(buf->data, fmtFormatXX5_MagicID_1) == 0
97 )
98 return DM_PROBE_SCORE_MAX;
99
100 return DM_PROBE_SCORE_FALSE;
101 }
102
103
104 static int fmtGetPixelXX5(DMC64ScanLine *scan,
105 const DMC64Image *img, const int rasterX, const int rasterY)
106 {
107 DM_C64_GENERIC_SC_PIXEL_DEFS(img)
108
109 #if 1
110 (void) vshift;
111
112 return dmC64GetGenericMCPixel(scan->col, img,
113 bmoffs, scroffs,
114 6 - (rasterX & 6),
115 // (rasterY & 7) + (8 * (rasterX & 1)),
116 (rasterY & 7),
117 rasterX & 1, 0, img->bgcolor);
118 #else
119 const int vbank = rasterY & 7;
120 Uint8 color1, color2, bgcol = img->bgcolor;
121 int res;
122
123 if ((res = dmC64GetGenericMCPixel(&color1, img, bmoffs, scroffs, vshift, vbank , rasterX & 1, 0, bgcol)) != DMERR_OK ||
124 (res = dmC64GetGenericMCPixel(&color2, img, bmoffs, scroffs, vshift, vbank + 8, rasterX & 1, 0, bgcol)) != DMERR_OK)
125 return res;
126
127 *(scan->col) = (color1 * D64_NCOLORS) + color2;
128
129 return res;
130 #endif
131 }
132
133
134 static const Uint8 fmtFormatXX6_MagicID_1[] =
135 {
136 0x01, 0x08, 0x0b, 0x08, 0xd5, 0x07, 0x9e, 0x34,
137 0x30, 0x39, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00,
138 };
139
140 static const Uint8 fmtFormatXX6_MagicID_2[] =
141 {
142 0x00, 0xAD, 0x10, 0x47, 0x8D, 0x21, 0xD0, 0xA9,
143 0x00, 0x8D, 0x20, 0xD0, 0xA2, 0x00, 0xBD, 0x40,
144 };
145
146 static int fmtProbeFormatXX6(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
147 {
148 if (buf->len == fmt->size &&
149 DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX6_MagicID_1) == 0 &&
150 DM_MEMCMP_SIZE(buf->data + 0x0800, fmtFormatXX6_MagicID_2) == 0
151 )
152 return DM_PROBE_SCORE_MAX;
153
154 return DM_PROBE_SCORE_FALSE;
155 }
156
157
158 static const Uint8 fmtFormatXX7_MagicID_1[] =
159 {
160 0x01, 0x08, 0x0b, 0x08, 0xe0, 0x02, 0x9e, 0x32,
161 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xa2, 0x19,
162 };
163
164 static const Uint8 fmtFormatXX7_MagicID_2[] =
165 {
166 0xa2, 0x60, 0xa9, 0x00, 0x20, 0x10, 0x0a, 0xa9,
167 0x26, 0xa2, 0x0a, 0x20, 0x10, 0x0a, 0xa2, 0x1f,
168 };
169
170 static int fmtProbeFormatXX7(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
171 {
172 if (buf->len == fmt->size &&
173 DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX7_MagicID_1) == 0 &&
174 DM_MEMCMP_SIZE(buf->data + 0x0100, fmtFormatXX7_MagicID_2) == 0
175 )
176 return DM_PROBE_SCORE_MAX;
177
178 return DM_PROBE_SCORE_FALSE;
179 }
13 180
14 181
15 // Basic probe, but return MAX score for this format 182 // Basic probe, but return MAX score for this format
16 static int fmtProbeGigapaintHires(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) 183 static int fmtProbeGigapaintHires(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
17 { 184 {
1371 1538
1372 // Flinterlazer stores color RAMs as speedcode, so we need to 1539 // Flinterlazer stores color RAMs as speedcode, so we need to
1373 // decode some 6510 instructions to get the data. 1540 // decode some 6510 instructions to get the data.
1374 return fmtDecode6502SpeedCode( 1541 return fmtDecode6502SpeedCode(
1375 dmGrowBufConstCopyOffsSize(&tmp, buf, 0, 0x17b2), img, 0); 1542 dmGrowBufConstCopyOffsSize(&tmp, buf, 0, 0x17b2), img, 0);
1376 }
1377
1378
1379 #define XX2_MIN_SIZE 4000
1380 #define XX2_WIDTH_CH 40
1381 #define XX2_HEIGHT_CH 10
1382 #define XX2_SIZE (XX2_WIDTH_CH * XX2_HEIGHT_CH)
1383 #define XX2_BSIZE (XX2_SIZE * 8)
1384
1385
1386 static int fmtProbeFormatXX2(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
1387 {
1388 if (buf->len >= XX2_MIN_SIZE &&
1389 buf->len <= XX2_MIN_SIZE + 8 &&
1390 dmCompareAddr16(buf, 0, fmt->addr))
1391 return DM_PROBE_SCORE_MAYBE;
1392
1393 return DM_PROBE_SCORE_FALSE;
1394 }
1395
1396
1397 static int fmtDecodeFormatXX2(DMC64Image *img, const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
1398 {
1399 int res;
1400 DMGrowBuf tmp;
1401
1402 // If there is only data for less than XX2_MIN_SIZE bytes,
1403 // allocate a buffer of that size and copy data there.
1404 // Otherwise allocate len bytes.
1405 if (dmGrowBufCopy(&tmp, buf, buf->len < XX2_MIN_SIZE ? XX2_MIN_SIZE - buf->len : 0) == NULL)
1406 return DMERR_MALLOC;
1407
1408 tmp.len = tmp.size;
1409 res = dmC64DecodeGenericBMP(img, &tmp, fmt);
1410 dmGrowBufFree(&tmp);
1411 return res;
1412 }
1413
1414
1415 static const Uint8 fmtFormatXX3_MagicID_1[] =
1416 {
1417 0x01, 0x08, 0x0B, 0x08, 0xF0, 0x02, 0x9E, 0x32,
1418 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xA9, 0x14,
1419 0x8D, 0x18, 0xD0, 0xA2, 0x00, 0xA9, 0x20, 0x9D,
1420 0x00, 0x04, 0x9D, 0x00, 0x05, 0x9D, 0x00, 0x06,
1421 };
1422
1423 static int fmtProbeFormatXX3(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
1424 {
1425 if (buf->len == fmt->size &&
1426 DM_MEMCMP_SIZE(buf->data, fmtFormatXX3_MagicID_1) == 0
1427 )
1428 return DM_PROBE_SCORE_MAX;
1429
1430 return DM_PROBE_SCORE_FALSE;
1431 }
1432
1433
1434 static const Uint8 fmtFormatXX4_MagicID_1[] =
1435 {
1436 0x00, 0x1f, 0x78, 0xa9, 0x3b, 0x8d, 0x11, 0xd0,
1437 0xa9, 0x18, 0x8d, 0x16, 0xd0, 0xa9, 0x18, 0x8d,
1438 };
1439
1440 static int fmtProbeFormatXX4(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
1441 {
1442 if (buf->len >= fmt->size &&
1443 DM_MEMCMP_SIZE(buf->data, fmtFormatXX4_MagicID_1) == 0
1444 )
1445 return DM_PROBE_SCORE_MAX;
1446
1447 return DM_PROBE_SCORE_FALSE;
1448 }
1449
1450
1451 static const Uint8 fmtFormatXX5_MagicID_1[] =
1452 {
1453 0x00, 0x10, 0xa9, 0x01, 0x8d, 0x86, 0x02, 0x20,
1454 0x44, 0xe5, 0xa9, 0x16, 0x8d, 0x18, 0xd0, 0xa2,
1455 };
1456
1457 static int fmtProbeFormatXX5(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
1458 {
1459 if (buf->len >= fmt->size &&
1460 DM_MEMCMP_SIZE(buf->data, fmtFormatXX5_MagicID_1) == 0
1461 )
1462 return DM_PROBE_SCORE_MAX;
1463
1464 return DM_PROBE_SCORE_FALSE;
1465 }
1466
1467
1468 static int fmtGetPixelXX5(DMC64ScanLine *scan,
1469 const DMC64Image *img, const int rasterX, const int rasterY)
1470 {
1471 DM_C64_GENERIC_SC_PIXEL_DEFS(img)
1472
1473 (void) vshift;
1474
1475 return dmC64GetGenericMCPixel(scan->col, img,
1476 bmoffs, scroffs,
1477 6 - (rasterX & 6),
1478 (rasterY & 7),
1479 rasterX & 1, 0, img->bgcolor);
1480 }
1481
1482
1483 static const Uint8 fmtFormatXX6_MagicID_1[] =
1484 {
1485 0x01, 0x08, 0x0b, 0x08, 0xd5, 0x07, 0x9e, 0x34,
1486 0x30, 0x39, 0x36, 0x00, 0x00, 0x00, 0x00, 0x00,
1487 };
1488
1489 static const Uint8 fmtFormatXX6_MagicID_2[] =
1490 {
1491 0x00, 0xAD, 0x10, 0x47, 0x8D, 0x21, 0xD0, 0xA9,
1492 0x00, 0x8D, 0x20, 0xD0, 0xA2, 0x00, 0xBD, 0x40,
1493 };
1494
1495 static int fmtProbeFormatXX6(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
1496 {
1497 if (buf->len == fmt->size &&
1498 DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX6_MagicID_1) == 0 &&
1499 DM_MEMCMP_SIZE(buf->data + 0x0800, fmtFormatXX6_MagicID_2) == 0
1500 )
1501 return DM_PROBE_SCORE_MAX;
1502
1503 return DM_PROBE_SCORE_FALSE;
1504 }
1505
1506
1507 static const Uint8 fmtFormatXX7_MagicID_1[] =
1508 {
1509 0x01, 0x08, 0x0b, 0x08, 0xe0, 0x02, 0x9e, 0x32,
1510 0x30, 0x36, 0x31, 0x00, 0x00, 0x00, 0xa2, 0x19,
1511 };
1512
1513 static const Uint8 fmtFormatXX7_MagicID_2[] =
1514 {
1515 0xa2, 0x60, 0xa9, 0x00, 0x20, 0x10, 0x0a, 0xa9,
1516 0x26, 0xa2, 0x0a, 0x20, 0x10, 0x0a, 0xa2, 0x1f,
1517 };
1518
1519 static int fmtProbeFormatXX7(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
1520 {
1521 if (buf->len == fmt->size &&
1522 DM_MEMCMP_SIZE(buf->data + 0x0000, fmtFormatXX7_MagicID_1) == 0 &&
1523 DM_MEMCMP_SIZE(buf->data + 0x0100, fmtFormatXX7_MagicID_2) == 0
1524 )
1525 return DM_PROBE_SCORE_MAX;
1526
1527 return DM_PROBE_SCORE_FALSE;
1528 } 1543 }
1529 1544
1530 1545
1531 static int fmtProbeCosmosDesignsHiresManager(const DMGrowBuf *buf, const DMC64ImageFormat *fmt) 1546 static int fmtProbeCosmosDesignsHiresManager(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
1532 { 1547 {
3178 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL, DF_NORMAL }, 3193 { DO_COPY , DS_SCREEN_RAM , 0x1f40, 0, 0, 0, NULL, NULL, DF_NORMAL },
3179 { DO_COPY , DS_COLOR_RAM , 0x2328, 0, 0, 0, NULL, NULL, DF_NORMAL }, 3194 { DO_COPY , DS_COLOR_RAM , 0x2328, 0, 0, 0, NULL, NULL, DF_NORMAL },
3180 { DO_SET_MEM_LO , DS_BGCOL , 0x2710, 0, 0, 0, NULL, NULL, DF_NORMAL }, 3195 { DO_SET_MEM_LO , DS_BGCOL , 0x2710, 0, 0, 0, NULL, NULL, DF_NORMAL },
3181 { DO_SET_MEM_LO , DS_D020 , 0x2711, 0, 0, 0, NULL, NULL, DF_NORMAL }, 3196 { DO_SET_MEM_LO , DS_D020 , 0x2711, 0, 0, 0, NULL, NULL, DF_NORMAL },
3182 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, 3197 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3183 }
3184 },
3185 NULL
3186 },
3187
3188 {
3189 "xx1", "Unknown $2000 format (unpacked)", 0x2000, 10242, 0, DM_FMT_RDWR,
3190 NULL,
3191 NULL, NULL,
3192 {
3193 D64_FMT_MC,
3194 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT,
3195 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT,
3196 2, 1,
3197 NULL, NULL,
3198 NULL,
3199 {
3200 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL },
3201 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL },
3202 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL },
3203 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3204 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3205 }
3206 },
3207 NULL
3208 },
3209
3210 {
3211 "xx2", "Unknown $2000 format (unpacked)", 0x2000, 0, 0, DM_FMT_RDWR,
3212 fmtProbeFormatXX2,
3213 fmtDecodeFormatXX2, NULL,
3214 {
3215 D64_FMT_MC,
3216 XX2_WIDTH_CH * 4, XX2_HEIGHT_CH * 8,
3217 XX2_WIDTH_CH , XX2_HEIGHT_CH,
3218 2, 1,
3219 NULL, NULL,
3220 NULL,
3221 {
3222 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, XX2_BSIZE, 0, NULL, NULL, DF_NORMAL },
3223 { DO_COPY , DS_SCREEN_RAM , XX2_BSIZE, 0, XX2_SIZE, 0, NULL, NULL, DF_NORMAL },
3224 { DO_COPY , DS_COLOR_RAM , XX2_BSIZE + XX2_SIZE, 0, XX2_SIZE, 0, NULL, NULL, DF_NORMAL },
3225 { DO_SET_OP , DS_BGCOL , 11 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3226 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3227 }
3228 },
3229 NULL
3230 },
3231
3232 {
3233 "xx3", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 10500, 0, DM_FMT_RD,
3234 fmtProbeFormatXX3,
3235 NULL, NULL,
3236 {
3237 D64_FMT_MC,
3238 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT,
3239 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT,
3240 2, 1,
3241 NULL, NULL,
3242 NULL,
3243 {
3244 { DO_COPY , DS_BITMAP_RAM , 0x09f2 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3245 { DO_COPY , DS_SCREEN_RAM , 0x2932 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3246 { DO_SET_MEM_LO , DS_D020 , 0x09e6 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3247 { DO_SET_MEM_LO , DS_BGCOL , 0x09e7 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3248 { DO_COPY , DS_COLOR_RAM , 0x2d1a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3249 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3250 },
3251 },
3252 NULL
3253 },
3254
3255 {
3256 "xx4", "Unknown $1f00 format (unpacked)", 0x1f00, 10260, 0, DM_FMT_RD,
3257 fmtProbeFormatXX4,
3258 NULL, NULL,
3259 {
3260 D64_FMT_MC,
3261 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT,
3262 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT,
3263 2, 1,
3264 NULL, NULL,
3265 NULL,
3266 {
3267 { DO_COPY , DS_BITMAP_RAM , 0x2000 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL },
3268 { DO_COPY , DS_SCREEN_RAM , 0x3f40 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL },
3269 { DO_COPY , DS_COLOR_RAM , 0x4328 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL },
3270 { DO_SET_OP , DS_BGCOL , 0x4710 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL },
3271 { DO_SET_OP , DS_D020 , 0x4711 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL },
3272 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3273 }
3274 },
3275 NULL
3276 },
3277
3278 {
3279 "xx6", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 16148, 0, DM_FMT_RD,
3280 fmtProbeFormatXX6,
3281 NULL, NULL,
3282 {
3283 D64_FMT_MC,
3284 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT,
3285 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT,
3286 2, 1,
3287 NULL, NULL,
3288 NULL,
3289 {
3290 { DO_COPY , DS_BITMAP_RAM , 0x2000 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3291 { DO_COPY , DS_SCREEN_RAM , 0x3f40 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3292 { DO_COPY , DS_COLOR_RAM , 0x4328 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3293 { DO_SET_OP , DS_D020 , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3294 { DO_SET_MEM_LO , DS_BGCOL , 0x4710 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3295 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3296 },
3297 },
3298 NULL
3299 },
3300
3301 {
3302 "xx7", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 9590, 0, DM_FMT_RD,
3303 fmtProbeFormatXX7,
3304 NULL, NULL,
3305 {
3306 D64_FMT_HIRES,
3307 D64_SCR_WIDTH , D64_SCR_HEIGHT,
3308 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT,
3309 1, 1,
3310 NULL, NULL,
3311 NULL,
3312 {
3313 { DO_COPY , DS_BITMAP_RAM , 0x0a26 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3314 { DO_COPY , DS_SCREEN_RAM , 0x2968 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3315 { DO_SET_MEM_LO , DS_D020 , 0x2966 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3316 { DO_SET_MEM_LO , DS_BGCOL , 0x2967 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3317 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3318 } 3198 }
3319 }, 3199 },
3320 NULL 3200 NULL
3321 }, 3201 },
3322 3202
3618 fmtDecodeSupeRes, fmtEncodeSupeRes, 3498 fmtDecodeSupeRes, fmtEncodeSupeRes,
3619 { 0 }, &dmC64CommonFormats[0] 3499 { 0 }, &dmC64CommonFormats[0]
3620 }, 3500 },
3621 3501
3622 { 3502 {
3503 "vhi", "EXON VHI Editor 0.1 (unpacked)", 0x2000, 17389, 0, DM_FMT_RDWR,
3504 NULL,
3505 NULL, NULL,
3506 { 0 }, &dmC64CommonFormats[12]
3507 },
3508
3509 {
3510 "vhip", "EXON VHI Editor 0.1 (packed)", 0x2000, 17389, 0, DM_FMT_RD,
3511 fmtProbeEXON_VHI_Packed,
3512 fmtDecodeEXON_VHI_Packed, NULL,
3513 { 0 }, &dmC64CommonFormats[12]
3514 },
3515
3516 {
3517 "xx1", "Unknown $2000 format (unpacked)", 0x2000, 10242, 0, DM_FMT_RDWR,
3518 NULL,
3519 NULL, NULL,
3520 {
3521 D64_FMT_MC,
3522 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT,
3523 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT,
3524 2, 1,
3525 NULL, NULL,
3526 NULL,
3527 {
3528 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, 0, NULL, NULL, DF_NORMAL },
3529 { DO_COPY , DS_SCREEN_RAM , 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL },
3530 { DO_COPY , DS_COLOR_RAM , 0x2400, 0, 0, 0, NULL, NULL, DF_NORMAL },
3531 { DO_SET_OP , DS_BGCOL , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3532 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3533 }
3534 },
3535 NULL
3536 },
3537
3538 {
3539 "xx2", "Unknown $2000 format (unpacked)", 0x2000, 0, 0, DM_FMT_RDWR,
3540 fmtProbeFormatXX2,
3541 fmtDecodeFormatXX2, NULL,
3542 {
3543 D64_FMT_MC,
3544 XX2_WIDTH_CH * 4, XX2_HEIGHT_CH * 8,
3545 XX2_WIDTH_CH , XX2_HEIGHT_CH,
3546 2, 1,
3547 NULL, NULL,
3548 NULL,
3549 {
3550 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, XX2_BSIZE, 0, NULL, NULL, DF_NORMAL },
3551 { DO_COPY , DS_SCREEN_RAM , XX2_BSIZE, 0, XX2_SIZE, 0, NULL, NULL, DF_NORMAL },
3552 { DO_COPY , DS_COLOR_RAM , XX2_BSIZE + XX2_SIZE, 0, XX2_SIZE, 0, NULL, NULL, DF_NORMAL },
3553 { DO_SET_OP , DS_BGCOL , 11 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3554 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3555 }
3556 },
3557 NULL
3558 },
3559
3560 {
3561 "xx3", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 10500, 0, DM_FMT_RD,
3562 fmtProbeFormatXX3,
3563 NULL, NULL,
3564 {
3565 D64_FMT_MC,
3566 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT,
3567 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT,
3568 2, 1,
3569 NULL, NULL,
3570 NULL,
3571 {
3572 { DO_COPY , DS_BITMAP_RAM , 0x09f2 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3573 { DO_COPY , DS_SCREEN_RAM , 0x2932 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3574 { DO_SET_MEM_LO , DS_D020 , 0x09e6 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3575 { DO_SET_MEM_LO , DS_BGCOL , 0x09e7 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3576 { DO_COPY , DS_COLOR_RAM , 0x2d1a - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3577 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3578 },
3579 },
3580 NULL
3581 },
3582
3583 {
3584 "xx4", "Unknown $1f00 format (unpacked)", 0x1f00, 10260, 0, DM_FMT_RD,
3585 fmtProbeFormatXX4,
3586 NULL, NULL,
3587 {
3588 D64_FMT_MC,
3589 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT,
3590 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT,
3591 2, 1,
3592 NULL, NULL,
3593 NULL,
3594 {
3595 { DO_COPY , DS_BITMAP_RAM , 0x2000 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL },
3596 { DO_COPY , DS_SCREEN_RAM , 0x3f40 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL },
3597 { DO_COPY , DS_COLOR_RAM , 0x4328 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL },
3598 { DO_SET_OP , DS_BGCOL , 0x4710 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL },
3599 { DO_SET_OP , DS_D020 , 0x4711 - 0x1f00, 0, 0, 0, NULL, NULL, DF_NORMAL },
3600 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3601 }
3602 },
3603 NULL
3604 },
3605
3606 {
3623 "xx5", "Unknown $1000 format (unpacked)", 0x1000, 45000, 0, DM_FMT_RD | DM_FMT_BROKEN, 3607 "xx5", "Unknown $1000 format (unpacked)", 0x1000, 45000, 0, DM_FMT_RD | DM_FMT_BROKEN,
3624 fmtProbeFormatXX5, 3608 fmtProbeFormatXX5,
3625 NULL, NULL, 3609 NULL, NULL,
3626 { 3610 {
3627 D64_FMT_HIRES | D64_FMT_FLI | D64_FMT_ILACE, 3611 D64_FMT_HIRES | D64_FMT_FLI | D64_FMT_ILACE,
3650 }, 3634 },
3651 NULL 3635 NULL
3652 }, 3636 },
3653 3637
3654 { 3638 {
3655 "vhi", "EXON VHI Editor 0.1 (unpacked)", 0x2000, 17389, 0, DM_FMT_RDWR, 3639 "xx6", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 16148, 0, DM_FMT_RD,
3656 NULL, 3640 fmtProbeFormatXX6,
3657 NULL, NULL, 3641 NULL, NULL,
3658 { 0 }, &dmC64CommonFormats[12] 3642 {
3659 }, 3643 D64_FMT_MC,
3660 3644 D64_SCR_WIDTH / 2, D64_SCR_HEIGHT,
3661 { 3645 D64_SCR_CH_WIDTH , D64_SCR_CH_HEIGHT,
3662 "vhip", "EXON VHI Editor 0.1 (packed)", 0x2000, 17389, 0, DM_FMT_RD, 3646 2, 1,
3663 fmtProbeEXON_VHI_Packed, 3647 NULL, NULL,
3664 fmtDecodeEXON_VHI_Packed, NULL, 3648 NULL,
3665 { 0 }, &dmC64CommonFormats[12] 3649 {
3650 { DO_COPY , DS_BITMAP_RAM , 0x2000 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3651 { DO_COPY , DS_SCREEN_RAM , 0x3f40 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3652 { DO_COPY , DS_COLOR_RAM , 0x4328 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3653 { DO_SET_OP , DS_D020 , 0x00 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3654 { DO_SET_MEM_LO , DS_BGCOL , 0x4710 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3655 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3656 },
3657 },
3658 NULL
3659 },
3660
3661 {
3662 "xx7", "Unknown $0801 format (viewer) (unpacked)", 0x0801, 9590, 0, DM_FMT_RD,
3663 fmtProbeFormatXX7,
3664 NULL, NULL,
3665 {
3666 D64_FMT_HIRES,
3667 D64_SCR_WIDTH , D64_SCR_HEIGHT,
3668 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT,
3669 1, 1,
3670 NULL, NULL,
3671 NULL,
3672 {
3673 { DO_COPY , DS_BITMAP_RAM , 0x0a26 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3674 { DO_COPY , DS_SCREEN_RAM , 0x2968 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3675 { DO_SET_MEM_LO , DS_D020 , 0x2966 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3676 { DO_SET_MEM_LO , DS_BGCOL , 0x2967 - 0x0801, 0, 0, 0, NULL, NULL, DF_NORMAL },
3677 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3678 }
3679 },
3680 NULL
3666 }, 3681 },
3667 3682
3668 }; 3683 };
3669 3684
3670 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]); 3685 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);