Mercurial > hg > dmlib
comparison tools/lib64fmts.c @ 1876:a35f6e19f57a
Implement read-only support for HCB (Half Char Bitmap) format.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Sun, 24 Jun 2018 23:37:01 +0300 |
parents | 752893fa6412 |
children | f8b7baf3ff89 |
comparison
equal
deleted
inserted
replaced
1875:b052754a1a23 | 1876:a35f6e19f57a |
---|---|
861 Uint8 color1 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, 0, bitmap, 0); | 861 Uint8 color1 = dmC64GetGenericSCPixel(img, bmoffs, scroffs, shift, 0, bitmap, 0); |
862 Uint8 color2 = img->extraData[0].data[offs] & mask ? 0x0f : 0; | 862 Uint8 color2 = img->extraData[0].data[offs] & mask ? 0x0f : 0; |
863 Uint8 color3 = img->extraData[0].data[offs + C64_SPR_SIZE * 155] & mask ? img->d022 : 0; | 863 Uint8 color3 = img->extraData[0].data[offs + C64_SPR_SIZE * 155] & mask ? img->d022 : 0; |
864 | 864 |
865 return color3 ? color3 : ( color2 ? color2 : color1 ); | 865 return color3 ? color3 : ( color2 ? color2 : color1 ); |
866 } | |
867 | |
868 | |
869 static Uint8 fmtGetPixelHCB( | |
870 const DMC64Image *img, const int bmoffs, const int scroffs, | |
871 const int shift, const int bitmap, const int rasterX, const int rasterY) | |
872 { | |
873 const int vbank = (rasterY / 4) & 1; | |
874 (void) bitmap; | |
875 (void) rasterX; | |
876 | |
877 return dmC64GetGenericMCPixel(img, bmoffs, scroffs, shift, vbank, 0, vbank, img->bgcolor); | |
866 } | 878 } |
867 | 879 |
868 | 880 |
869 static Uint8 fmtGetPixelCrestHIFLIorCDHM( | 881 static Uint8 fmtGetPixelCrestHIFLIorCDHM( |
870 const DMC64Image *img, const int bmoffs, const int scroffs, | 882 const DMC64Image *img, const int bmoffs, const int scroffs, |
1694 }, | 1706 }, |
1695 NULL | 1707 NULL |
1696 }, | 1708 }, |
1697 | 1709 |
1698 { | 1710 { |
1711 "hcb", "Half Char Bitmap (unpacked)", 0x5000, 12148, DM_FMT_RD, | |
1712 NULL, | |
1713 NULL, NULL, | |
1714 { | |
1715 D64_FMT_MC | D64_FMT_FLI, | |
1716 C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, | |
1717 C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, | |
1718 NULL, NULL, | |
1719 fmtGetPixelHCB, | |
1720 { | |
1721 { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL }, | |
1722 { DO_COPY , DS_COLOR_RAM , 0x0400, 1, 0, 0, NULL, NULL }, | |
1723 { DO_COPY , DS_SCREEN_RAM , 0x0800, 0, 0, 0, NULL, NULL }, | |
1724 { DO_COPY , DS_SCREEN_RAM , 0x0c00, 1, 0, 0, NULL, NULL }, | |
1725 { DO_COPY , DS_BITMAP_RAM , 0x1000, 0, 0, 0, NULL, NULL }, | |
1726 { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, | |
1727 } | |
1728 }, | |
1729 NULL | |
1730 }, | |
1731 | |
1732 { | |
1699 "pen", "Pentel Paint (unpacked)", 0x4800, 19845, DM_FMT_RD | DM_FMT_BROKEN, | 1733 "pen", "Pentel Paint (unpacked)", 0x4800, 19845, DM_FMT_RD | DM_FMT_BROKEN, |
1700 NULL, | 1734 NULL, |
1701 NULL, NULL, | 1735 NULL, NULL, |
1702 { | 1736 { |
1703 D64_FMT_HIRES | D64_FMT_FLI, | 1737 D64_FMT_HIRES | D64_FMT_FLI, |