changeset 1381:b6782b785457

Move things around a bit.
author Matti Hamalainen <ccr@tnsp.org>
date Sun, 24 Sep 2017 19:51:23 +0300
parents 959b34402b81
children 558776ee9603
files tools/lib64gfx.c
diffstat 1 files changed, 33 insertions(+), 33 deletions(-) [+]
line wrap: on
line diff
--- a/tools/lib64gfx.c	Sun Sep 24 19:49:25 2017 +0300
+++ b/tools/lib64gfx.c	Sun Sep 24 19:51:23 2017 +0300
@@ -12,6 +12,39 @@
 #define BUF_SIZE_GROW      (4*1024)
 
 
+// Based on Pepto's palette, stolen from VICE
+DMColor dmC64Palette[C64_NCOLORS] =
+{
+    { 0x00, 0x00, 0x00, 0xff },
+    { 0xFF, 0xFF, 0xFF, 0xff },
+    { 0x68, 0x37, 0x2B, 0xff },
+    { 0x70, 0xA4, 0xB2, 0xff },
+    { 0x6F, 0x3D, 0x86, 0xff },
+    { 0x58, 0x8D, 0x43, 0xff },
+    { 0x35, 0x28, 0x79, 0xff },
+    { 0xB8, 0xC7, 0x6F, 0xff },
+    { 0x6F, 0x4F, 0x25, 0xff },
+    { 0x43, 0x39, 0x00, 0xff },
+    { 0x9A, 0x67, 0x59, 0xff },
+    { 0x44, 0x44, 0x44, 0xff },
+    { 0x6C, 0x6C, 0x6C, 0xff },
+    { 0x9A, 0xD2, 0x84, 0xff },
+    { 0x6C, 0x5E, 0xB5, 0xff },
+    { 0x95, 0x95, 0x95, 0xff },
+};
+
+
+#define DM_GET_ADDR_LO(addr) ((addr) & 0xff)
+#define DM_GET_ADDR_HI(addr) (((addr) >> 8) & 0xff)
+
+
+static BOOL dmCompareAddr16(const Uint8 *buf, const size_t offs, const Uint16 addr)
+{
+    return buf[offs    ] == DM_GET_ADDR_LO(addr) &&
+           buf[offs + 1] == DM_GET_ADDR_HI(addr);
+}
+
+
 int dmC64ImageGetNumBanks(const DMC64ImageFormat *fmt)
 {
     int nbanks = 0;
@@ -113,39 +146,6 @@
 }
 
 
-// Based on Pepto's palette, stolen from VICE
-DMColor dmC64Palette[C64_NCOLORS] =
-{
-    { 0x00, 0x00, 0x00, 0xff },
-    { 0xFF, 0xFF, 0xFF, 0xff },
-    { 0x68, 0x37, 0x2B, 0xff },
-    { 0x70, 0xA4, 0xB2, 0xff },
-    { 0x6F, 0x3D, 0x86, 0xff },
-    { 0x58, 0x8D, 0x43, 0xff },
-    { 0x35, 0x28, 0x79, 0xff },
-    { 0xB8, 0xC7, 0x6F, 0xff },
-    { 0x6F, 0x4F, 0x25, 0xff },
-    { 0x43, 0x39, 0x00, 0xff },
-    { 0x9A, 0x67, 0x59, 0xff },
-    { 0x44, 0x44, 0x44, 0xff },
-    { 0x6C, 0x6C, 0x6C, 0xff },
-    { 0x9A, 0xD2, 0x84, 0xff },
-    { 0x6C, 0x5E, 0xB5, 0xff },
-    { 0x95, 0x95, 0x95, 0xff },
-};
-
-
-#define DM_GET_ADDR_LO(addr) ((addr) & 0xff)
-#define DM_GET_ADDR_HI(addr) (((addr) >> 8) & 0xff)
-
-
-static BOOL dmCompareAddr16(const Uint8 *buf, const size_t offs, const Uint16 addr)
-{
-    return buf[offs    ] == DM_GET_ADDR_LO(addr) &&
-           buf[offs + 1] == DM_GET_ADDR_HI(addr);
-}
-
-
 int dmC64ConvertCSDataToImage(DMImage *img,
     int xoffs, int yoffs, const Uint8 *buf,
     int width, int height, BOOL multicolor,