* This will verify the existence of a VGA adapter on the machine. * Video function call 0x1a returns 0x1a in AL if successful, and * returns the following values in BL for the active display: * * 0=no display, 1=MDA, 2=CGA, 4=EGA(color-monitor), * 5=EGA(mono-monitor), 6=PGA, 7=VGA(mono-monitor), 8=VGA(color-monitor), * 0xB=MCGA(mono-monitor), 0xC=MCGA(color-monitor), 0xFF=unknown) */
| 925 | * 0xB=MCGA(mono-monitor), 0xC=MCGA(color-monitor), 0xFF=unknown) |
| 926 | */ |
| 927 | int |
| 928 | vga_detect(void) |
| 929 | { |
| 930 | union REGS regs; |
| 931 | |
| 932 | regs.h.al = 0; |
| 933 | regs.h.ah = 0x1a; |
| 934 | (void) int86(VIDEO_BIOS, ®s, ®s); |
| 935 | /* |
| 936 | * debug |
| 937 | * |
| 938 | * printf("vga_detect returned al=%02x, bh=%02x, bl=%02x\n", |
| 939 | * (int)regs.h.al, (int)regs.h.bh, (int)regs.h.bl); |
| 940 | * getch(); |
| 941 | */ |
| 942 | if ((int) regs.h.al == 0x1a) { |
| 943 | if (((int) regs.h.bl == 8) || ((int) regs.h.bl == 7)) { |
| 944 | return 1; |
| 945 | } |
| 946 | } |
| 947 | return 0; |
| 948 | } |
| 949 | |
| 950 | extern int curframecolor; /* video.c */ |
| 951 |