home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Monster Media 1994 #1
/
monster.zip
/
monster
/
PROG_C
/
GUILIB.ZIP
/
DISPFUNC.C
< prev
next >
Wrap
C/C++ Source or Header
|
1992-11-27
|
3KB
|
108 lines
#include "menu.h"
#include "dos.h"
#include "graphics.h"
int font_width;
int font_height;
int gr_scr_xsize;
int gr_scr_ysize;
int txt_scr_xsize;
int txt_scr_ysize;
void DisplayChar10(int,int,int,int,int);
extern unsigned char far *v_add;
extern union REGS iReg,oReg;
extern int initvar;
unsigned char sc[4800];
/*--------------------------------------------------------------------------*/
/* write a character at x,y coordinates with color as attribute */
/*--------------------------------------------------------------------------*/
void writechar(int x,int y,unsigned char ch,int color)
{
unsigned char far *scr_temp;
unsigned char far *v_add;
if (font_width==1)
{
v_add=((void far *) (((unsigned long)(0xB800) << 16 )));
scr_temp=v_add+160*y+2*x;
*scr_temp++=ch;
*scr_temp=color;
}
else
{
DisplayChar10( ch,x*font_width,y*font_height,color & 0x0F, color >> 4 );
}
sc[y*160+x*2]=ch;
sc[y*160+x*2+1]=color;
}
/*--------------------------------------------------------------------------*/
/* initialize the display board by setting the seg value */
/* initialize the mouse */
/*--------------------------------------------------------------------------*/
void initdisplay(void)
{
int v;
v=get_video_mode();
switch(v)
{
case 3 :
case 7 :
font_width=1;
font_height=1;
txt_scr_xsize=gr_scr_xsize=80;
txt_scr_ysize=gr_scr_ysize=25;
break;
case 16 :
font_width=8;
font_height=14;
gr_scr_xsize=640;
gr_scr_ysize=350;
txt_scr_xsize=gr_scr_xsize/font_width;
txt_scr_ysize=gr_scr_ysize/font_height;
break;
case 18 :
font_width=8;
font_height=16;
gr_scr_xsize=640;
gr_scr_ysize=480;
txt_scr_xsize=gr_scr_xsize/font_width;
txt_scr_ysize=gr_scr_ysize/font_height;
break;
}
memset(sc,0,sizeof(sc));
initvar=1;
}
/*--------------------------------------------------------------------------*/
/* return a character at x,y location of the text screen */
/*--------------------------------------------------------------------------*/
unsigned char readchar(x,y)
int x;
int y;
{
return(sc[y*160+x*2]);
}
/*--------------------------------------------------------------------------*/
int readcolor(int x,int y)
{
return(sc[y*160+x*2+1]);
}
/*--------------------------------------------------------------------------*/
void gcurs(int action)
{
}
/*--------------------------------------------------------------------------*/