MCPcopy Create free account
hub / github.com/NetHack/NetHack / vga_SwitchMode

Function vga_SwitchMode

sys/msdos/vidvga.c:833–853  ·  view source on GitHub ↗

* Switches modes of the video card. * * If mode == MODETEXT (0x03), then the card is placed into text * mode. If mode == 640x480, then the card is placed into vga * mode (video mode 0x12). No other modes are currently supported. * */

Source from the content-addressed store, hash-verified

831 *
832 */
833static void
834vga_SwitchMode(unsigned int mode)
835{
836 union REGS regs;
837
838 if ((mode == MODE640x480) || (mode == MODETEXT)) {
839 if (iflags.usevga && (mode == MODE640x480)) {
840 iflags.grmode = 1;
841 } else {
842 iflags.grmode = 0;
843 }
844 regs.x.ax = mode;
845 (void) int86(VIDEO_BIOS, &regs, &regs);
846 } else {
847 iflags.grmode = 0; /* force text mode for error msg */
848 regs.x.ax = MODETEXT;
849 (void) int86(VIDEO_BIOS, &regs, &regs);
850 g_attribute = attrib_text_normal;
851 impossible("vga_SwitchMode: Bad video mode requested 0x%X", mode);
852 }
853}
854
855/*
856 * This allows grouping of several tasks to be done when

Callers 3

vga_term_end_screenFunction · 0.85
vga_InitFunction · 0.85
vga_FinishFunction · 0.85

Calls 1

impossibleFunction · 0.50

Tested by

no test coverage detected