129 static short gdev_type;
130 static short screen_width;
131 static short screen_height;
132 static unsigned short color_depth;
133 static unsigned int screen_mem_size;
134 static unsigned short frame_num;
135 static unsigned int fore_color;
136 static unsigned int back_color;
137 static unsigned char pen_mode;
138 static struct st_rect i_clip_rect;
139 static struct st_rect clip_rect;
152 static const char color_dep_str[5][20] = {
160 static const char graph_dev_type_str[5][20] = {
167 SYSERR_PRINT(
"Cannot find video info\n");
173 gdev_type = v_info->
type;
174 screen_width = v_info->
width;
175 screen_height = v_info->
height;
179 tkprintf(
"Graphics device \"%s\" Type : %s, Screen size %dx%d(%d), %s\n", dev->
name,
180 graph_dev_type_str[gdev_type],
189 i_clip_rect.
left = 0;
190 i_clip_rect.
right = screen_width;
191 i_clip_rect.
bottom = screen_height;
192 clip_rect = i_clip_rect;
256 clip_rect = i_clip_rect;
268 if(clip_rect.
left < 0) clip_rect.
left = 0;
269 if(clip_rect.
top < 0) clip_rect.
top = 0;
270 if(clip_rect.
right > screen_width) clip_rect.
right = screen_width;
271 if(clip_rect.
bottom > screen_height) clip_rect.
bottom = screen_height;
309 if(devname == 0)
goto err;
313 SYSERR_PRINT(
"Cannot open device \"%s\"\n", devname);
331 *width = screen_width;
332 *height = screen_height;
343 static void prepare_color(
void)
435 static void _draw_point(
short x,
short y)
438 (((
int)y) << 16) | (x & 0xffff), 0);
449 if(clip_rect.
top > y)
return;
450 if(clip_rect.
bottom <= y)
return;
451 if(clip_rect.
left > x)
return;
452 if(clip_rect.
right <= x)
return;
457 static void _draw_h_line(
short x,
short y,
short xe)
479 short xe = x + width;
481 if(clip_rect.
top > y)
return;
482 if(clip_rect.
bottom <= y)
return;
483 if(clip_rect.
right <= x)
return;
484 if(clip_rect.
left > x) x = clip_rect.
left;
485 if(clip_rect.
right < xe) xe = clip_rect.
right;
488 _draw_h_line(x, y, xe);
491 static void _draw_v_line(
short x,
short y,
short ye)
513 short ye = y + height;
515 if(clip_rect.
left > x)
return;
516 if(clip_rect.
right <= x)
return;
517 if(clip_rect.
bottom <= y)
return;
518 if(clip_rect.
top > y) y = clip_rect.
top;
521 _draw_v_line(x, y, ye);
529 static short calc_seq_code(
short x,
short y)
534 if(x < clip_rect.
left) code += LEFT;
535 if(x >= clip_rect.
right) code += RIGHT;
536 if(y < clip_rect.
top) code += TOP;
537 if(y >= clip_rect.
bottom) code += BOTTOM;
542 static short calc_clipped_point(
short code,
549 if((code & LEFT) != 0) {
550 cy = (y1 - y0) * (clip_rect.
left - x0) / (x1 - x0) + y0;
551 if((cy >= clip_rect.
top) && (cy <= clip_rect.
bottom-1)) {
558 if((code & RIGHT) != 0) {
559 cy = (y1 - y0) * (clip_rect.
right-1 - x0) / (x1 - x0) + y0;
560 if((cy >= clip_rect.
top) && (cy <= clip_rect.
bottom-1)) {
561 *x = clip_rect.
right-1;
567 if((code & TOP) != 0) {
568 cx = (x1 - x0) * (clip_rect.
top - y0) / (y1 - y0) + x0;
569 if((cx >= clip_rect.
left) && (cx <= clip_rect.
right-1)) {
576 if((code & BOTTOM) != 0) {
577 cx = (x1 - x0) * (clip_rect.
bottom-1 - y0) / (y1 - y0) + x0;
578 if((cx >= clip_rect.
left) && (cx <= clip_rect.
right-1)) {
588 static short clipping(
short *x0,
short *y0,
short *x1,
short *y1)
592 code0 = calc_seq_code(*x0, *y0);
593 code1 = calc_seq_code(*x1, *y1);
595 if((code0 == 0) && (code1 == 0)) {
599 if((code0 & code1) != 0) {
604 if(calc_clipped_point(code0, *x0, *y0, *x1, *y1, x0, y0) < 0) {
610 if(calc_clipped_point(code1, *x0, *y0, *x1, *y1, x1, y1) < 0) {
618 static void line(
short x0,
short y0,
short x1,
short y1)
623 sx = (x1 > x0) ? 1 : -1;
624 dx = (x1 > x0) ? x1 - x0 : x0 - x1;
625 sy = (y1 > y0) ? 1 : -1;
626 dy = (y1 > y0) ? y1 - y0 : y0 - y1;
633 for(i=0; i<=dx; i++) {
644 for(i=0; i<=dy; i++) {
666 if((x == xe) && (y == ye)) {
682 if(clipping(&x, &y, &xe, &ye) < 0) {
705 if((clip_rect.
top <= rect->
top) &&
712 if((clip_rect.
left <= rect->
left) &&
716 _draw_v_line(drect.
left, drect.
top+tw,
735 _draw_v_line(drect.
right-1, drect.
top+tw,
750 short l_w = rect->
right - rect->
left - (r * 2);
751 short l_h = rect->
bottom - rect->
top - (r * 2);
766 if((clip_rect.
top <= rect->
top) &&
775 if((clip_rect.
left <= rect->
left) &&
799 static void _draw_fill_rect(
struct st_rect *rect)
812 (
unsigned int)((rect->
right - rect->
left) *
828 _draw_fill_rect(&drect);
842 short l_w = rect->
right - rect->
left - (r * 2);
843 short l_h = rect->
bottom - rect->
top - (r * 2);
878 and_rect(&drect, &rrect, &clip_rect);
881 _draw_fill_rect(&drect);
885 y0 = rect->
bottom - r - 1;
902 static void draw_bits(
short x,
short y,
short width,
short height,
903 short offset,
unsigned char *data,
short dw)
908 #ifdef BITS_WRITE_WORD 913 DTFPRINTF(0x01,
"\n");
914 DTPRINTF(0x01,
"x=%d y=%d\n", x, y);
915 DTPRINTF(0x01,
"w=%d h=%d o=%d dw=%d\n", width, height, offset, dw);
916 DTPRINTF(0x01,
"data=%p\n", data);
920 rect.
right = x + width - 1;
921 rect.
bottom = y + height - 1;
925 for(j=0; j<height; j++) {
926 dp = data + (dw * j) + (offset/8);
927 DTPRINTF(0x02,
"dp=%p\n", dp);
928 #ifdef BITS_WRITE_WORD 929 pat = (0x80 >> (offset & 7));
930 for(i=0; i<width; i++) {
955 pat = (0x80 >> (offset & 7));
956 for(i=0; i<width; i++) {
957 if((*dp & pat) != 0) {
959 (((
int)(y + j)) << 16) | ((x + i) & 0xffff), 0);
975 static void draw_enlarged_bits(
short x,
short y,
976 short width,
short height,
977 short offset,
unsigned char *data,
short dw,
978 int rate,
short dox,
short doy)
981 int i, j, n, m = doy;
982 unsigned char pat, *dp;
984 DTFPRINTF(0x01,
"\n");
985 DTPRINTF(0x01,
"x=%d y=%d\n", x, y);
986 DTPRINTF(0x01,
"w=%d h=%d o=%d dw=%d\n", width, height, offset, dw);
987 DTPRINTF(0x01,
"data=%p\n", data);
988 DTPRINTF(0x01,
"dox=%d doy=%d\n", dox, doy);
992 rect.
right = x + width - 1;
993 rect.
bottom = y + height - 1;
997 for(j=0; j<height; j++) {
998 pat = (0x80 >> (offset & 7));
999 dp = data + (dw * ((j+m)/rate));
1002 for(i=0; i<width; i++) {
1004 if((*dp & pat) != 0) {
1010 if((*dp & pat) != 0) {
1042 unsigned char *data,
short dw)
1049 wrect.
right = px + width;
1050 wrect.
bottom = py + height;
1052 and_rect(&drect, &wrect, &clip_rect);
1056 if((clip_rect.
top <= wrect.
top) &&
1059 data += (clip_rect.
top - wrect.
top) * dw;
1062 if((clip_rect.
left <= wrect.
left) &&
1065 data += (clip_rect.
left-wrect.
left)/8;
1066 offset = (clip_rect.
left - wrect.
left) & 7;
1068 DTPRINTF(0x02,
"data = %p\n", data);
1069 draw_bits(drect.
left, drect.
top,
1087 short width,
short height,
1088 unsigned char *data,
short dw,
1093 short dox = 0, doy = 0;
1101 wrect.
right = px + width * rate;
1102 wrect.
bottom = py + height * rate;
1104 and_rect(&drect, &wrect, &clip_rect);
1106 DTPRINTF(0x01,
"CLIP %d %d %d %d\n", clip_rect.
left, clip_rect.
top, clip_rect.
right, clip_rect.
bottom);
1107 DTPRINTF(0x01,
"WRECT %d %d %d %d\n", wrect.
left, wrect.
top, wrect.
right, wrect.
bottom);
1108 DTPRINTF(0x01,
"DRECT %d %d %d %d\n", drect.
left, drect.
top, drect.
right, drect.
bottom);
1115 DTPRINTF(0x02,
"V no change\n");
1117 data += ((clip_rect.
top - wrect.
top)/rate) * dw;
1118 doy = (clip_rect.
top - py) % rate;
1123 DTPRINTF(0x02,
"H no change\n");
1125 data += (clip_rect.
left-wrect.
left)/rate/8;
1126 offset = (clip_rect.
left - wrect.
left)/rate & 7;
1127 dox = (clip_rect.
left - px) % rate;
1129 DTPRINTF(0x02,
"data = %p\n", data);
1131 draw_enlarged_bits(drect.
left, drect.
top,
1149 (bitmap->
width + 7)/8);
1163 (bitmap->
width + 7)/8, rate);
1285 int x, x1, y, y1, r;
1303 if((r -= y++*2+1)<=0) {
1320 if((r -= y++*2+1)<=0) {
1337 int x, x1, y, y1, r;
1352 if((r -= y++*2+1)<=0) {
1366 if((r -= y++*2+1)<=0) {
1380 void scroll_screen(
short x,
short y)
1446 #define TOP_MAX SHRT_MAX 1447 #define LEFT_MAX SHRT_MAX 1448 #define RIGHT_MIN SHRT_MIN 1449 #define BOTTOM_MIN SHRT_MIN 1451 static short region_pos[2][GSC_GRAPHICS_DISPLAY_HEIGHT];
1454 static void set_region_pos(
short x0,
short y0,
short x1,
short y1,
int lr)
1457 short dx,dy,sx,sy,i;
1459 sx = (x1 > x0) ? 1 : -1;
1460 dx = (x1 > x0) ? x1 - x0 : x0 - x1;
1461 sy = (y1 > y0) ? 1 : -1;
1462 dy = (y1 > y0) ? y1 - y0 : y0 - y1;
1469 for(i=0; i<=dx; i++) {
1470 if((clip_rect.
top <= y) && (y < clip_rect.
bottom)) {
1471 region_pos[lr][y] = x;
1473 DTPRINTF(0x02,
"%d [L] %d, %d\n", i, x, y);
1483 for(i=0; i<=dy; i++) {
1484 if((clip_rect.
top <= y) && (y < clip_rect.
bottom)) {
1485 region_pos[lr][y] = x;
1487 DTPRINTF(0x02,
"%d [R] %d, %d\n", i, x, y);
1515 short xt = 0, yt = TOP_MAX;
1516 short xl = LEFT_MAX, yl = 0;
1517 short xr = RIGHT_MIN, yr = 0;
1518 short xb = 0, yb = BOTTOM_MIN;
1525 if(yt > y0) { yt = y0; xt = x0; top_pn = 0; }
1526 if(yt > y1) { yt = y1; xt = x1; top_pn = 1; }
1527 if(yt > y2) { yt = y2; xt = x2; top_pn = 2; }
1528 if(yt > y3) { yt = y3; xt = x3; top_pn = 3; }
1530 if((top_pn != 0) && (yb < y0)) { yb = y0; xb = x0; bottom_pn = 0; }
1531 if((top_pn != 1) && (yb < y1)) { yb = y1; xb = x1; bottom_pn = 1; }
1532 if((top_pn != 2) && (yb < y2)) { yb = y2; xb = x2; bottom_pn = 2; }
1533 if((top_pn != 3) && (yb < y3)) { yb = y3; xb = x3; bottom_pn = 3; }
1535 if((top_pn != 0) && (bottom_pn != 0) && (xl > x0)) { xl = x0; yl = y0; left_pn = 0; }
1536 if((top_pn != 1) && (bottom_pn != 1) && (xl > x1)) { xl = x1; yl = y1; left_pn = 1; }
1537 if((top_pn != 2) && (bottom_pn != 2) && (xl > x2)) { xl = x2; yl = y2; left_pn = 2; }
1538 if((top_pn != 2) && (bottom_pn != 3) && (xl > x3)) { xl = x3; yl = y3; left_pn = 3; }
1540 if((top_pn != 0) && (bottom_pn != 0) && (left_pn != 0) && (xr < x0)) { xr = x0; yr = y0; }
1541 if((top_pn != 1) && (bottom_pn != 1) && (left_pn != 1) && (xr < x1)) { xr = x1; yr = y1; }
1542 if((top_pn != 2) && (bottom_pn != 2) && (left_pn != 2) && (xr < x2)) { xr = x2; yr = y2; }
1543 if((top_pn != 3) && (bottom_pn != 3) && (left_pn != 3) && (xr < x3)) { xr = x3; yr = y3; }
1546 DTPRINTF(0x02,
"XT = %d, YT = %d\n", xt, yt);
1547 DTPRINTF(0x02,
"XL = %d, YL = %d\n", xl, yl);
1548 DTPRINTF(0x02,
"XR = %d, YR = %d\n", xr, yr);
1549 DTPRINTF(0x02,
"XB = %d, YB = %d\n", xb, yb);
1561 DTPRINTF(0x02,
"XT = %d, YT = %d\n", xt, yt);
1562 DTPRINTF(0x02,
"XL = %d, YL = %d\n", xl, yl);
1563 DTPRINTF(0x02,
"XR = %d, YR = %d\n", xr, yr);
1564 DTPRINTF(0x02,
"XB = %d, YB = %d\n", xb, yb);
1576 DTPRINTF(0x02,
"XT = %d, YT = %d\n", xt, yt);
1577 DTPRINTF(0x02,
"XL = %d, YL = %d\n", xl, yl);
1578 DTPRINTF(0x02,
"XR = %d, YR = %d\n", xr, yr);
1579 DTPRINTF(0x02,
"XB = %d, YB = %d\n", xb, yb);
1591 DTPRINTF(0x02,
"XT = %d, YT = %d\n", xt, yt);
1592 DTPRINTF(0x02,
"XL = %d, YL = %d\n", xl, yl);
1593 DTPRINTF(0x02,
"XR = %d, YR = %d\n", xr, yr);
1594 DTPRINTF(0x02,
"XB = %d, YB = %d\n", xb, yb);
1606 DTPRINTF(0x02,
"XT = %d, YT = %d\n", xt, yt);
1607 DTPRINTF(0x02,
"XL = %d, YL = %d\n", xl, yl);
1608 DTPRINTF(0x02,
"XR = %d, YR = %d\n", xr, yr);
1609 DTPRINTF(0x02,
"XB = %d, YB = %d\n", xb, yb);
1621 DTPRINTF(0x02,
"T : %d, B : %d\n", top_pn, bottom_pn);
1622 DTPRINTF(0x02,
"L : %d\n", left_pn);
1624 DTPRINTF(0x02,
"XT = %d, YT = %d\n", xt, yt);
1625 DTPRINTF(0x02,
"XL = %d, YL = %d\n", xl, yl);
1626 DTPRINTF(0x02,
"XR = %d, YR = %d\n", xr, yr);
1627 DTPRINTF(0x02,
"XB = %d, YB = %d\n", xb, yb);
1638 set_region_pos(xt, yt, xl, yl, 1);
1639 set_region_pos(xt, yt, xb, yb, 0);
1640 set_region_pos(xl, yl, xr, yr, 1);
1641 set_region_pos(xr, yr, xb, yb, 1);
1643 set_region_pos(xt, yt, xl, yl, 0);
1644 set_region_pos(xt, yt, xr, yr, 1);
1645 set_region_pos(xl, yl, xb, yb, 0);
1646 set_region_pos(xr, yr, xb, yb, 1);
1649 for(i=yt; i<yb; i++) {
1650 if(region_pos[0][i] > region_pos[1][i]) {
1651 draw_h_line(region_pos[1][i], i, region_pos[0][i] - region_pos[1][i]);
1653 draw_h_line(region_pos[0][i], i, region_pos[1][i] - region_pos[0][i]);
1659 static void set_arc(
short x,
short y,
short r,
char q,
unsigned char lr)
1672 if((0 <= (y-py)) && ((y-py) < GSC_GRAPHICS_DISPLAY_HEIGHT)) {
1673 region_pos[lr][y - py] = x + px;
1675 if((0 <= (y-px)) && ((y-px) < GSC_GRAPHICS_DISPLAY_HEIGHT)) {
1676 region_pos[lr][y - px] = x + py;
1683 if((0 <= (y-py)) && ((y-py) < GSC_GRAPHICS_DISPLAY_HEIGHT)) {
1684 region_pos[lr][y - py] = x - px;
1686 if((0 <= (y-px)) && ((y-px) < GSC_GRAPHICS_DISPLAY_HEIGHT)) {
1687 region_pos[lr][y - px] = x - py;
1694 if((0 <= (y+py)) && ((y+py) < GSC_GRAPHICS_DISPLAY_HEIGHT)) {
1695 region_pos[lr][y + py] = x - px;
1697 if((0 <= (y+px)) && ((y+px) < GSC_GRAPHICS_DISPLAY_HEIGHT)) {
1698 region_pos[lr][y + px] = x - py;
1705 if((0 <= (y+py)) && ((y+py) < GSC_GRAPHICS_DISPLAY_HEIGHT)) {
1706 region_pos[lr][y + py] = x + px;
1708 if((0 <= (y+px)) && ((y+px) < GSC_GRAPHICS_DISPLAY_HEIGHT)) {
1709 region_pos[lr][y + px] = x + py;
1742 set_arc(x, y, er, q, 1);
1743 set_arc(x, y, ir, q, 0);
1747 if(GSC_GRAPHICS_DISPLAY_HEIGHT <= bt) bt = (GSC_GRAPHICS_DISPLAY_HEIGHT - 1);
1748 for(i=tp; i<bt; i++) {
1749 region_pos[0][i] = x;
1751 for(i=(y-er); i<y; i++) {
1752 draw_h_line(region_pos[0][i], i, region_pos[1][i] - region_pos[0][i]);
1757 set_arc(x, y, er, q, 0);
1758 set_arc(x, y, ir, q, 1);
1762 if(GSC_GRAPHICS_DISPLAY_HEIGHT <= bt) bt = (GSC_GRAPHICS_DISPLAY_HEIGHT - 1);
1763 for(i=tp; i<bt; i++) {
1764 region_pos[1][i] = x;
1766 for(i=(y-er); i<y; i++) {
1767 draw_h_line(region_pos[0][i], i, region_pos[1][i] - region_pos[0][i]);
1772 set_arc(x, y, er, q, 0);
1773 set_arc(x, y, ir, q, 1);
1777 if(GSC_GRAPHICS_DISPLAY_HEIGHT <= bt) bt = (GSC_GRAPHICS_DISPLAY_HEIGHT - 1);
1778 for(i=tp; i<bt; i++) {
1779 region_pos[1][i] = x;
1781 for(i=y; i<(y+er); i++) {
1782 draw_h_line(region_pos[0][i], i, region_pos[1][i] - region_pos[0][i]);
1787 set_arc(x, y, er, q, 1);
1788 set_arc(x, y, ir, q, 0);
1792 if(GSC_GRAPHICS_DISPLAY_HEIGHT <= bt) bt = (GSC_GRAPHICS_DISPLAY_HEIGHT - 1);
1793 for(i=tp; i<bt; i++) {
1794 region_pos[0][i] = x;
1796 for(i=y; i<(y+er); i++) {
1797 draw_h_line(region_pos[0][i], i, region_pos[1][i] - region_pos[0][i]);
1804 static void _draw_data(
short x,
short y,
short width,
short height,
1805 short offset,
void *data,
short dw)
1811 DTFPRINTF(0x01,
"\n");
1812 DTPRINTF(0x01,
"x=%d y=%d\n", x, y);
1813 DTPRINTF(0x01,
"w=%d h=%d o=%d dw=%d\n", width, height, offset, dw);
1814 DTPRINTF(0x01,
"data=%p\n", data);
1818 rect.
right = x + width - 1;
1819 rect.
bottom = y + height - 1;
1823 for(j=0; j<height; j++) {
1825 DTPRINTF(0x02,
"dp=%p\n", dp);
1826 write_device(fb_dev, (
unsigned char *)dp, width *
sizeof(*dp));
1840 void draw_image(
short px,
short py,
short width,
short height,
void *image,
short dw)
1847 wrect.
right = px + width;
1848 wrect.
bottom = py + height;
1850 and_rect(&drect, &wrect, &clip_rect);
1854 if((clip_rect.
top <= wrect.
top) &&
1857 image += (clip_rect.
top - wrect.
top) * width;
1858 offset = (clip_rect.
left - wrect.
left);
1861 if((clip_rect.
left <= wrect.
left) &&
1864 image += (clip_rect.
left-wrect.
left);
1866 DTPRINTF(0x02,
"image = %p\n", image);
1868 _draw_data(drect.
left, drect.
top,
1874 static unsigned int graph_copy_buf[GSC_GRAPHICS_DISPLAY_WIDTH];
1888 short pos_x = rect->
top;
1904 dwidth = (tmp.
right - tmp.
left) * color_depth;
1911 for(i=0; i<height; i++) {
1912 crect.
top = pos_x - pixel + i;
1915 DTPRINTF(0x01,
"- copy from rect(%d, %d, %d, %d)\n", crect.
left, crect.
top, crect.
right, crect.
bottom);
1917 read_device(fb_dev, (
unsigned char *)graph_copy_buf, dwidth);
1919 crect.top = pos_x + i;
1920 crect.bottom = crect.top + 1;
1922 DTPRINTF(0x01,
"- copy to rect(%d, %d, %d, %d)\n", crect.left, crect.top, crect.right, crect.bottom);
1924 write_device(fb_dev, (
unsigned char *)graph_copy_buf, dwidth);
1928 for(i=height; i>=0; i--) {
1929 crect.
top = pos_x + i;
1932 DTPRINTF(0x01,
"+ copy from rect(%d, %d, %d, %d)\n", crect.
left, crect.
top, crect.
right, crect.
bottom);
1934 read_device(fb_dev, (
unsigned char *)graph_copy_buf, dwidth);
1936 crect.top = pos_x + pixel + i;
1937 crect.bottom = crect.top + 1;
1939 DTPRINTF(0x01,
"+ copy to rect(%d, %d, %d, %d)\n", crect.left, crect.top, crect.right, crect.bottom);
1941 write_device(fb_dev, (
unsigned char *)graph_copy_buf, dwidth);
struct st_device * dev
ビデオデバイスドライバ
void draw_fill_box(struct st_box *box)
塗りつぶした四角を描画する
void set_backcolor(unsigned int color)
描画の背景色を設定する
#define IOCMD_VIDEO_NOLOCK_WRITE_WORD
2バイト表示データを転送する(MUTEXロックは無視)
#define IOCMD_VIDEO_GETDRAWFRAME
描画フレーム番号を取得する
unsigned short height
表示高さドット数
#define IOCMD_VIDEO_CLEAR
全画面初期化
void draw_enlarged_bitdata(short px, short py, short width, short height, unsigned char *data, short dw, int rate)
拡大したビットデータを描画する
void draw_circle(short x0, short y0, short r)
円を描画する
#define GRP_DRAWMODE_NORMAL
Draw the foreground with fore color. Draw the background with back color.
画像表示デバイスドライバ ioctl 用マクロ定義
#define IOCMD_VIDEO_SETDRAWFRAME
描画フレーム番号を設定する
#define IOCMD_VIDEO_UNLOCK_DEVICE
デバイスをMUTEXアンロックする
void set_forecolor(unsigned int color)
描画の色を設定する
int get_display_frame(void)
表示しているフレームバッファ番号を取得する
void draw_vertex4_region(short x0, short y0, short x1, short y1, short x2, short y2, short x3, short y3)
塗りつぶした4頂点の領域を描画する
#define IOCMD_VIDEO_SETRECT
描画データ転送範囲を矩形で設定する
struct st_device * open_device(char *name)
デバイスをオープンする
#define IOCMD_VIDEO_REPEAT_DATA
指定ドット数分フォアカラーで描画する
int get_frame_num(void)
フレームバッファ数を取得する
int write_device(struct st_device *dev, const void *buf, unsigned int count)
デバイスにデータを書き込む
int read_device(struct st_device *dev, void *buf, unsigned int count)
デバイスよりデータを読み出す
void set_clip_rect(struct st_rect *rect)
クリッピングエリアを矩形で指定する
#define IOCMD_VIDEO_DRAW_PIXEL
フォアカラーで1ドット描画する
void draw_quarter_circle(short x0, short y0, short r, char q)
1/4の円を描画する
void clear_clip_rect(void)
クリッピングエリアを無効にする
#define IOCMD_VIDEO_DRAW_BITS
ビットパターンを描画する
int get_draw_frame(void)
描画するフレームバッファ番号を取得する
#define IOCMD_VIDEO_GETDISPFRAME
表示フレーム番号を取得する
#define GRP_DRAWMODE_REVERSE
Draw the foreground with back color. Draw the background with fore color.
unsigned char * data
ビットマップデータポインタ
void draw_fill_ellipse(short xc, short yc, short rx, short ry)
塗りつぶした楕円を描画する
void draw_round_rect(struct st_rect *rect, short r)
角の丸い矩形を描画する
int tkprintf(const char *fmt,...)
非タスクコンテキスト実行用メッセージ出力
unsigned short type
ビデオデバイスタイプ(VIDEOTYPE_*)
#define IOCMD_VIDEO_SCROLL
表示位置を変更(スクロール)する
void draw_point(short x, short y)
点を描画する
unsigned char get_draw_mode(void)
描画モードを取得する
void draw_enlarged_bitmap(short px, short py, struct st_bitmap *bitmap, int rate)
拡大したビットマップデータを描画する
int set_display_frame(int fnum)
表示するフレームバッファ番号を設定する
int init_graphics(char *devname)
グラフィックスライブラリを初期化する
void draw_v_line(short x, short y, short height)
垂直線を描画する
void set_clip_box(struct st_box *box)
クリッピングエリアを四角形で指定する
void draw_sector(short x, short y, short er, short ir, char q)
扇形を描画する
void draw_round_fill_box(struct st_box *box, short r)
塗りつぶした角の丸い四角を描画する
int set_draw_frame(int fnum)
描画するフレームバッファ番号を設定する
void clear_screen(void)
画面を全て0で描画する
unsigned short width
表示幅ドット数
void get_screen_info(short *width, short *height)
スクリーンのサイズ情報を取得する
void draw_fill_circle(short x0, short y0, short r)
塗りつぶした円を描画する
void draw_ellipse(short xc, short yc, short rx, short ry)
楕円を描画する
void draw_bitmap(short px, short py, struct st_bitmap *bitmap)
ビットマップデータを描画する
void draw_line(short x, short y, short xe, short ye)
直線を描画する
void scroll_rect_v(struct st_rect *rect, short pixel)
矩形範囲を縦方向にスクロールする
void draw_round_fill_rect(struct st_rect *rect, short r)
角の丸い塗りつぶした矩形を描画する
#define IOCMD_VIDEO_LOCK_DEVICE
デバイスをMUTEXロックする
int register_graphics_dev(struct st_device *dev)
グラフィックライブラリにデバイスを登録する
void box2rect(struct st_rect *rect, struct st_box *box)
box -> rect 変換
void draw_image(short px, short py, short width, short height, void *image, short dw)
イメージデータを描画する
unsigned short frame_num
表示可能フレーム数
#define IOCMD_VIDEO_SET_BACKCOLOR
バックカラーを設定する
void and_rect(struct st_rect *a, struct st_rect *s1, struct st_rect *s2)
2つの矩形のアンドを求める
short empty_rect(struct st_rect *r)
矩形が0か調べる
unsigned int mem_size
フレームバッファメモリサイズ
#define IOCMD_VIDEO_SETDISPFRAME
表示フレーム番号を設定する
void draw_round_box(struct st_box *box, short r)
角の丸い四角を描画する
void draw_h_line(short x, short y, short width)
水平線を描画する
void draw_rect(struct st_rect *rect)
矩形を描画する
#define GRP_DRAWMODE_FOREONLY
Draw the foreground with back color. No draw the background.
void get_clip_rect(struct st_rect *rect)
クリッピングエリアを矩形で取得する
unsigned int get_forecolor(void)
描画の色を取得する
#define IOCMD_VIDEO_WRITE_WORD
2バイト表示データを転送する(未使用)
int ioctl_device(struct st_device *dev, unsigned int com, unsigned int arg, void *param)
デバイスを制御する
char name[MAX_DEVNAMELRN]
デバイス名文字列
void draw_bitdata(short px, short py, short width, short height, unsigned char *data, short dw)
ビットデータを描画する
void draw_fill_rect(struct st_rect *rect)
塗りつぶした矩形を描画する
#define IOCMD_VIDEO_SET_FORECOLOR
フォアカラーを設定する
void draw_box(struct st_box *box)
四角を描画する
unsigned short PIXEL_DATA
$gsc グラフィックデバイスは24ビットカラー
unsigned int get_backcolor(void)
描画の背景色を取得する
unsigned short color_depth
色深度(VCOLORDEP_*)
void set_draw_mode(unsigned char mode)
描画モードを設定する