]> git.lizzy.rs Git - plan9front.git/blob - sys/src/9/zynq/screen.c
added zynq kernel
[plan9front.git] / sys / src / 9 / zynq / screen.c
1 #include "u.h"
2 #include "../port/lib.h"
3 #include "mem.h"
4 #include "dat.h"
5 #include "fns.h"
6 #include "io.h"
7 #include "../port/error.h"
8
9 #define Image   IMAGE
10 #include <draw.h>
11 #include <memdraw.h>
12 #include <cursor.h>
13 #include "screen.h"
14
15 Cursor  arrow = {
16         { -1, -1 },
17         { 0xFF, 0xFF, 0x80, 0x01, 0x80, 0x02, 0x80, 0x0C,
18           0x80, 0x10, 0x80, 0x10, 0x80, 0x08, 0x80, 0x04,
19           0x80, 0x02, 0x80, 0x01, 0x80, 0x02, 0x8C, 0x04,
20           0x92, 0x08, 0x91, 0x10, 0xA0, 0xA0, 0xC0, 0x40,
21         },
22         { 0x00, 0x00, 0x7F, 0xFE, 0x7F, 0xFC, 0x7F, 0xF0,
23           0x7F, 0xE0, 0x7F, 0xE0, 0x7F, 0xF0, 0x7F, 0xF8,
24           0x7F, 0xFC, 0x7F, 0xFE, 0x7F, 0xFC, 0x73, 0xF8,
25           0x61, 0xF0, 0x60, 0xE0, 0x40, 0x40, 0x00, 0x00,
26         },
27 };
28
29 Memimage *gscreen;
30 static Memdata xgdata;
31
32 static Memimage xgscreen =
33 {
34         { 0, 0, 800, 600 },     /* r */
35         { 0, 0, 800, 600 },     /* clipr */
36         24,                     /* depth */
37         3,                      /* nchan */
38         BGR24,                  /* chan */
39         nil,                    /* cmap */
40         &xgdata,                /* data */
41         0,                      /* zero */
42         0,                      /* width in words of a single scan line */
43         0,                      /* layer */
44         0,                      /* flags */
45 };
46
47 void
48 cursoron(void)
49 {
50 }
51
52 void
53 cursoroff(void)
54 {
55 }
56
57 void
58 setcursor(Cursor*)
59 {
60 }
61
62 void
63 flushmemscreen(Rectangle)
64 {
65 }
66
67 void
68 drawflushreal(void)
69 {
70         uchar *fb, *fbe;
71         
72         fb = xgdata.bdata;
73         fbe = fb + Dx(xgscreen.r) * Dy(xgscreen.r) * 3;
74         cleandse(fb, fbe);
75         clean2pa(PADDR(fb), PADDR(fbe));
76 }
77
78 void
79 screeninit(void)
80 {
81         uchar *fb;
82
83         fb = xspanalloc(Dx(xgscreen.r) * Dy(xgscreen.r) * 3, 64, 0);
84         print("%x\n", PADDR(fb));
85         memsetchan(&xgscreen, BGR24);
86         conf.monitor = 1;
87         xgdata.bdata = fb;
88         xgdata.ref = 1;
89         gscreen = &xgscreen;
90         gscreen->width = wordsperline(gscreen->r, gscreen->depth);
91
92         memimageinit();
93 }
94
95 uchar*
96 attachscreen(Rectangle *r, ulong *chan, int* d, int *width, int *softscreen)
97 {
98         *r = gscreen->r;
99         *d = gscreen->depth;
100         *chan = gscreen->chan;
101         *width = gscreen->width;
102         *softscreen = 0;
103
104         return gscreen->data->bdata;
105 }
106
107 void
108 getcolor(ulong, ulong *, ulong *, ulong *)
109 {
110 }
111
112 int
113 setcolor(ulong, ulong, ulong, ulong)
114 {
115         return 0;
116 }
117
118 void
119 blankscreen(int)
120 {
121 }
122
123 void
124 mousectl(Cmdbuf *)
125 {
126 }