comparison tools/lib64fmts.c @ 2570:1559011d749f

Add preliminary support for "Unknown $1000 format (unpacked)" as "xx5". Unfinished and broken.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 02 Mar 2022 00:31:27 +0200
parents b76ac594cf33
children 21d296803fac
comparison
equal deleted inserted replaced
2569:b4d536379687 2570:1559011d749f
1405 DM_MEMCMP_SIZE(buf->data, fmtFormatXX4_MagicID_1) == 0 1405 DM_MEMCMP_SIZE(buf->data, fmtFormatXX4_MagicID_1) == 0
1406 ) 1406 )
1407 return DM_PROBE_SCORE_MAX; 1407 return DM_PROBE_SCORE_MAX;
1408 1408
1409 return DM_PROBE_SCORE_FALSE; 1409 return DM_PROBE_SCORE_FALSE;
1410 }
1411
1412
1413 static const Uint8 fmtFormatXX5_MagicID_1[] =
1414 {
1415 0x00, 0x10, 0xa9, 0x01, 0x8d, 0x86, 0x02, 0x20,
1416 0x44, 0xe5, 0xa9, 0x16, 0x8d, 0x18, 0xd0, 0xa2,
1417 };
1418
1419 static int fmtProbeFormatXX5(const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
1420 {
1421 if (buf->len >= fmt->size &&
1422 DM_MEMCMP_SIZE(buf->data, fmtFormatXX5_MagicID_1) == 0
1423 )
1424 return DM_PROBE_SCORE_MAX;
1425
1426 return DM_PROBE_SCORE_FALSE;
1427 }
1428
1429
1430 static int fmtGetPixelXX5(DMC64ScanLine *scan,
1431 const DMC64Image *img, const int rasterX, const int rasterY)
1432 {
1433 DM_C64_GENERIC_SC_PIXEL_DEFS(img)
1434
1435 (void) vshift;
1436
1437 return dmC64GetGenericMCPixel(scan->col, img,
1438 bmoffs, scroffs,
1439 6 - (rasterX & 6),
1440 (rasterY & 7),
1441 rasterX & 1, 0, img->bgcolor);
1410 } 1442 }
1411 1443
1412 1444
1413 #define XX2_MIN_SIZE 4000 1445 #define XX2_MIN_SIZE 4000
1414 #define XX2_WIDTH_CH 40 1446 #define XX2_WIDTH_CH 40
3316 fmtProbeSupeRes, 3348 fmtProbeSupeRes,
3317 fmtDecodeSupeRes, fmtEncodeSupeRes, 3349 fmtDecodeSupeRes, fmtEncodeSupeRes,
3318 { }, &dmC64CommonFormats[0] 3350 { }, &dmC64CommonFormats[0]
3319 }, 3351 },
3320 3352
3353 {
3354 "xx5", "Unknown $1000 format (unpacked)", 0x1000, 45000, 0, DM_FMT_RD | DM_FMT_BROKEN,
3355 fmtProbeFormatXX5,
3356 NULL, NULL,
3357 {
3358 D64_FMT_HIRES | D64_FMT_FLI | D64_FMT_ILACE,
3359 D64_SCR_WIDTH , D64_SCR_HEIGHT,
3360 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT,
3361 1, 1,
3362 NULL, NULL,
3363 fmtGetPixelXX5,
3364 {
3365 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x4000 - 0x1000, 0, 0x400, 0, DF_NORMAL),
3366 DEF_REPEAT_BLOCK_8(DO_COPY, DS_SCREEN_RAM , 0x8000 - 0x1000, 8, 0x400, 0, DF_NORMAL),
3367
3368 { DO_COPY , DS_BITMAP_RAM , 0x6000 - 0x1000, 0, 0, 0, NULL, NULL, DF_NORMAL },
3369 { DO_COPY , DS_BITMAP_RAM , 0xa400 - 0x1000, 1, 0, 0, NULL, NULL, DF_NORMAL },
3370
3371 { DO_COPY , DS_COLOR_RAM , 0x8000 - 0x1000, 0, 0, 0, NULL, NULL, DF_NORMAL },
3372
3373 // BG/FG always 0
3374 { DO_SET_MEM_LO , DS_BGCOL , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3375 { DO_SET_MEM_LO , DS_D020 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3376
3377 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_RES , 0, 0, D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE },
3378 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8 , 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE },
3379 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
3380 }
3381 },
3382 NULL
3383 },
3321 3384
3322 }; 3385 };
3323 3386
3324 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]); 3387 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);
3325 3388