TITLE "VID1 - Vlib 4.1" NAME ('VID1') ;================================================================ ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;---------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from VID1.Z80 by Richard Conn ; Date : 12 Jan 89 ; Version : 1.2 ; Module : VID1 ; Abstract: This module contains the routine CLS which clears ; the entire terminal screen, and CLREOS which clears from ; the current cursor position to the End-of-Screen based on ; parameters in the TERMCAP. It also contains a common ; entry, @SETV0, which is used by several other modules to ; eliminate duplicated code. ; Revision: ; 1.3 - 3 Mar 89. Added CLREOS. HFB ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC CLS, CLREOS ; General Use Routines PUBLIC @SETV0 ; Internal combined use routine ; ..From VLIB Get.. EXT @CL, @CD, @CLSD EXT VIDPTR, VIDOUT .Z80 CSEG ;=============================================================== ; CLS - Clear Screen ; Entry: - None ; Exit : A = 0 and Zero Flag Set (Z) if Not done ; A = FFH and Zero Reset (NZ) if Screen Cleared Ok ; Uses : AF ; Special Requirements: None ;=============================================================== CLS: PUSH HL ; Save regs LD HL,(@CL) ; ..and get Clear Screen string CLS0: LD A,(@CLSD) ; Get Clear Screen Delay in Millisecs ; The following entry point is accessable by other modules @SETV0: PUSH DE ; Save regs LD D,A ; Move delay to D reg for later use LD A,(HL) ; Get first char of string OR A ; Is it an invalid string? JR Z,RETV ; ..jump exit if Bad w/Null (Z) Exit Code CALL VIDOUT ; Else output string with delay OR 0FFH ; Set Ok return (NZ) RETV: POP DE ; Restore regs POP HL RET ;=============================================================== ; CLREOS - Clear from cursor position to End-Of-Screen ; Entry: - None ; Exit : A = 0 and Zero Flag Set (Z) if Not done ; A = FFH and Zero Reset (NZ) if Screen Cleared Ok ; Uses : AF ; Special Requirements: None ;=============================================================== CLREOS: PUSH HL ; Save regs LD HL,(@CD) ; ..get Clear to End-Of-Screen string JR CLS0 ; Joint common code above END