diff tools/lib64util.c @ 2265:48b48251610a

Refactor how the image "mode/type" is handled. It is still not perfect for our purposes, but better now.
author Matti Hamalainen <ccr@tnsp.org>
date Mon, 17 Jun 2019 02:03:35 +0300
parents e25fa516b53a
children 87533af8db64
line wrap: on
line diff
--- a/tools/lib64util.c	Mon Jun 17 01:44:54 2019 +0300
+++ b/tools/lib64util.c	Mon Jun 17 02:03:35 2019 +0300
@@ -59,7 +59,7 @@
 
     if (img != NULL)
     {
-        dmC64GetImageTypeString(typeStr, sizeof(typeStr), img->fmt->type, TRUE);
+        dmC64GetImageTypeString(typeStr, sizeof(typeStr), img->extraInfo[D64_EI_MODE], TRUE);
 
         dmC64ImageDumpLine(fh, indent,
             "Type", "%s", typeStr);
@@ -67,7 +67,7 @@
         dmC64ImageDumpLine(fh, indent,
             "Internal blocks", "%d", img->nblocks);
 
-        if (img->fmt->type & D64_FMT_ILACE)
+        if (img->extraInfo[D64_EI_MODE] & D64_FMT_ILACE)
         {
             char *tmps;
             switch (img->extraInfo[D64_EI_ILACE_TYPE])
@@ -80,7 +80,7 @@
                 "Interlace type", "%s", tmps);
         }
 
-        if (img->fmt->type & D64_FMT_FLI)
+        if (img->extraInfo[D64_EI_MODE] & D64_FMT_FLI)
         {
             dmC64ImageDumpLine(fh, indent,
                 "FLI type", "%d",
@@ -103,9 +103,9 @@
             "d021 / background", "%d ($%02x)",
             img->bgcolor, img->bgcolor);
 
-        if (img->fmt->type & D64_FMT_CHAR)
+        if (img->extraInfo[D64_EI_MODE] & D64_FMT_CHAR)
         {
-            if ((img->fmt->type & D64_FMT_MODE_MASK) == (D64_FMT_MC | D64_FMT_ECM))
+            if ((img->extraInfo[D64_EI_MODE] & D64_FMT_MODE_MASK) == (D64_FMT_MC | D64_FMT_ECM))
             {
                 dmC64ImageDumpLine(fh, indent,
                     "d022", "%d ($%02x)",
@@ -115,7 +115,7 @@
                     img->d023, img->d023);
             }
 
-            if ((img->fmt->type & D64_FMT_MODE_MASK) == D64_FMT_ECM)
+            if ((img->extraInfo[D64_EI_MODE] & D64_FMT_MODE_MASK) == D64_FMT_ECM)
             {
                 dmC64ImageDumpLine(fh, indent,
                     "d024", "%d ($%02x)",
@@ -126,7 +126,7 @@
     else
     if (fmt != NULL)
     {
-        dmC64GetImageTypeString(typeStr, sizeof(typeStr), fmt->format->type, TRUE);
+        dmC64GetImageTypeString(typeStr, sizeof(typeStr), fmt->format->mode, TRUE);
 
         dmC64ImageDumpLine(fh, indent,
             "Type", "%s", typeStr);