home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name sccurst -- Returns the cursor position and size from
- * current display page
- *
- * Synopsis is_off = sccurst(prow,pcol,phigh,plow);
- *
- * int is_off 1 if cursor is off, 0 if on
- * int *prow Pointer to row value returned
- * int *pcol Pointer to column value returned
- * int *phigh Pointer to high scan line returned
- * int *plow Pointer to low scan line returned
- *
- * Description SCCURST returns the current cursor location on the
- * current display device and page and the current size of
- * the cursor. It also reports whether the cursor is on or
- * off.
- *
- * This function operates by querying BIOS about the status
- * of the cursor. Some IBM programs alter the cursor size
- * without alerting BIOS about the change, so the BIOS may
- * report inaccurate information about cursor size.
- * SCCURST is subject to such inaccuracies.
- *
- * This function maintains records of the cursor types and
- * cursor on/off states for each display page of each
- * installed video adapter. Another process may have
- * changed the actual state of the cursor without updating
- * the recorded cursor state. If such a conflict occurs,
- * SCCURST reports and records the actual cursor state.
- *
- * Returns is_off 1 if cursor is off, 0 if on
- * *prow,*pcol,*phigh,*plow
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1986
- *
- **/
-
- #include <bscreen.h>
-
- int sccurst(prow,pcol,phigh,plow)
- int *prow,*pcol,*phigh,*plow;
- {
- int ax,bx,cx,dx,flags; /* General registers */
- int device,mode,columns,act_page,off;
-
- ax = utbyword(3,0); /* Set up the call to the BIOS */
- bx = utbyword(b_curpage,0);
-
- bios(16,&ax,&bx,&cx,&dx,&flags);
-
- *prow = uthibyte(dx);
- *pcol = utlobyte(dx);
-
- device = scmode(&mode,&columns,&act_page);
- if (act_page != b_curpage && b_curknown[device])
- { /* Must look up table values. */
- *phigh = b_curtype[device][b_curpage].high;
- *plow = b_curtype[device][b_curpage].low ;
- off = b_curoff [device][b_curpage];
- }
- else /* Current page is active. */
- {
- *phigh = utlonyb(uthibyte(cx)); /* Use actual values. */
- *plow = utlonyb( cx );
- off = ((cx & 0x6000) != 0);
- scpgcur(off,*phigh,*plow,CUR_NO_ADJUST); /* Update the table. */
- }
-
- return off;
- }