29 #define X_EXPANSION 14
41 HUBDATA volatile uint16_t gScreen[X_TILES * Y_TILES];
42 HUBDATA volatile uint32_t gColors[MAX_COLORS];
44 HUBDATA volatile uint32_t gDisplay[(X_TILES * Y_TILES << 4)+128];
45 HUBDATA volatile uint32_t gBitmap [(X_TILES * Y_TILES << 4)+128];
47 #define BITMAP_BASE (((int)gBitmap +256) & ~127) // page align
48 #define DISPLY_BASE (((int)gDisplay+256) & ~127)
64 0x4000+0x2000/3*0, 50,
65 0x8000+0x2000/3*1+1, 50,
66 0x8000+0x2000/3*2-1, 50,
67 0x8000+0x2000/3*0, 50,
76 0x4000+0x2000/12*0, 50,
77 0x8000+0x2000/12*1, 20,
78 0x8000+0x2000/12*2, 50,
79 0x8000+0x2000/12*3, 20,
80 0x8000+0x2000/12*4, 50,
81 0x8000+0x2000/12*5, 20,
82 0x8000+0x2000/12*6, 50,
83 0x8000+0x2000/12*7, 20,
84 0x8000+0x2000/12*8, 50,
85 0x8000+0x2000/12*9, 20,
86 0x8000+0x2000/12*10, 50,
87 0x8000+0x2000/12*11, 20,
88 0x8000+0x2000/12*0, 50,
123 static int tvstart(
int pin)
131 tp->screen = (uint32_t) &gScreen[0];
132 tp->colors = (uint32_t) &gColors[0];
135 tp->hx = X_EXPANSION;
147 for(n = 0; n < MAX_COLORS; n++)
148 gColors[n] = 0x1010 * ((n+4) & 0xF) + 0x2B060C02;
151 for (dx = 0; dx < tp->ht; dx++)
152 for (dy = 0; dy < tp->vt; dy++)
153 gScreen[dy * tp->ht + dx] = (DISPLY_BASE >> 6) + dy + dx * tp->vt + ((dy & 0x3F) << 10);
172 int limit = Y_ORIGIN;
173 int mousex = 0, mousey = 0;
176 for(n = 0; n < LINES; n++) {
177 xa[n] = (rand() % 32) - 16;
178 ya[n] = (rand() % 32) - 16;
179 xsa[n] = (rand() % 16) - 8;
180 ysa[n] = (rand() % 16) - 8;
196 Graph_text(-limit*2 + t++ % (limit*3), limit-15, gstr);
200 mousex = rand()%(limit/4);
201 mousey = rand()%(limit/4);
203 Graph_pix(mousex, mousey, k>>4 & 0x7, pixdef);
207 for(n = 1; n <= 8; n++)
208 Graph_vec(0, 0, ((k & 0x7F) << 3) + (n << 4), (k << 6) + (n << 8), vecdef);
212 for(n = 0; n < LINES; n++) {
217 xa[n] += xsa[n] % 10;
218 ya[n] += ysa[n] % 10;
223 Graph_plot((xa[0]%MAXV)-(MAXV>>1), (ya[0]%MAXV)-(MAXV>>1));
224 for(n = 1; n < LINES; n++)
225 Graph_line((xa[n]%MAXV)-(MAXV>>1),(ya[n]%MAXV)-(MAXV>>1));
226 Graph_line((xa[0]%MAXV)-(MAXV>>1), (ya[0]%MAXV)-(MAXV>>1));
248 Graph_pix(-limit + k%(limit*2), 2 + k%2, 0, pixdef2);
252 for(n = 0; n < 8; n++) {
253 Graph_vecarc(limit/2, limit/2, 20, 20, -((n << 10) + (k << 6)), 0x40, -(k<<7), vecdef2);
254 Graph_pixarc(-limit/2, -limit/2, 20, 20, (n << 10) + (k << 6), k<<4, pixdef2);
255 Graph_pixarc(-limit/2, -limit/2, 10, 10, -((n << 10) + (k << 6)), k<<4, pixdef);
260 Graph_arc(0,0,limit,20,-k<<5,0x2000/9,9,0);
263 if((++numx % 7) == 0)
265 if(numchr < '0' || numchr >
'9')
270 Graph_char(-limit+5 + t % (limit*2), t*t % (limit/3) - limit/2, numchr);
273 if(BITMAP_BASE != DISPLY_BASE)
284 Graph_setup(X_TILES, Y_TILES, X_ORIGIN, Y_ORIGIN, BITMAP_BASE);