]> git.lizzy.rs Git - plan9front.git/blobdiff - sys/src/9/bcm/screen.c
merge
[plan9front.git] / sys / src / 9 / bcm / screen.c
index fe7ed6c93457d31805ae9197a567e61e4fc52b87..ec914730ebd0fc8f72a544651d12f928aa5e5e76 100644 (file)
@@ -22,20 +22,6 @@ enum {
        Depth           = 16,
 };
 
-Cursor arrow = {
-       { -1, -1 },
-       { 0xFF, 0xFF, 0x80, 0x01, 0x80, 0x02, 0x80, 0x0C,
-         0x80, 0x10, 0x80, 0x10, 0x80, 0x08, 0x80, 0x04,
-         0x80, 0x02, 0x80, 0x01, 0x80, 0x02, 0x8C, 0x04,
-         0x92, 0x08, 0x91, 0x10, 0xA0, 0xA0, 0xC0, 0x40,
-       },
-       { 0x00, 0x00, 0x7F, 0xFE, 0x7F, 0xFC, 0x7F, 0xF0,
-         0x7F, 0xE0, 0x7F, 0xE0, 0x7F, 0xF0, 0x7F, 0xF8,
-         0x7F, 0xFC, 0x7F, 0xFE, 0x7F, 0xFC, 0x73, 0xF8,
-         0x61, 0xF0, 0x60, 0xE0, 0x40, 0x40, 0x00, 0x00,
-       },
-};
-
 Memimage *gscreen;
 
 static Memdata xgdata;
@@ -185,16 +171,20 @@ flushmemscreen(Rectangle)
 {
 }
 
-uchar*
+Memdata*
 attachscreen(Rectangle *r, ulong *chan, int* d, int *width, int *softscreen)
 {
+       if(gscreen == nil)
+               return nil;
+
        *r = gscreen->r;
        *d = gscreen->depth;
        *chan = gscreen->chan;
        *width = gscreen->width;
        *softscreen = 0;
 
-       return gscreen->data->bdata;
+       gscreen->data->ref++;
+       return gscreen->data;
 }
 
 void
@@ -317,7 +307,7 @@ screenputc(char *buf)
        static int *xp;
        static int xbuf[256];
 
-       if (xp < xbuf || xp >= &xbuf[sizeof(xbuf)])
+       if (xp < xbuf || xp >= &xbuf[nelem(xbuf)])
                xp = xbuf;
 
        switch (buf[0]) {