www.delorie.com/djgpp/doc/libc/libc_672.html   search  
libc.a reference

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

Screen Variables


#include <go32.h>
#include <pc.h>

unsigned long ScreenPrimary;
unsigned long ScreenSecondary;
extern unsigned char ScreenAttrib;


The first two variables (actually, they are #define'd aliases to fields in the _go32_info_block structure see section _go32_info_block) allow access to the video memory of the primary and secondary screens as if they were arrays. To reference them, you must use dosmemget()/dosmemput() functions (dosmemget, see section dosmemput) or any one of the far pointer functions (see section _far*), as the video memory is not mapped into your default address space.

The variable ScreenAttrib holds the current attribute which is in use by the text screen writes. The attribute is constructed as follows:

bits 0-3 -- foreground color;

bits 4-6 -- background color;

bit 7 -- blink on (1) or off (0).


_farpokew(_dos_ds, ScreenPrimary, ( ((unsigned short) attr) << 8) + char ));


  webmaster   donations   bookstore     delorie software   privacy  
  Copyright 2004   by DJ Delorie     Updated Apr 2004