* Write character 'ch', at (x,y) and * do it using the colour 'colour'. * */
| 955 | * |
| 956 | */ |
| 957 | static void |
| 958 | vga_WriteChar(uint32 chr, int col, int row, int colour) |
| 959 | { |
| 960 | int i; |
| 961 | int x, pixy; |
| 962 | |
| 963 | char __far *cp; |
| 964 | unsigned char fnt; |
| 965 | int actual_colour = vgacmap[colour]; |
| 966 | int bgcolor; |
| 967 | int vplane; |
| 968 | unsigned char bitmap[ROWS_PER_CELL]; |
| 969 | |
| 970 | /* if (chr < ' ') chr = ' '; */ /* assumes ASCII set */ |
| 971 | vga_GetBitmap(chr, bitmap); |
| 972 | |
| 973 | if (curframecolor != NO_COLOR) |
| 974 | bgcolor = vgacmap[curframecolor]; |
| 975 | else |
| 976 | bgcolor = BACKGROUND_VGA_COLOR; |
| 977 | |
| 978 | if (inversed) { |
| 979 | int tmpc = actual_colour; |
| 980 | actual_colour = bgcolor; |
| 981 | bgcolor = tmpc; |
| 982 | } |
| 983 | |
| 984 | x = min(col, (CO - 1)); /* min() used protection from callers */ |
| 985 | pixy = min(row, (LI - 1)) * 16; /* assumes 8 x 16 char set */ |
| 986 | vplane = ~actual_colour & ~bgcolor & 0xF; |
| 987 | if (vplane != 0) { |
| 988 | egawriteplane(vplane); |
| 989 | for (i = 0; i < MAX_ROWS_PER_CELL; ++i) { |
| 990 | cp = screentable[pixy + i] + x; |
| 991 | WRITE_ABSOLUTE(cp, (char) 0x00); |
| 992 | } |
| 993 | } |
| 994 | vplane = actual_colour & ~bgcolor & 0xF; |
| 995 | if (vplane != 0) { |
| 996 | egawriteplane(vplane); |
| 997 | for (i = 0; i < MAX_ROWS_PER_CELL; ++i) { |
| 998 | cp = screentable[pixy + i] + x; |
| 999 | fnt = bitmap[i]; |
| 1000 | WRITE_ABSOLUTE(cp, (char) fnt); |
| 1001 | } |
| 1002 | } |
| 1003 | vplane = ~actual_colour & bgcolor & 0xF; |
| 1004 | if (vplane != 0) { |
| 1005 | egawriteplane(vplane); |
| 1006 | for (i = 0; i < MAX_ROWS_PER_CELL; ++i) { |
| 1007 | cp = screentable[pixy + i] + x; |
| 1008 | fnt = ~bitmap[i]; |
| 1009 | WRITE_ABSOLUTE(cp, (char) fnt); |
| 1010 | } |
| 1011 | } |
| 1012 | vplane = actual_colour & bgcolor & 0xF; |
| 1013 | if (vplane != 0) { |
| 1014 | egawriteplane(vplane); |
no test coverage detected