tr

Revision:
52:1210e39a4748
Parent:
36:00ebd449b6f3
Child:
53:62184d04f9b5
--- a/N5110.cpp	Wed Mar 08 16:13:08 2017 +0000
+++ b/N5110.cpp	Thu Mar 18 13:58:10 2021 +0000
@@ -453,4 +453,27 @@
 
         }
     }
+}
+
+void N5110::drawPic(int x0,
+                int y0,
+                int nrows,
+                int ncols,
+                char *pic)
+{
+    if((nrows - x0) < 84)
+        x0 = nrows - 84;
+    if((ncols - y0) < 48)
+        y0 = ncols - 48;
+    for(int m = 0; m < 84; m++)
+    {
+        for(int n = 0; n < 6; n++)
+        {
+            char pixels = 0;
+            int divisor = ((x0 + m) * ncols + (y0 + n * 8))/8;
+            int remainder = ((x0 + m) * ncols + (y0 + n * 8))%8;
+            pixels = ((pic[divisor] << remainder)) + ((pic[divisor+1] >> (8 - remainder)));
+            buffer[m][n] = pixels;
+        }
+    }
 }
\ No newline at end of file