comparison tools/lib64fmts.c @ 2603:8386c5e55a31

Implement support for EXON VHI Editor 0.1 unpacked format files (hires interlace 640x200).
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 19 Nov 2023 19:39:52 +0200
parents 8b99ddcc9fde
children 1c80099fe47e
comparison
equal deleted inserted replaced
2602:a4f6584edca9 2603:8386c5e55a31
2198 res = dmEncodeGenericRLE(buf, &tmp, &cfg); 2198 res = dmEncodeGenericRLE(buf, &tmp, &cfg);
2199 2199
2200 out: 2200 out:
2201 dmGrowBufFree(&tmp); 2201 dmGrowBufFree(&tmp);
2202 return res; 2202 return res;
2203 }
2204
2205
2206 static int fmtGetPixelEXON_VHI(DMC64ScanLine *scan,
2207 const DMC64Image *img, const int rasterX, const int rasterY)
2208 {
2209 const int
2210 x = rasterX / 16,
2211 y = rasterY / 8,
2212 yb = rasterY & 7,
2213 yoffs = y * img->fmt->chWidth,
2214 bmoffs = yoffs * 8 + yb + (x * 8),
2215 scroffs = yoffs + x,
2216 vshift = 7 - ((rasterX / 2) & 7),
2217 vbitmap = rasterX & 1;
2218
2219 return dmC64GetGenericSCPixel(scan->col, img, bmoffs, scroffs, vshift, 0, vbitmap);
2203 } 2220 }
2204 2221
2205 2222
2206 // 2223 //
2207 // Helper macros for defining screen memory layouts 2224 // Helper macros for defining screen memory layouts
2428 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0 , 0 , 0, NULL, NULL, DF_NORMAL }, 2445 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0 , 0 , 0, NULL, NULL, DF_NORMAL },
2429 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE }, 2446 { DO_SET_OP , DS_EXTRA_INFO , D64_FLI_8, 0, 0, D64_EI_FLI_TYPE, NULL, NULL, DF_DECODE },
2430 { DO_LAST , 0 , 0 , 0 , 0 , 0, NULL, NULL, DF_NORMAL }, 2447 { DO_LAST , 0 , 0 , 0 , 0 , 0, NULL, NULL, DF_NORMAL },
2431 } 2448 }
2432 }, 2449 },
2450
2451 { // #12: EXON VHI Editor 0.1
2452 D64_FMT_HIRES | D64_FMT_ILACE,
2453 D64_SCR_WIDTH * 2, D64_SCR_HEIGHT,
2454 D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT,
2455 1, 1,
2456 NULL, NULL,
2457 fmtGetPixelEXON_VHI,
2458 {
2459 { DO_COPY , DS_BITMAP_RAM , 0x2000 - 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL },
2460 { DO_COPY , DS_BITMAP_RAM , 0x4000 - 0x2000, 1, 0, 0, NULL, NULL, DF_NORMAL },
2461 { DO_COPY , DS_SCREEN_RAM , 0x6000 - 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL },
2462 { DO_SET_MEM_LO , DS_D020 , 0x63ea - 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL },
2463
2464 { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_RES , 0, 0, D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE },
2465 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL },
2466 }
2467 }
2433 }; 2468 };
2434 2469
2435 2470
2436 // 2471 //
2437 // Array with data for supported formats 2472 // Array with data for supported formats
3475 } 3510 }
3476 }, 3511 },
3477 NULL 3512 NULL
3478 }, 3513 },
3479 3514
3515 {
3516 "vhi", "EXON VHI Editor 0.1 (unpacked)", 0x2000, 17389, 0, DM_FMT_RD,
3517 NULL,
3518 NULL, NULL,
3519 { 0 }, &dmC64CommonFormats[12]
3520 },
3521
3480 }; 3522 };
3481 3523
3482 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]); 3524 const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);
3483 3525