changeset 1582:1f6aed186c4e

Add somewhat broken support for "Big FLI" aka BFLI files. Needs more work.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 13 May 2018 23:20:32 +0300
parents 5aa1c3ec91d5
children fd0d1b4efc83
files tools/lib64fmts.c
diffstat 1 files changed, 37 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64fmts.c	Sun May 13 23:19:36 2018 +0300
+++ b/tools/lib64fmts.c	Sun May 13 23:20:32 2018 +0300
@@ -464,6 +464,24 @@
 }
 
 
+static Uint8 fmtGetPixelBFLI(
+    const DMC64Image *img, const int bmoffs, const int scroffs,
+    const int vshift, const int vbitmap, const int raster)
+{
+    const int vbb = raster < 200 ? 0 : 1;
+    const int vbank = (raster & 7) + (vbb * 8);
+    const int vbmoffs = raster < 200 ? bmoffs : bmoffs - 8000;
+    const int vscroffs = scroffs & 1023;
+
+//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);
+}
+
+
 static Uint8 fmtGetPixelBlackMailFLI(
     const DMC64Image *img, const int bmoffs, const int scroffs,
     const int vshift, const int vbitmap, const int raster)
@@ -791,6 +809,25 @@
     },
 
     {
+        D64_FMT_MC | D64_FMT_FLI, "bfli", "Big FLI (unpacked) [BROKEN]", 0x3bff, 33795, DM_FMT_RD,
+        C64_SCR_WIDTH / 2, C64_SCR_HEIGHT * 2,
+        C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,
+        NULL,
+        NULL, NULL,
+        NULL, NULL,
+        fmtGetPixelBFLI,
+        {
+            { DT_COLOR_RAM,    0x0001, 0,  0, NULL, NULL },
+            DEF_SCREEN_RAMS_8( 0x0401, 0,  0x400)
+            { DT_BITMAP,       0x2401, 0,  0, NULL, NULL },
+            DEF_SCREEN_RAMS_8( 0x4401, 8,  0x400)
+            { DT_BITMAP,       0x6401 - 24*8, 1,  0, NULL, NULL },
+            { DT_LAST,         0,      0,  0, NULL, NULL },
+        }
+    },
+
+
+    {
         D64_FMT_MC | D64_FMT_FLI, "bml", "Blackmail FLI (unpacked)", 0x3b00, 17474, DM_FMT_RDWR,
         C64_SCR_WIDTH / 2, C64_SCR_HEIGHT,
         C64_SCR_CH_WIDTH , C64_SCR_CH_HEIGHT,