home *** CD-ROM | disk | FTP | other *** search
- Unit JRSCR201 ;
-
- (*╔═════════════════════════════════════════════════════════════════════════╗*)
- (*║ ║*)
- (*║ JR Unit Library - Version 2.01 - June xxrd 1988 ║*)
- (*║ ║*)
- (*║ Screen control functions and procedures ║*)
- (*║ ║*)
- (*╚═════════════════════════════════════════════════════════════════════════╝*)
-
- Interface
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Uses Dos ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Const _BIOSVideoService = $10 ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Type _ScreenType = Array(.0..3999.) Of Byte ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Var
- _regs8086 : Registers ;
- _Screenbuf : _ScreenType Absolute $B800:$0000 ;
- _VideoMode : Byte Absolute $0000:$0449 ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Procedure _Cursor(_startline,_endline : Integer) ;
- Procedure _ScrollDown(_lowerX,_lowerY,_upperX,_upperY,
- _lines,_attribute : Integer) ;
- Procedure _ScrollUp(_lowerX,_lowerY,_upperX,_upperY,
- _lines,_attribute : Integer) ;
- Procedure _SetPage(_pagenr : Integer) ;
- Procedure _DispChar(_x,_y : Integer ; _char : Char ;_attribute : Integer) ;
- Procedure _DispStr(_x,_y : Integer ; _string : String ;_attribute : Integer) ;
- Procedure _ShowScreen(_screen : _ScreenType) ;
- Procedure _ReadScreen(_screenfile : String ; Var _screen : _ScreenType) ;
- Procedure _SaveScreen(Var _screen : _ScreenType) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Implementation
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Procedure _Cursor ;
- (* Version 1.01 *)
- Begin ;
- With _regs8086 Do Begin ;
- If (_startline=0) And (_endline=0) Then ch:=32
- Else Begin ;
- ch:=_startline ; cl:=_endline ;
- End ;
- ah:=1 ;
- End ;
- Intr(_BIOSVideoService,_regs8086) ;
- End (* Procedure _Cursor *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Procedure _ScrollDown ;
- (* Version 1.01 *)
- (* Modified 2.00 *)
- Begin ;
- With _regs8086 Do Begin ;
- ah:=6 ; al:=_lines ;
- cl:=_lowerX-1 ; dh:=_lowerY-1 ;
- dl:=_upperX-1 ; ch:=_upperY-1 ;
- bh:=_attribute ;
- End ;
- Intr(_BIOSVideoService,_regs8086) ;
- End (* Procedure _ScrollDown *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Procedure _ScrollUp ;
- (* Version 1.01 *)
- (* Modified 2.00 *)
- Begin ;
- With _regs8086 Do Begin ;
- ah:=7 ; al:=_lines ;
- cl:=_lowerX-1 ; dh:=_lowerY-1 ;
- dl:=_upperX-1 ; ch:=_upperY-1 ;
- bh:=_attribute ;
- End ;
- Intr(_BIOSVideoService,_regs8086) ;
- End (* Procedure _ScrollUp *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Procedure _SetPage ;
- (* Version 1.01 *)
- Begin ;
- With _regs8086 Do Begin ;
- al:=_pagenr ; ah:=5 ;
- End ;
- Intr(_BIOSVideoService,_regs8086) ;
- End (* Procedure _SetPage *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Procedure _DispChar ;
- (* Version 1.01 *)
- Var _ix : Integer ;
- Begin ;
- _ix:=2*((_x-1)+(_y-1)*80) ;
- _Screenbuf(._ix.):=Ord(_char) ;
- _Screenbuf(._ix+1.):=_attribute ;
- End (* Procedure _DispChar *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Procedure _DispStr ;
- (* Version 1.01 *)
- Var _i,_ix : Integer ;
- _ch : Char ;
- Begin ;
- _ix:=2*((_x-1)+(_y-1)*80) ;
- For _i:=1 To Length(_string) Do Begin ;
- _ch:=_string(._i.) ;
- _Screenbuf(._ix+2*_i-2.):=Ord(_ch) ;
- _Screenbuf(._ix+2*_i-1.):=_attribute ;
- End ;
- End (* Procedure _DispStr *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Procedure _ShowScreen ;
- (* Version 1.01 *)
- Begin ;
- _Screenbuf:=_screen ;
- End (* Procedure _ShowScreen *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Procedure _ReadScreen ;
- (* Version 1.02 *)
- Var _file : File ;
- _i : Integer ;
- Begin ;
- Assign(_file,_screenfile) ; Reset(_file,4000) ;
- BlockRead(_file,_screen,1,_i) ; Close(_file) ;
- End (* Procedure _ReadScreen *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- Procedure _SaveScreen ;
- (* Version 1.02 *)
- Begin ;
- _screen:=_Screenbuf ;
- End (* Procedure _SaveScreen *) ;
-
- (*───────────────────────────────────────────────────────────────────────────*)
-
- End (* Of Unit JRSCR201 *).
-