changeset 222:0e8011589d76

Preliminary work for implementing C64 FLI multicolor import/export (does not work yet) in FBI FLI Designer v1.1 format.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 05 Sep 2018 12:57:46 +0300
parents 17f635da5180
children 62016fa40651
files exporters.pde templates/fbifd.fd1
diffstat 2 files changed, 55 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/exporters.pde	Wed Sep 05 12:30:41 2018 +0300
+++ b/exporters.pde	Wed Sep 05 12:57:46 2018 +0300
@@ -353,6 +353,37 @@
         g_map[1] = byte(fdata[0x232b] & 0x0f); //baku
     }
     else
+    if (g_machine == C64FLIM) {
+        // FBI Crew FLI designer 1.x & 2.0 (unpacked)
+        //    { DO_COPY      , DS_COLOR_RAM   , 0x0000, 0,  0,   0, NULL, NULL },
+        //    DEF_SCREEN_RAMS_8(0x0400, 0, 0x400, 0),
+        //    { DO_COPY      , DS_BITMAP_RAM  , 0x2400, 0,  0,   0, NULL, NULL },
+        //    { DO_LAST      , 0              , 0     , 0,  0,   0, NULL, NULL },
+        if (fdata.length != 17409) {
+            // TODO XXX: Check for load addresses 3c00 and 3ff0
+            return false;
+        }
+        for (y = 0; y < 25; y++)
+        for (x = 0; x < 40; x++)
+        for (y2 = 0; y2 < 8; y2++)
+        {
+            ad = x + y * 40;
+            mpCopyByte(fdata,
+                1024 + x * 8 + y * (320 * 8) + y2 * 320,
+                0x2402 + x * 8 + y * (40 * 8) + y2);
+
+            p1 = fdata[0x0402 + ad] & 0x0f;
+            p2 = (fdata[0x0402 + ad] >> 4) & 0x0f;
+            p3 = fdata[0x0002 + ad] & 0x0f;
+
+            g_map[65536 + x + y * 40] = byte(p1);
+            g_map[65536 + x + y * 40 + 1000] = byte(p2);
+            g_map[65536 + x + y * 40 + 2000] = byte(p3);
+        }
+        g_map[0] = byte(0); //bord
+        g_map[1] = byte(0); //baku
+    }
+    else
     if (g_machine == MSX) { // sc2
         // 7=bitmap 32*24*8
         // 7+(32*24*8)=colormap 32*24
@@ -479,6 +510,27 @@
         }
     }
     else
+    if (g_machine == C64FLIM) {
+        // FBI Crew FLI designer 1.x & 2.0 (unpacked)
+        //    { DO_COPY      , DS_COLOR_RAM   , 0x0000, 0,  0,   0, NULL, NULL },
+        //    DEF_SCREEN_RAMS_8(0x0400, 0, 0x400, 0),
+        //    { DO_COPY      , DS_BITMAP_RAM  , 0x2400, 0,  0,   0, NULL, NULL },
+        //    { DO_LAST      , 0              , 0     , 0,  0,   0, NULL, NULL },
+        ctx.loadTemplate("fbifd.fd1");
+
+        ctx.setOffs(2);
+        mpExportColorData(ctx, 40, 25, 65536 + 2000, 2);
+
+        for (int nbank = 1; nbank <= 8; nbank++)
+        {
+            ctx.setOffs(2 + nbank * 0x0400);
+            mpExportColorData(ctx, 40, 25, 65536, 1);
+        }
+
+        ctx.setOffs(0x2402);
+        mpExportBitmapData(ctx, 40, 25);
+    }
+    else
     if (g_machine == MSX) {
         ctx.loadTemplate("msx-screen2.sc2");
 
@@ -1950,11 +2002,11 @@
     if (g_machine == C64FLIM)
     {
         //C64 FLI multicolor
-        g_name = "fli";
+        g_name = "flimc";
         g_exportext = "";
         g_exportname = "PRG file";
-        g_formatname = "";
-        g_formatext = "";
+        g_formatname = "FBI FLI Designer 1.0";
+        g_formatext = "fd1";
 
         g_hzoomer = 2;
         g_maxcolors = 16;
Binary file templates/fbifd.fd1 has changed