Category : C Source Code
Archive   : C-TOOLBX.ZIP
Filename : VIDEO1.C
#include "stdio.h"
#include "cminor.h"
#include "video.h"
#include "asmtools.h"
int vid_init(new_mode) /* initialize display mode */
int new_mode ; /* (See viedo.h for modes) */
{
REGS sreg , dreg ;
sreg.ax = new_mode & 0x07 ; /* force mode to be <= 7 */
vidint(V_INIT,&sreg,&dreg) ;
}
int vid_state(pcol) /* get current state info */
int *pcol ; /* store number of columns here */
{ /* return the current mode value */
REGS sreg , dreg ;
vidint(V_STATE,&sreg,&dreg) ;
*pcol = ( (BYTE_REGS *)&dreg)->ah ;
return( dreg.ax & 0xff) ;
}
int vid_page(new_page) /* set display page */
int new_page ; /* new page number */
{
REGS sreg , dreg ;
sreg.ax = new_page & 0x07 ; /* force new page to be <= 7 */
vidint(V_SETPAGE,&sreg,&dreg) ;
}
int vid_set_cur(row,col) /* set cursor position */
int row ; /* new row number */
int col ; /* new column number */
{
REGS sreg , dreg ;
((BYTE_REGS *) &sreg) ->dh = row ;
((BYTE_REGS *) &sreg) ->dl = col ;
sreg.bx = 0 ;
vidint(V_SET_CUR,&sreg,&dreg) ;
}
int vid_get_cur(prow,pcol) /* get current cursor position */
int *prow ; /* store row number here */
int *pcol ; /* store column number here */
{
REGS sreg , dreg ;
sreg.bx = 0 ;
vidint(V_GET_CUR,&sreg,&dreg) ;
*prow = ( (BYTE_REGS *)&dreg) ->dh ;
*pcol = ( (BYTE_REGS *)&dreg) ->dl ;
}
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
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/