Category : C Source Code
Archive   : RXGRAPH.ZIP
Filename : DOT640.C

 
Output of file : DOT640.C contained in archive : RXGRAPH.ZIP
#if 0
DOT640.C

Procedures contained:

void put_dot_640 (row, col, color) int row, col; unsigned char color;
unsigned char get_dot_640 (row, col) int row, col;

Procedures called: None
Include files: None

These functions read and write the color values for individual pixels in
640 by 200 (high resolution) graphics mode on a CGA, using memory
mapped routines rather than DOS calls. Writes are done without waiting
for retrace, and in testing this did not appear to cause "snow".

CAUTION: No error checking is done. The value of color must be 0 or 1.

#endif

static char far *CGA_RAM=(char far *)(((long)0xb800)<<16);
#define SET_CELL cell=CGA_RAM+(row>>1)*80 + col/8 + 0x2000*(row%2)

void put_dot_640(row, col, color) int row, col; char color;
{
char far *cell;
SET_CELL;
col%=8;
if (color) *cell |= (color<<(7-col));
else *cell &= ~(1<<(7-col));
}

unsigned char get_dot_640(row, col) int row, col;
{
char far *cell;
SET_CELL;
col%=8;
return 1 & ((*cell) >> (7-col));
}


  3 Responses to “Category : C Source Code
Archive   : RXGRAPH.ZIP
Filename : DOT640.C

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/