00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00046 #include <gdm/display.h>
00047 #include <gdm/display-hw.h>
00048 #include <time.h>
00049
00050 gdm_display display;
00051
00052
00053 static void
00054 draw (unsigned short x, unsigned short y, unsigned char data)
00055 {
00056 unsigned short y1;
00057
00058 for (y1 = y; y1 < y + 8 && y1 < 128; y1++)
00059 {
00060 unsigned char line = y1 < 64;
00061
00062 _gdm_hw_set_side (&display, line);
00063 _gdm_hw_set_x (&display, x);
00064 _gdm_hw_set_y (&display, y1 >= 64 ? y1 - 64 : y1);
00065 _gdm_hw_set_data (&display, data);
00066 }
00067 }
00068
00069
00070 static void
00071 draw_crossing (unsigned short cnt)
00072 {
00073 unsigned short x1, y1;
00074
00075
00076 for (x1 = 0; x1 <= 7; x1++)
00077 {
00078 unsigned short line;
00079
00080 for (line = 0; line < 2; line++)
00081 {
00082 _gdm_hw_set_side (&display, line);
00083 _gdm_hw_set_x (&display, x1);
00084 _gdm_hw_set_y (&display, 0);
00085 for (y1 = 0; y1 < 64; y1++)
00086 {
00087 unsigned char val;
00088
00089 val = 1 << ((cnt + y1) & 7);
00090 val |= 1 << ((cnt - y1) & 7);
00091 _gdm_hw_set_data (&display, val);
00092 }
00093 }
00094 }
00095 }
00096
00097 int
00098 main ()
00099 {
00100 unsigned short x = 0;
00101 unsigned short y = 0;
00102 unsigned cnt = 0;
00103 unsigned short oldx = 0;
00104 unsigned short oldy = 0;
00105 unsigned short test = 0;
00106
00107 gdm_initialize (&display);
00108
00109 while (1)
00110 {
00111 switch (test % 2)
00112 {
00113 case 0:
00114
00115 draw_crossing (cnt++);
00116 udelay (10000);
00117 test++;
00118 break;
00119
00120 case 1:
00121
00122
00123 draw (oldx, oldy, 0x00);
00124 oldx = x;
00125 oldy = y;
00126 draw (x, y++, 0xFF);
00127 udelay (100000);
00128
00129 if (y >= 128)
00130 {
00131 y = 0;
00132 x++;
00133 if (x >= 8)
00134 {
00135 test++;
00136 x = 0;
00137 }
00138 }
00139 break;
00140 }
00141 }
00142 }