Mercurial > hg > dmlib
comparison tools/lib64fmts.c @ 1847:e3d1f16be4ee
Using the newly introduced data block offset feature, unify the handling of
Fun Paint 2 and GunPaint formats somewhat.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Fri, 22 Jun 2018 22:38:51 +0300 |
parents | 88cef7758303 |
children | 273e274f9ed6 |
comparison
equal
deleted
inserted
replaced
1846:88cef7758303 | 1847:e3d1f16be4ee |
---|---|
821 static Uint8 fmtGetPixelFunPaint2( | 821 static Uint8 fmtGetPixelFunPaint2( |
822 const DMC64Image *img, const int bmoffs, const int scroffs, | 822 const DMC64Image *img, const int bmoffs, const int scroffs, |
823 const int shift, const int bitmap, const int rasterX, const int rasterY) | 823 const int shift, const int bitmap, const int rasterX, const int rasterY) |
824 { | 824 { |
825 const int vbank = (rasterY & 7) + (bitmap * 8); | 825 const int vbank = (rasterY & 7) + (bitmap * 8); |
826 int vr, vb; | |
827 (void) rasterX; | 826 (void) rasterX; |
828 if (rasterY < 100) | |
829 { | |
830 vb = 0; | |
831 vr = rasterY; | |
832 } | |
833 else | |
834 { | |
835 vb = 0; | |
836 vr = rasterY - 100; | |
837 } | |
838 | 827 |
839 return dmC64GetGenericMCPixel( | 828 return dmC64GetGenericMCPixel( |
840 img, bmoffs, scroffs, shift, | 829 img, bmoffs, scroffs, shift, |
841 vbank, bitmap, 0, | 830 vbank, bitmap, 0, |
842 img->extraData[vb].data[vr] & 15); | 831 img->extraData[0].data[rasterY] & 15); |
843 } | |
844 | |
845 | |
846 static Uint8 fmtGetPixelGunPaint( | |
847 const DMC64Image *img, const int bmoffs, const int scroffs, | |
848 const int shift, const int bitmap, const int rasterX, const int rasterY) | |
849 { | |
850 const int vbank = (rasterY & 7) + (bitmap * 8); | |
851 int vr, vb; | |
852 (void) rasterX; | |
853 if (rasterY < 177) | |
854 { | |
855 vb = 0; | |
856 vr = rasterY; | |
857 } | |
858 else | |
859 { | |
860 vb = 0; | |
861 vr = rasterY - 177; | |
862 } | |
863 | |
864 return dmC64GetGenericMCPixel( | |
865 img, bmoffs, scroffs, shift, | |
866 vbank, bitmap, 0, | |
867 img->extraData[vb].data[vr] & 15); | |
868 } | 832 } |
869 | 833 |
870 | 834 |
871 static Uint8 fmtGetPixelBFLI( | 835 static Uint8 fmtGetPixelBFLI( |
872 const DMC64Image *img, const int bmoffs, const int scroffs, | 836 const DMC64Image *img, const int bmoffs, const int scroffs, |
1069 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL }, | 1033 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL }, |
1070 { DO_COPY , DS_EXTRA_DATA , 0x3f40, 0, 100, 0, NULL, NULL }, | 1034 { DO_COPY , DS_EXTRA_DATA , 0x3f40, 0, 100, 0, NULL, NULL }, |
1071 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL }, | 1035 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL }, |
1072 DEF_SCREEN_RAMS_8(0x43e8, 8, 0x400), | 1036 DEF_SCREEN_RAMS_8(0x43e8, 8, 0x400), |
1073 { DO_COPY , DS_BITMAP_RAM , 0x63e8, 1, 0 , 0, NULL, NULL }, | 1037 { DO_COPY , DS_BITMAP_RAM , 0x63e8, 1, 0 , 0, NULL, NULL }, |
1074 { DO_COPY , DS_EXTRA_DATA , 0x8328, 1, 100, 0, NULL, NULL }, | 1038 { DO_COPY , DS_EXTRA_DATA , 0x8328, 0, 100, 100, NULL, NULL }, |
1075 { DO_DEC_FUNC , 0 , 0x2742, 0, 1 , 0, fmtTruePaintGetLaceType, NULL }, | 1039 { DO_DEC_FUNC , 0 , 0x2742, 0, 1 , 0, fmtTruePaintGetLaceType, NULL }, |
1076 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL }, | 1040 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL }, |
1077 } | 1041 } |
1078 }, | 1042 }, |
1079 | 1043 |
1708 { | 1672 { |
1709 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, | 1673 D64_FMT_MC | D64_FMT_FLI | D64_FMT_ILACE, |
1710 C64_SCR_WIDTH, C64_SCR_HEIGHT, | 1674 C64_SCR_WIDTH, C64_SCR_HEIGHT, |
1711 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, | 1675 C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT, |
1712 NULL, NULL, | 1676 NULL, NULL, |
1713 fmtGetPixelGunPaint, | 1677 fmtGetPixelFunPaint2, // The format is essentially same as FP2 |
1714 { | 1678 { |
1715 DEF_SCREEN_RAMS_8(0x0000, 0, 0x400), | 1679 DEF_SCREEN_RAMS_8(0x0000, 0, 0x400), |
1716 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL }, | 1680 { DO_COPY , DS_BITMAP_RAM , 0x2000, 0, 0 , 0, NULL, NULL }, |
1717 { DO_COPY , DS_EXTRA_DATA , 0x3f4f, 0, 177, 0, NULL, NULL }, | 1681 { DO_COPY , DS_EXTRA_DATA , 0x3f4f, 0, 177, 0, NULL, NULL }, |
1718 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL }, | 1682 { DO_COPY , DS_COLOR_RAM , 0x4000, 0, 0 , 0, NULL, NULL }, |
1719 DEF_SCREEN_RAMS_8(0x4400, 8, 0x400), | 1683 DEF_SCREEN_RAMS_8(0x4400, 8, 0x400), |
1720 { DO_COPY , DS_BITMAP_RAM , 0x6400, 1, 0 , 0, NULL, NULL }, | 1684 { DO_COPY , DS_BITMAP_RAM , 0x6400, 1, 0 , 0, NULL, NULL }, |
1721 { DO_COPY , DS_EXTRA_DATA , 0x47e8, 1, 20 , 0, NULL, NULL }, | 1685 // GunPaint does not store the last 3 d021 values .. so set them to black |
1686 // XXX TODO: According to some, the last 4 should be same .. | |
1687 { DO_SET_MEM , DS_EXTRA_DATA , 0 , 0, 3 , 20+177, NULL, NULL }, | |
1722 { DO_DEC_FUNC , 0 , 0x2742, 0, 1 , 0, fmtTruePaintGetLaceType, NULL }, | 1688 { DO_DEC_FUNC , 0 , 0x2742, 0, 1 , 0, fmtTruePaintGetLaceType, NULL }, |
1723 { DO_ENC_FUNC , 0 , fmtGunPaintMagicOffs, 0, fmtGunPaintMagicLen, 0, NULL, fmtEncodeGunPaint }, | 1689 { DO_ENC_FUNC , 0 , fmtGunPaintMagicOffs, 0, fmtGunPaintMagicLen, 0, NULL, fmtEncodeGunPaint }, |
1724 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL }, | 1690 { DO_LAST , 0 , 0 , 0, 0 , 0, NULL, NULL }, |
1725 } | 1691 } |
1726 }, | 1692 }, |