David Moore / N5110

Fork of N5110 by Craig Evans

Files at this revision

API Documentation at this revision

Comitter:
eencae
Date:
Tue Mar 07 16:46:13 2017 +0000
Parent:
33:d80e568a2e18
Child:
36:00ebd449b6f3
Child:
38:92fad278c2c3
Commit message:
Added sprite support (untested).

Changed in this revision

N5110.cpp Show annotated file Show diff for this revision Revisions of this file
N5110.h Show annotated file Show diff for this revision Revisions of this file
--- a/N5110.cpp	Thu Feb 16 15:58:48 2017 +0000
+++ b/N5110.cpp	Tue Mar 07 16:46:13 2017 +0000
@@ -431,4 +431,31 @@
             drawLine(x0,y,x0+(width-1),y,type);  // draw line across screen
         }
     }
+}
+
+void N5110::drawGlyph(int x0,
+                      int y0,
+                      int nx,
+                      int ny,
+                      int *glyph)
+{
+    printf("Draw Glyph:\n");
+    
+    for (int i = 0; i < nx; i++) {
+        for (int j = 0 ; j < ny ; j++) {
+
+            int pixel = *((glyph+i*ny)+j);
+
+            printf("%d,%d = %d\n",i,j,pixel);
+
+            if (pixel) {
+                setPixel(x0+j,y0+i);
+            }
+            else {
+                clearPixel(x0+j,y0+i);    
+            }
+
+        }
+    }
+
 }
\ No newline at end of file
--- a/N5110.h	Thu Feb 16 15:58:48 2017 +0000
+++ b/N5110.h	Tue Mar 07 16:46:13 2017 +0000
@@ -388,6 +388,12 @@
                   unsigned int const height,
                   FillType const     fill);
 
+ void drawGlyph(int x0,
+                      int y0,
+                      int nx,
+                      int ny,
+                      int *glyph);
+
 private:
 // methods
     void setXYAddress(unsigned int const x,