# HG changeset patch # User Matti Hamalainen # Date 1527201732 -10800 # Node ID da4d7b5873c02dc92a2c87066f8ebafe499113aa # Parent 2a1866fd546eb1a55b4b20c21fd1356f8598bd28 Cleanups. diff -r 2a1866fd546e -r da4d7b5873c0 tools/lib64fmts.c --- a/tools/lib64fmts.c Fri May 25 01:41:31 2018 +0300 +++ b/tools/lib64fmts.c Fri May 25 01:42:12 2018 +0300 @@ -478,50 +478,49 @@ static Uint8 fmtGetPixelBFLI( const DMC64Image *img, const int bmoffs, const int scroffs, - const int vshift, const int vbitmap, const int raster) + const int vshift, const int bitmap, const int raster) { - const int vbb = raster < 200 ? 0 : 1; + const int vbb = bmoffs > 0x1fff ? 1 : 0; const int vbank = (raster & 7) + (vbb * 8); - const int vbmoffs = raster < 200 ? bmoffs : bmoffs - 8000; - const int vscroffs = scroffs & 1023; + const int vbmoffs = bmoffs & 0x1fff; + const int vscroffs = scroffs & 0x3ff; //fprintf(stderr, "bmoffs=%d, scroffs=%d, vshift=%d, vbitmap=%d, raster=%d\n", vbmoffs, vscroffs, vshift, vbb, raster); return dmC64GetGenericMCPixel( img, vbmoffs, vscroffs, vshift, - vbank, vbb, 0, - img->bgcolor); + vbank, vbb, 0, img->bgcolor); } static Uint8 fmtGetPixelBlackMailFLI( const DMC64Image *img, const int bmoffs, const int scroffs, - const int vshift, const int vbitmap, const int raster) + const int shift, const int bitmap, const int raster) { const int vbank = raster & 7; return dmC64GetGenericMCPixel( - img, bmoffs, scroffs, vshift, - vbank, vbitmap, 0, + img, bmoffs, scroffs, shift, + vbank, bitmap, 0, img->extraData[0].data[raster] & 15); } static Uint8 fmtGetPixelFLIDesigner( const DMC64Image *img, const int bmoffs, const int scroffs, - const int vshift, const int vbitmap, const int raster) + const int shift, const int bitmap, const int raster) { - return dmC64GetGenericMCPixel(img, bmoffs, scroffs, vshift, raster & 7, vbitmap, 0, img->bgcolor); + return dmC64GetGenericMCPixel(img, bmoffs, scroffs, shift, raster & 7, bitmap, 0, img->bgcolor); } static Uint8 fmtGetPixelCHFLI( const DMC64Image *img, const int bmoffs, const int scroffs, - const int vshift, const int vbitmap, const int raster) + const int shift, const int bitmap, const int raster) { const int vbank = raster & 7; - if ((img->bitmap[vbitmap].data[bmoffs] >> vshift) & 1) + if ((img->bitmap[bitmap].data[bmoffs] >> shift) & 1) return img->screen[vbank].data[scroffs] >> 4; else return img->screen[vbank].data[scroffs] & 15;