home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Black Box 4
/
BlackBox.cdr
/
progc
/
snip1091.arj
/
SCRNSIZE.C
< prev
next >
Wrap
C/C++ Source or Header
|
1991-08-06
|
452b
|
26 lines
/*
** Get screen size (by Bob Jarvis)
*/
#include <dos.h>
int get_screen_rows(void)
{
char far *bios_crt_rows_ptr = MK_FP(0x0040, 0x0084);
return(*bios_crt_rows_ptr);
}
int get_screen_cols(void)
{
int far *bios_crt_cols_ptr = MK_FP(0x0040, 0x004A);
return(*bios_crt_cols_ptr);
}
main()
{
printf("rows = %d cols = %d\n",
get_screen_rows(), get_screen_cols());
}