* Initialize the VGA palette with the desired colours. This * must be a series of 48 bytes for use with a card in * 16 colour mode at 640 x 480. * */
| 1138 | * |
| 1139 | */ |
| 1140 | static void |
| 1141 | vga_SetPalette(const struct Pixel *p) |
| 1142 | { |
| 1143 | union REGS regs; |
| 1144 | int i; |
| 1145 | |
| 1146 | outportb(0x3c6, 0xff); |
| 1147 | for (i = 0; i < COLORDEPTH; ++i) { |
| 1148 | struct Pixel color = (i == 13) ? p[16] : p[i]; |
| 1149 | outportb(0x3c8, i); |
| 1150 | outportb(0x3c9, color.r >> 2); |
| 1151 | outportb(0x3c9, color.g >> 2); |
| 1152 | outportb(0x3c9, color.b >> 2); |
| 1153 | } |
| 1154 | regs.x.bx = 0x0000; |
| 1155 | for (i = 0; i < COLORDEPTH; ++i) { |
| 1156 | regs.x.ax = 0x1000; |
| 1157 | (void) int86(VIDEO_BIOS, ®s, ®s); |
| 1158 | regs.x.bx += 0x0101; |
| 1159 | } |
| 1160 | } |
| 1161 | |
| 1162 | void |
| 1163 | vga_hide_cursor(void) |