comparison tools/lib64fmts.c @ 1734:183d503b17a7

Implement support for hires FLI interlaced "ECI Graphic Editor 1.0 (unpacked)" format.
author Matti Hamalainen <ccr@tnsp.org>
date Fri, 08 Jun 2018 22:14:13 +0300
parents 474055f25ab0
children 83f50e431206
comparison
equal deleted inserted replaced
1733:59c2b08a80a6 1734:183d503b17a7
731 731
732 if ((img->bitmap[bitmap].data[bmoffs] >> shift) & 1) 732 if ((img->bitmap[bitmap].data[bmoffs] >> shift) & 1)
733 return img->screen[vbank].data[scroffs] >> 4; 733 return img->screen[vbank].data[scroffs] >> 4;
734 else 734 else
735 return img->screen[vbank].data[scroffs] & 15; 735 return img->screen[vbank].data[scroffs] & 15;
736 }
737
738
739 static BOOL fmtECIGetLaceType(DMC64Image *img, const DMC64EncDecOp *op,
740 const DMGrowBuf *buf, const DMC64ImageFormat *fmt)
741 {
742 (void) op;
743 (void) buf;
744 (void) fmt;
745 img->laceType = D64_ILACE_COLOR;
746 return TRUE;
747 }
748
749
750 static Uint8 fmtGetPixelECI(
751 const DMC64Image *img, const int bmoffs, const int scroffs,
752 const int shift, const int bitmap, const int raster)
753 {
754 const int vbank = raster & 7;
755 Uint8
756 c1 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, vbank , 0, 0),
757 c2 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, vbank + 8, 1, 0);
758
759 (void) bitmap;
760 return (c1 * C64_NCOLORS) + c2;
761 }
762
763
764 static int fmtECIConvertBMP2Image(DMImage *dst, const DMC64Image *src, const DMC64ImageFormat *fmt)
765 {
766 if (!dmSetMixedColorC64Palette(dst))
767 return DMERR_MALLOC;
768
769 return dmC64ConvertGenericBMP2Image(dst, src, fmt);
736 } 770 }
737 771
738 772
739 // 773 //
740 // Helper macros for defining screen ram layouts 774 // Helper macros for defining screen ram layouts
1141 }, 1175 },
1142 NULL 1176 NULL
1143 }, 1177 },
1144 1178
1145 { 1179 {
1180 D64_FMT_HIRES | D64_FMT_FLI,
1181 "eci", "ECI Graphic Editor 1.0 (unpacked)", 0x4000, 32770, DM_FMT_RD,
1182 C64_SCR_WIDTH, C64_SCR_HEIGHT,
1183 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT,
1184 NULL,
1185 NULL, NULL,
1186 fmtECIConvertBMP2Image, NULL,
1187 fmtGetPixelECI,
1188 {
1189 { DO_COPY , DS_BITMAP_RAM , 0x0000, 0, 0, NULL, NULL },
1190 DEF_SCREEN_RAMS_8(0x2000, 0, 0x400),
1191 { DO_COPY , DS_BITMAP_RAM , 0x4000, 1, 0, NULL, NULL },
1192 DEF_SCREEN_RAMS_8(0x6000, 8, 0x400),
1193 { DO_DEC_FUNC , 0 , 0 , 0, 0, fmtECIGetLaceType, NULL },
1194 { DO_LAST , 0 , 0 , 0, 0, NULL, NULL },
1195 },
1196 NULL
1197 },
1198
1199 {
1146 D64_FMT_MC, "xx1", "Unknown $2000 format (unpacked)", 0x2000, 10242, DM_FMT_RDWR, 1200 D64_FMT_MC, "xx1", "Unknown $2000 format (unpacked)", 0x2000, 10242, DM_FMT_RDWR,
1147 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, 1201 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
1148 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, 1202 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
1149 NULL, 1203 NULL,
1150 NULL, NULL, 1204 NULL, NULL,