vgablank.c

来自「C语言库函数的源代码,是C语言学习参考的好文档。」· C语言 代码 · 共 40 行

C
40
字号
/* +++Date last modified: 05-Jul-1997 */

/*
**  Functions to blank and resore EGA/VGA screens
*/

#include <dos.h>
#include "pchwio.h"
#include "vgablank.h"

void blank_EVGA(void)
{
	disable();
	inp(0x3da);
	outp(0x3c0, 0);
	enable();
}

void restore_EVGA(void)
{
	disable();
	inp(0x3da);
	outp(0x3c0, 0x20);
	enable();
}

#ifdef TEST

#include "delay.h"      /* From SNIPPETS - use dos.h if your compiler's
                           standard library supports delay().           */
main()
{
      blank_EVGA();     /* Blank the screen...  */
      delay(1500);      /* ...delay 1.5 secs... */
      restore_EVGA();   /* ...& restore it      */
      return 0;
}

#endif /* TEST */

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?