'===========================================================================
' Subject: QB SCREEN SCROLL                   Date: 01-14-89 (23:21)       
'  Author: Unknown Author(s)                  Code: QB, PDS                
'  Origin: Rolf@ice.prima.ruhr.de           Packet: INTERRPT.ABC
'===========================================================================
DECLARE SUB Scroll (Direction%, NumRows%, Tlrow%, Tlcol%, Brrow%, Brcol%, Fore%, Back%)
TYPE RegType
  AX AS INTEGER
  BX AS INTEGER
  CX AS INTEGER
  DX AS INTEGER
  BP AS INTEGER
  SI AS INTEGER
  DI AS INTEGER
  FLAGS AS INTEGER
END TYPE

SHELL "dir/w"

SLEEP 1

DO
  Scroll 7, 1, 1, 1, 25, 80, 7, 0
  SLEEP 1
LOOP

DEFINT I-N
SUB Scroll (Direction%, NumRows%, Tlrow%, Tlcol%, Brrow%, Brcol%, Fore%, Back%)
'
''''''''''
'
'  SCROLL  Scrolls an Individual window on the Screen
'
''''''''''
'
'  Parameters:
'     Direction% = 6 for scroll up, 7 for scroll down
'     NumRows%   = # rows to scroll, 0 for clear area
'     Tlrow%     = top left row of window to be cleared
'     Tlcol%     = top left column of window to be cleared
'     Brrow%     = bottom right row of window to be cleared
'     Brcol%     = bottom right column of window to be cleared
'     Fore%      = foreground color of window
'     Back%      = background color of window
'
'  Interrupt x'10' user for video interface:
'
'      Ah = 6 for scroll window up, 7 for scroll window down
'      Al = # lines to scroll window, 0 for clear window
'      ch,cl = Row,Col of upper left corner of window
'      dh,dl = Row,Col of lower right corner of window
'      bh = clear screen attribute
'
'
  DIM InRegs AS RegType, OutRegs AS RegType
  IF (Direction% < 6 OR Direction% > 7) THEN EXIT SUB  'bad direction code
  InRegs.AX = Direction% * 256 + NumRows          'ah=up/dn, al=# lines
  InRegs.BX = Fore% * &H100 + Back% * &H1000      'bh=clear attribute
  InRegs.CX = (Tlrow% - 1) * &H100 + Tlcol% - 1   'cx=row,col of upper left
  InRegs.DX = (Brrow% - 1) * &H100 + Brcol% - 1   'dx=row,col of lower right
  CALL Interrupt(&H10, InRegs, OutRegs)
END SUB

