home *** CD-ROM | disk | FTP | other *** search
- /**
- *
- * Name scscroll -- Vertically scroll lines of text on the active
- * display page using BIOS
- *
- * Synopsis iret = scscroll(num_lines,attrib,u_row,u_col,l_row,l_col,dir);
- *
- * int iret 0 is always returned.
- * int num_lines Number of lines to scroll. A value of
- * 0 specifies that all lines within the
- * window should be scrolled (thus
- * clearing the window)
- * int attrib The attribute to be used on the vacant
- * lines. It has the background attribute
- * in the high order four bits of the low
- * order byte, and the foreground in the
- * low order nybble.
- * int u_row,u_col Upper left corner of window.
- * int l_row,l_col Lower right corner of window.
- * int dir Scrolling direction (SCR_UP or SCR_DOWN).
- *
- * Description This function moves lines of characters within a defined
- * window up or down. The vacant lines are filled with
- * blanks and a specified attribute. The active display
- * page is scrolled. (Use SCPSCROL to scroll the current
- * display page regardless of whether it is active.)
- *
- * When the screen is in graphics mode, an attribute of 0
- * is used on the vacant lines regardless of the value of
- * attrib. This prevents the vertical "pinstripes" seen on
- * the IBM Color/Graphics Adapter when it is scrolled in
- * graphics mode with a nonzero attribute.
- *
- * Returns iret Always returned as zero.
- *
- * Version 3.0 (C)Copyright Blaise Computing Inc. 1983, 1984, 1986
- *
- **/
-
- #include <bscreen.h>
- #include <butility.h>
-
- int scscroll(num_lines,attrib,u_row,u_col,l_row,l_col,dir)
- int num_lines,attrib,u_row,u_col,l_row,l_col,dir;
- {
- int ax,bx,cx,dx,flags; /* General registers */
- int mode,columns,apage; /* Values returned by scmode */
- int last_row;
-
- scmode(&mode,&columns,&apage);
- last_row = scrows() - 1;
-
- utbound(u_row,0,last_row) /* Force reasonable values */
- utbound(u_col,0,columns - 1)
- utbound(l_row,u_row,last_row)
- utbound(l_col,u_col,columns - 1)
- if (num_lines > (l_row - u_row) || num_lines < 0)
- num_lines = 0; /* Do not scroll more lines */
- /* than there are in the window.*/
- if ((mode > 3) && (mode != 7)) /* Force attribute for graphics */
- attrib = 0; /* (nonzero attribute creates */
- /* pinstripes) */
-
- /* Set up the registers and then call BIOS. */
-
- ax = utbyword(dir == SCR_UP ? 6 : 7,num_lines);
- bx = utbyword(attrib,0);
- cx = utbyword(u_row,u_col);
- dx = utbyword(l_row,l_col);
-
- bios(16,&ax,&bx,&cx,&dx,&flags);
-
- return(0);
- }