6 REG_GP1 = 0; /* GPCMD(GP1_RESET) */
9 void gpu_setmode(int xsz, int ysz, int bpp, int rate)
11 unsigned int x1, y0, y1;
12 unsigned int mode = (ysz >= 480) ? DISP_V480 | DISP_ILACE : 0;
31 if(bpp >= 24) mode |= DISP_24BPP;
32 if(rate == 50) mode |= DISP_PAL;
34 REG_GP1 = GPCMD(GP1_DISPMODE) | mode;
36 /* also set display ranges */
38 REG_GP1 = GPCMD(GP1_HDISP) | 0x260 | (x1 << 12);
46 REG_GP1 = GPCMD(GP1_VDISP) | y0 | (y1 << 10);
49 void gpu_display(int en)
51 REG_GP1 = GPCMD(GP1_DISPEN) | (en ? 0 : 1);
54 void gpu_cliprect(int x, int y, int w, int h)
56 REG_GP0 = GPCMD(GP0_CLIP_TL) | x | (y << 10);
57 REG_GP0 = GPCMD(GP0_CLIP_BR) | (w - 1) | ((h - 1) << 10);
60 void gpu_origin(int x, int y)
62 REG_GP0 = GPCMD(GP0_ORIGIN) | x | (y << 11);
65 /* ---- drawing ---- */
67 void gpu_fillrect(int x, int y, int w, int h, unsigned int col)
69 REG_GP0 = GPCMD(GP0_FILLRECT) | col;
70 REG_GP0 = x | (y << 16);
71 REG_GP0 = w | (h << 16);
74 void gpu_draw_flat(int cmd, uint32_t color, struct gpu_vert *data, int vcount)
76 REG_GP0 = GPCMD(cmd) | color;
78 REG_GP0 = *(uint32_t*)data++;
82 void gpu_draw_gouraud(int cmd, struct gpu_gvert *data, int vcount)
84 REG_GP0 = GPCMD(cmd) | data->color;
85 REG_GP0 = *(uint32_t*)&data->x;
89 REG_GP0 = data->color;
90 REG_GP0 = *(uint32_t*)&data->x;