7 static struct gpu_gvert triangle[] = {{0xff0000}, {0x00ff00}, {0x0000ff}};
9 static struct gte_svector svtri[] = {
10 {-0x1000, -0x800}, {0, 0x1000}, {0x1000, -0x800}
18 unsigned int frame = 0;
19 int16_t rotmat[9] = {0x1000, 0, 0, 0, 0x1000, 0, 0, 0, 0x1000};
20 int trans[3] = {160, 120, 0};
29 gpu_setmode(320, 264, 15, 50);
32 REG_GP0 = GPCMD(GP0_TEXPG) | TEXPG_DITHER;
35 rotmat[0] = rotmat[4] = COS(frame);
36 rotmat[1] = SIN(frame);
37 rotmat[3] = -SIN(frame);
40 //gte_loadtrans(trans);
42 gte_loadsvec0(svtri + i);
46 triangle[i].x = (resv[0] >> 6);
47 triangle[i].y = (resv[1] >> 6);
50 /* use previous frame yoffs as display area */
51 gpu_dispstart(0, yoffs);
53 /* set yoffs to the new back buffer */
54 yoffs = (frame++ & 1) ? 0 : 264;
56 gpu_cliprect(0, yoffs, 320, 264 + yoffs);
57 gpu_origin(160, 130 + yoffs);
59 gpu_fillrect(0, yoffs, 320, 264, 0x202020);
61 gpu_draw_gouraud(GP0_GTRI, triangle, 3);
63 for(i=0; i<8192; i++) {
64 asm volatile("nop; nop; nop; nop");