home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / Samples / CSAPE32.ARJ / SOURCE / OWLSCR / PCBSCROL.C < prev    next >
Encoding:
C/C++ Source or Header  |  1990-03-29  |  1.4 KB  |  64 lines

  1. /*
  2.     pcbscrol.c
  3.  
  4.     % BIOS scrolling routines
  5.  
  6.     5/16/88  by Ted.
  7.  
  8.     OWL-PC 1.2
  9.     Copyright (c) 1988, by Oakland Group, Inc.
  10.     ALL RIGHTS RESERVED.
  11.  
  12.     Revision History:
  13.     -----------------
  14.      1/10/89 ted    Removed redundant disp clip
  15.  
  16.      3/28/90 jmd    ansi-fied
  17. */
  18.  
  19. #include "pcpriv.h"
  20.  
  21. OSTATIC void DIGPRIV bios_scrollvt(opbox *scrboxp, opcoord nrows);
  22.  
  23. /* -------------------------------------------------------------------------- */
  24.  
  25. void text_bScrollBoxVt(ptd_struct *ptd, opcoord nrows)
  26. {
  27.     win_type win;
  28.     opbox scrbox;
  29.  
  30.     win = ptd->win;
  31.  
  32.     opbox_copy(&scrbox, ptd->relboxp);
  33.     opbox_trans(&scrbox, win_GetXmin(win), win_GetYmin(win));
  34.  
  35.     bios_scrollvt(&scrbox, nrows);
  36. }
  37. /* -------------------------------------------------------------------------- */
  38.  
  39. static void DIGPRIV bios_scrollvt(opbox *scrboxp, opcoord nrows)
  40. {
  41.     OREGS regs;
  42.  
  43.     if (nrows > 0) {
  44.         regs.h.ah = VIDINT_SCRLUP;
  45.     }
  46.     else if (nrows < 0) {
  47.         regs.h.ah = VIDINT_SCRLDN;
  48.         nrows = -nrows;
  49.     }
  50.     else return;
  51.  
  52.     if (nrows >= opbox_GetHeight(scrboxp)) return;    /* quit if scroll all */
  53.  
  54.     regs.h.al = (byte)nrows;
  55.     regs.h.cl = (byte)scrboxp->xmin;
  56.     regs.h.ch = (byte)scrboxp->ymin;
  57.     regs.h.dl = (byte)scrboxp->xmax-1;
  58.     regs.h.dh = (byte)scrboxp->ymax-1;
  59.     regs.h.bh =  0;        /* Clear attr */
  60.     oakint86(BIOS_VIDINT, ®s);
  61. }
  62. /* -------------------------------------------------------------------------- */
  63.  
  64.