changeset 5:a2d09299dce5

Regreplace s/ & 15/ & 0x0f/g; s/ & 240/ & 0xf0/g
author Matti Hamalainen <ccr@tnsp.org>
date Tue, 03 Jul 2018 21:22:49 +0300
parents a1261cd4c676
children 07ddf9cfc6c2
files exporters.pde
diffstat 1 files changed, 23 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/exporters.pde	Tue Jul 03 21:19:29 2018 +0300
+++ b/exporters.pde	Tue Jul 03 21:22:49 2018 +0300
@@ -450,7 +450,7 @@
             return;
         }
         if (g_template.length >= 0x232a) {
-            g_map[0] = byte(g_template[0x232a] & 15);
+            g_map[0] = byte(g_template[0x232a] & 0x0f);
         }
         for (y = 0; y < 25; y++) {
             for (x = 0; x < 40; x++) {
@@ -458,8 +458,8 @@
                     head = 2 + x * 8 + y * (40 * 8) + y2;
                     ad = 1024 + x * 8 + y * (320 * 8) + y2 * 320;
                     pushbyte(ad, head);
-                    p1 = g_template[0x1f42 + x + y * 40] & 15;
-                    p2 = g_template[0x1f42 + x + y * 40] & 240;
+                    p1 = g_template[0x1f42 + x + y * 40] & 0x0f;
+                    p2 = g_template[0x1f42 + x + y * 40] & 0xf0;
                     p2 = p2 >> 4;
                     g_map[65536 + x + y * 40 * 8 + y2 * 40] = byte(p2);
                     g_map[65536 + MX * MY * 8 + x + y * 40 * 8 + y2 * 40] = byte(p1);
@@ -487,11 +487,11 @@
                     ad = 1024 + x * 8 + y * (320 * 8) + y2 * 320;
                     pushbyte(ad, head);
 
-                    p1 = g_template[1026 + x + y * 40] & 15;
-                    p2 = g_template[1026 + x + y * 40] & 240;
+                    p1 = g_template[1026 + x + y * 40] & 0x0f;
+                    p2 = g_template[1026 + x + y * 40] & 0xf0;
                     p2 = p2 >> 4;
-                    l1 = g_template[2 + x + y * 40] & 15;
-                    l2 = g_template[2 + x + y * 40] & 240;
+                    l1 = g_template[2 + x + y * 40] & 0x0f;
+                    l2 = g_template[2 + x + y * 40] & 0xf0;
                     l2 = l2 >> 4;
                     g_map[65536 + x + y * 40 * 8 + y2 * 40] = byte(convertlumi(l1, p2));
                     g_map[65536 + MX * MY * 8 + x + y * 40 * 8 + y2 * 40] = byte(convertlumi(l2, p1));
@@ -522,23 +522,23 @@
                     ad = 1024 + x * 8 + y * (320 * 8) + y2 * 320;
                     pushbyte(ad, head);
 
-                    p1 = g_template[1026 + x + y * 40] & 15;
-                    p2 = g_template[1026 + x + y * 40] & 240;
+                    p1 = g_template[1026 + x + y * 40] & 0x0f;
+                    p2 = g_template[1026 + x + y * 40] & 0xf0;
                     p2 = p2 >> 4;
-                    l1 = g_template[2 + x + y * 40] & 15;
-                    l2 = g_template[2 + x + y * 40] & 240;
+                    l1 = g_template[2 + x + y * 40] & 0x0f;
+                    l2 = g_template[2 + x + y * 40] & 0xf0;
                     l2 = l2 >> 4;
                     g_map[65536 + x + y * 40 + 1000] = byte(convertlumi(l1, p2));
                     g_map[65536 + x + y * 40 + 0000] = byte(convertlumi(l2, p1));
                 }
             }
         }
-        p1 = int(g_template[1025]) & 240;
-        l1 = int(g_template[1025]) & 15;
+        p1 = int(g_template[1025]) & 0xf0;
+        l1 = int(g_template[1025]) & 0x0f;
         p1 = p1 >> 4;
         g_map[1] = byte(convertlumi(l1, p1));
-        p1 = int(g_template[1024]) & 240;
-        l1 = int(g_template[1024]) & 15;
+        p1 = int(g_template[1024]) & 0xf0;
+        l1 = int(g_template[1024]) & 0x0f;
         p1 = p1 >> 4;
         g_map[2] = byte(convertlumi(l1, p1));
     }
@@ -562,15 +562,15 @@
                     ad = 1024 + x * 8 + y * (320 * 8) + y2 * 320;
                     pushbyte(ad, head);
 
-                    p1 = g_template[0x1f42 + x + y * 40] & 15;
-                    p2 = g_template[0x1f42 + x + y * 40] & 240;
+                    p1 = g_template[0x1f42 + x + y * 40] & 0x0f;
+                    p2 = g_template[0x1f42 + x + y * 40] & 0xf0;
                     p2 = p2 >> 4;
-                    p3 = g_template[0x233a + x + y * 40] & 15;
+                    p3 = g_template[0x233a + x + y * 40] & 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(g_template[0x232a] & 15); //bord
-                    g_map[1] = byte(g_template[0x232b] & 15); //baku
+                    g_map[0] = byte(g_template[0x232a] & 0x0f); //bord
+                    g_map[1] = byte(g_template[0x232b] & 0x0f); //baku
                 }
             }
         }
@@ -590,8 +590,8 @@
                     head = 7 + x * 8 + y * (32 * 8) + y2;
                     ad = 1024 + x * 8 + y * (256 * 8) + y2 * 256;
                     pushbyte(ad, head);
-                    p1 = g_template[(8199) + x * 8 + ((y * 8 * 32) + y2)] & 15;
-                    p2 = g_template[(8199) + x * 8 + ((y * 8 * 32) + y2)] & 240;
+                    p1 = g_template[(8199) + x * 8 + ((y * 8 * 32) + y2)] & 0x0f;
+                    p2 = g_template[(8199) + x * 8 + ((y * 8 * 32) + y2)] & 0xf0;
                     p2 = p2 >> 4;
                     if (p1 == 0) {
                         p1 = 1;
@@ -690,7 +690,7 @@
             set_head(0x232a);
             colorexport(40, 25, 65536 + 2000, 2);
             set_head(0x2712);
-            write_head(int(g_map[1] & 15));
+            write_head(int(g_map[1] & 0x0f));
             export_program(fname);
         }