directvideo是控制DOS是否直接操纵视频缓冲区的开关,在conio.h中声明,而只有在 DOS环境下才会起作用。而在Borland C++ for window 下是没有作用的。主要在古老的DOS开发中经常的会使用的,这几天在搞Borland C++ for DOS 开发手持设备中,用到感觉有点迷惑了,记录下来,以防备忘.
   在Borland C++(包括Turbo C)中,缺省为直接操纵视频缓冲区,这在HT系列掌上电脑上和仿真环境中会引起死机现象,必须在主程序开始时加上“directvideo=0;”来抑制直接写屏操作.
 

/* conio.h

Direct MSDOS console input/output.

Copyright (c) 1987, 1992 by Borland International
    All Rights Reserved.
*/

#if !defined(__CONIO_H)
#define __CONIO_H

#if !defined(___DEFS_H)
#include <_defs.h>
#endif

#if !defined(_Windows)

#define _NOCURSOR 0
#define _SOLIDCURSOR 1
#define _NORMALCURSOR 2

struct text_info {
    unsigned char winleft;
    unsigned char wintop;
    unsigned char winright;
    unsigned char winbottom;
    unsigned char attribute;
    unsigned char normattr;
    unsigned char currmode;
    unsigned char screenheight;
    unsigned char screenwidth;
    unsigned char curx;
    unsigned char cury;
};

enum text_modes { LASTMODE=-1, BW40=0, C40, BW80, C80, MONO=7, C4350=64 };

#if !defined(__COLORS)
#define __COLORS

enum COLORS {
    BLACK, /* dark colors */
    BLUE,
    GREEN,
    CYAN,
    RED,
    MAGENTA,
    BROWN,
    LIGHTGRAY,
    DARKGRAY, /* light colors */
    LIGHTBLUE,
    LIGHTGREEN,
    LIGHTCYAN,
    LIGHTRED,
    LIGHTMAGENTA,
    YELLOW,
    WHITE
};
#endif

#define BLINK 128 /* blink bit */
/*_cdecl 是C Declaration的缩写,表示C语言默认的函数调用方法:所有参数从右到左依次入栈,这些参数由调用者清除,称为手动清栈。被调用函数不需要求调用者传递多少参数,调用者传递过多或者过少的参数,甚至完全不同的参数都不会产生编译阶段的错误  C中不加说明默认函数为_cdecl调用方式 */
extern int _Cdecl directvideo; //这里定义了directvideo 其实值只能是0或1而已
extern int _Cdecl _wscroll;

#endif /* !_Windows */

#ifdef __cplusplus
extern "C" {
#endif

void _Cdecl clreol( void );
void _Cdecl clrscr( void );
void _Cdecl gotoxy( int __x, int __y );
int _Cdecl wherex( void );
int _Cdecl wherey( void );
int _Cdecl getch( void );
int _Cdecl getche( void );
int _Cdecl kbhit( void );
int _Cdecl putch( int __c );

#ifndef _PORT_DEFS
unsigned char _Cdecl inportb( unsigned __portid );
unsigned _Cdecl inport ( unsigned __portid );
int _Cdecl inp( unsigned __portid );
unsigned _Cdecl inpw( unsigned __portid );
void _Cdecl outportb( unsigned __portid, unsigned char __value );
void _Cdecl outport ( unsigned __portid, unsigned __value );
int _Cdecl outp( unsigned __portid, int __value );
unsigned _Cdecl outpw( unsigned __portid, unsigned __value );
#endif /* !_PORT_DEFS */

#if !defined(_Windows)

void _Cdecl delline( void );
int _Cdecl gettext( int __left, int __top,
                            int __right, int __bottom,
                            void *__destin);
void _Cdecl gettextinfo (struct text_info *__r );
void _Cdecl highvideo( void );
void _Cdecl insline( void );
void _Cdecl lowvideo( void );
int _Cdecl movetext( int __left, int __top,
                             int __right, int __bottom,
                             int __destleft, int __desttop );
void _Cdecl normvideo( void );
int _Cdecl puttext( int __left, int __top,
                            int __right, int __bottom,
                            void *__source );
void _Cdecl textattr( int __newattr );
void _Cdecl textbackground( int __newcolor );
void _Cdecl textcolor( int __newcolor );
void _Cdecl textmode( int __newmode );
void _Cdecl window( int __left, int __top, int __right, int __bottom);

void _Cdecl _setcursortype( int __cur_t );
char * _Cdecl cgets( char *__str );
int _Cdecl cprintf( const char *__format, ... );
int _Cdecl cputs( const char *__str );
int _Cdecl cscanf( const char *__format, ... );
char * _Cdecl getpass( const char *__prompt );
int _Cdecl ungetch( int __ch );

#endif /* !_Windows */

#ifndef _PORT_DEFS
#define _PORT_DEFS

/* These are in-line functions. These prototypes just clean up
       some syntax checks and code generation.
     */
unsigned char _Cdecl __inportb__ (unsigned __portid);
unsigned _Cdecl __inportw__ (unsigned __portid);
unsigned char _Cdecl __outportb__(unsigned __portid, unsigned char __value);
unsigned _Cdecl __outportw__(unsigned __portid, unsigned __value);

#define inportb(__portid) __inportb__(__portid)
#define outportb(__portid, __value) ((void) __outportb__(__portid, __value))
#define inport(__portid) __inportw__(__portid)
#define outport(__portid, __value) ((void) __outportw__(__portid, __value))

/* MSC-compatible macros for port I/O */
#define inp(__portid) __inportb__ (__portid)
#define outp(__portid, __value) __outportb__(__portid, (unsigned char)__value)
#define inpw(__portid) __inportw__ (__portid)
#define outpw(__portid, __value) __outportw__(__portid, __value)

#endif /* _PORT_DEFS */

#ifdef __cplusplus
}
#endif

#endif /* __CONIO_H */

Borland C++ 3.1 for DOS 中directvideo的问题相关推荐

  1. dos中for in后面执行多个命令的方法

    dos中for命令算是一个复杂的命令了,但是也能给我们实现一些复杂的操作 最近在写dos命令的时候有这样一个需求: 查找windows中的某个进程,并通过dos命令taskkill结束该进程: 本来思 ...

  2. dos中定义变量与引用变量以及四则运算

    在dos中使用set定义变量: set  a=8              (注意等号两边没有空格) 引用变量如: echo  %a%        将打印a的值 dos中要使用算术运算,需要使用 s ...

  3. Dos中通过Pause来阻止窗口运行就关闭

    在这篇文章里我们来看看pause在Dos中的应用 创建一个文件test.bar  ,复制一下代码: rem this is a program to show the charater of paus ...

  4. Dos中重定向与文件追加

    在Dos中可以通过">",来重定向输出的内容,通过">>"将输出的内容追加到文件中. 例如,执行以下命令: dir aaa.txt 这会将当前 ...

  5. 成功解决win10下dos中运行tensorboard --logdir=logs和调用events.out.tfevents一闪而过的问题

    成功解决win10下dos中运行tensorboard --logdir=logs和调用events.out.tfevents一闪而过的问题 目录 解决问题 解决思路 解决方法 解决问题 在dos中运 ...

  6. dos中特殊符号命令的应用

    DOS中其他特殊符号(批处理常用): @ \\隐藏命令的回显. ~ \\在for中表示使用增强的变量扩展: 在set中表示使用扩展环境变量指定位置的字符串: 在set/a中表示按位取反. % \\使用 ...

  7. DOS中切换盘符(直接CD不行)

    一般介绍DOS命令,切换工作目录都是用CD命令,但是我在win7下的DOS中使用CD D:\却一直无法转到D盘. 后来在网上查找,发现切换盘符直接输入盘符和冒号,如D:  回车便可进入D盘的根目录. ...

  8. 如何dos中查看当前MySQL版本信息?

    dos中MySQL安装服务成功--启动服务成功--登录MySQL成功后输入:select version();  如图: 转载于:https://www.cnblogs.com/yaojiankui/ ...

  9. DOS中的 及 用正则表达式中的什么替掉

    分享一下我老师大神的人工智能教程!零基础,通俗易懂!http://blog.csdn.net/jiangjunshow 也欢迎大家转载本篇文章.分享知识,造福人民,实现我们中华民族伟大复兴! DOS中 ...

最新文章

  1. 「Django」rest_framework学习系列-用户认证
  2. 【数学基础】校招算法工程师笔试题
  3. c# hash 泛型_C# 泛型Dictionary (Hashtable)
  4. 全球及中国硝基复合肥市场产销状况与未来运营前景分析报告2022版
  5. 【一雪前耻!】两种方法判断大小端模式
  6. Android 中文 API —— TextSwitcher
  7. 聊几个与赚钱相关的小事情
  8. 关于WebRTC发展的担忧和思考
  9. std::thread 不 join
  10. 查询显示注释_SQL的简单查询
  11. 关键词SEO相关搜索/下拉框/优化系统/按天扣费系统全开源
  12. Trustdata:《2018年Q1中国移动互联网行业发展分析报告》
  13. 计算机网络故障是指啥,网络故障管理
  14. 大数据Hadoop之——任务调度器Azkaban(Azkaban环境部署)
  15. 洛谷P3336 [ZJOI2013]话旧 题解
  16. 数据库的实例化操作——员工信息的查询——简单表查询(二)
  17. MySQL 8.0原理与实战一网打尽,甲骨文数据库专家硬刚5年之作
  18. 【Jquery-03】jq中的样式操作
  19. SpringBoot整合Shiro静态资源拦截配置
  20. 电子化时代到来,电子印章助力构建网络时代互信环境

热门文章

  1. 众多导航菜单UI素材一键即可获取
  2. Java switch版 减肥计划
  3. (二)win10环境下使用Hyper-V进行虚拟机创建
  4. 狂神说JavaWeb入门到实战笔记
  5. C语言程序设计有pjcj吗,C语言程序设计课程设计实习报告
  6. C++核心准则T.80:不要天真地模板化类继承
  7. sql语句最大值max
  8. 按钮背景过渡css3,使用CSS3点击按钮实现背景渐变动画的效果
  9. NO.20-SAP S4 HANA Cloud中的表单模板(3)
  10. web响应式布局与BootStrap框架