# HG changeset patch # User Matti Hamalainen # Date 1700415592 -7200 # Node ID 8386c5e55a313b5a2cb2efcc2858a351ab943581 # Parent a4f6584edca9d7487b1cc5ec2c00b4650bdad3d8 Implement support for EXON VHI Editor 0.1 unpacked format files (hires interlace 640x200). diff -r a4f6584edca9 -r 8386c5e55a31 tools/lib64fmts.c --- a/tools/lib64fmts.c Sun Nov 19 20:02:03 2023 +0200 +++ b/tools/lib64fmts.c Sun Nov 19 19:39:52 2023 +0200 @@ -2203,6 +2203,23 @@ } +static int fmtGetPixelEXON_VHI(DMC64ScanLine *scan, + const DMC64Image *img, const int rasterX, const int rasterY) +{ + const int + x = rasterX / 16, + y = rasterY / 8, + yb = rasterY & 7, + yoffs = y * img->fmt->chWidth, + bmoffs = yoffs * 8 + yb + (x * 8), + scroffs = yoffs + x, + vshift = 7 - ((rasterX / 2) & 7), + vbitmap = rasterX & 1; + + return dmC64GetGenericSCPixel(scan->col, img, bmoffs, scroffs, vshift, 0, vbitmap); +} + + // // Helper macros for defining screen memory layouts // common for several FLI type image formats @@ -2430,6 +2447,24 @@ { DO_LAST , 0 , 0 , 0 , 0 , 0, NULL, NULL, DF_NORMAL }, } }, + + { // #12: EXON VHI Editor 0.1 + D64_FMT_HIRES | D64_FMT_ILACE, + D64_SCR_WIDTH * 2, D64_SCR_HEIGHT, + D64_SCR_CH_WIDTH, D64_SCR_CH_HEIGHT, + 1, 1, + NULL, NULL, + fmtGetPixelEXON_VHI, + { + { DO_COPY , DS_BITMAP_RAM , 0x2000 - 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_COPY , DS_BITMAP_RAM , 0x4000 - 0x2000, 1, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_COPY , DS_SCREEN_RAM , 0x6000 - 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, + { DO_SET_MEM_LO , DS_D020 , 0x63ea - 0x2000, 0, 0, 0, NULL, NULL, DF_NORMAL }, + + { DO_SET_OP , DS_EXTRA_INFO , D64_ILACE_RES , 0, 0, D64_EI_ILACE_TYPE, NULL, NULL, DF_DECODE }, + { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL, DF_NORMAL }, + } + } }; @@ -3477,6 +3512,13 @@ NULL }, + { + "vhi", "EXON VHI Editor 0.1 (unpacked)", 0x2000, 17389, 0, DM_FMT_RD, + NULL, + NULL, NULL, + { 0 }, &dmC64CommonFormats[12] + }, + }; const int ndmC64ImageFormats = sizeof(dmC64ImageFormats) / sizeof(dmC64ImageFormats[0]);