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

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

int get_mode();
void set_mode(mode) integer;
void set_background(background) unsigned char background;
void set_pallette(pallette) unsigned char pallette;
void set_colors(background, pallette) unsigned char background, pallette;

Procedures called: intdos()
Include files:

This procedures are used to control the video mode in order to set up
for graphics. "get_mode()" can be used both to save and preserve
the mode so a program can undo any changes, and also, when there is
any doubt, to make sure that "set_mode()" worked.

#endif

#include "dos.h"

int get_mode()
{
union REGS reg;
reg.h.ah = 15;
reg.h.bh = 00;
reg.h.ch = 0;
reg.h.cl = 0;
int86(0x10, ®, ®);
return(reg.h.al);
}

void set_mode(mode) int mode;
{
union REGS reg;
reg.h.ah=0;
reg.h.al=mode;
int86(0x10,®,®);
}

void set_background(background) unsigned char background;
{
union REGS regs;
regs.h.ah=0x0b;
regs.h.bh=0;
regs.h.bl=background;
int86(0x10,®s,®s);
}

void set_pallette(pallette) unsigned char pallette;
{
union REGS regs;
regs.h.ah=0x0b;
regs.h.bh=1;
regs.h.bl=pallette;
int86(0x10,®s,®s);
}

void set_colors(background, pallette) char background, pallette;
{
union REGS regs;
regs.h.ah=0x0b;
regs.h.bh=0;
regs.h.bl=background;
int86(0x10,®s,®s);
regs.h.bh=1;
regs.h.bl=pallette;
int86(0x10,®s,®s);
}


  3 Responses to “Category : C Source Code
Archive   : RXGRAPH.ZIP
Filename : SETVIDEO.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/