# HG changeset patch # User Matti Hamalainen # Date 1529872621 -10800 # Node ID a35f6e19f57a35b302119580f190842918ac83c0 # Parent b052754a1a237e2f2b4fd3ade34833f3730051dc Implement read-only support for HCB (Half Char Bitmap) format. diff -r b052754a1a23 -r a35f6e19f57a tools/lib64fmts.c --- a/tools/lib64fmts.c Sun Jun 24 22:17:28 2018 +0300 +++ b/tools/lib64fmts.c Sun Jun 24 23:37:01 2018 +0300 @@ -866,6 +866,18 @@ } +static Uint8 fmtGetPixelHCB( + const DMC64Image *img, const int bmoffs, const int scroffs, + const int shift, const int bitmap, const int rasterX, const int rasterY) +{ + const int vbank = (rasterY / 4) & 1; + (void) bitmap; + (void) rasterX; + + return dmC64GetGenericMCPixel(img, bmoffs, scroffs, shift, vbank, 0, vbank, img->bgcolor); +} + + static Uint8 fmtGetPixelCrestHIFLIorCDHM( const DMC64Image *img, const int bmoffs, const int scroffs, const int shift, const int bitmap, const int rasterX, const int rasterY) @@ -1696,6 +1708,28 @@ }, { + "hcb", "Half Char Bitmap (unpacked)", 0x5000, 12148, DM_FMT_RD, + NULL, + NULL, NULL, + { + D64_FMT_MC | D64_FMT_FLI, + C64_SCR_WIDTH / 2, C64_SCR_HEIGHT, + C64_SCR_CH_WIDTH, C64_SCR_CH_HEIGHT, + NULL, NULL, + fmtGetPixelHCB, + { + { DO_COPY , DS_COLOR_RAM , 0x0000, 0, 0, 0, NULL, NULL }, + { DO_COPY , DS_COLOR_RAM , 0x0400, 1, 0, 0, NULL, NULL }, + { DO_COPY , DS_SCREEN_RAM , 0x0800, 0, 0, 0, NULL, NULL }, + { DO_COPY , DS_SCREEN_RAM , 0x0c00, 1, 0, 0, NULL, NULL }, + { DO_COPY , DS_BITMAP_RAM , 0x1000, 0, 0, 0, NULL, NULL }, + { DO_LAST , 0 , 0 , 0, 0, 0, NULL, NULL }, + } + }, + NULL + }, + + { "pen", "Pentel Paint (unpacked)", 0x4800, 19845, DM_FMT_RD | DM_FMT_BROKEN, NULL, NULL, NULL,