TITLE "VLGXYMSG - Vlib 4.1" NAME ('VLGXYM') ;==================================================================== ; The Libraries, Version 4, (C) 1989 by Alpha Systems Corp. ;-------------------------------------------------------------------- ; Author : Harold F. Bower ; Derived from VLGXYMSG.Z80 Ver 1.1 by Richard Conn ; Date : 12 Feb 89 ; Version : 1.2 ; Module : VLGXYMSG ; Abstract: This module contains GXYMSG, VPRINT and VPSTR which print a ; character string on the current CON: device with processing to ; allow reverse video or highlighting. GXYMSG positions the ; cursor before printing, while VPRINT merely prints starting at ; the current location from a string addressed on the stack. VPSTR ; prints a string whose address in in HL. Examples of useage are: ; ; CALL GXYMSG ; DEFB 5,10 ; DEFB 'Hello ',1,'World',2,' - How are things?',0 ; ... ; and: ; CALL VPRINT ; DEFB 'Hello ',1,'World',2,',0 ; ... ; and: ; LD HL,STRING ; CALL VPSTR ; ... ; Revision: ; 1.3 - 29 Aug 92 - Added Functions 3 (EREOL) and 4 (CLREOS), end on ; MSB set as well as ending Zero per Terry Hazen. HFB ;- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ; Module Entry Points PUBLIC GXYMSG, VPRINT, VPSTR ; ..from VLIB Get.. EXT GOTOXY, STNDOUT, STNDEND, @GOXY EXT EREOL, CLREOS ;1.3 ; ..from SYSLIB Get.. ;1.3 EXT COUT EXT COUT7 ;1.3 .Z80 CSEG ;=============================================================== ; GXYMSG - Go to addr in string at stack top and print message ; Entry: (STACK) - Points to XY position bytes in string ; Exit : - Nothing returned, Execution resumes after string end ; Uses : - None ; Special Requirements: None ;=============================================================== GXYMSG: EX (SP),HL ; Pt to coords CALL @GOXY ; ..and position cursor EX (SP),HL ; Restore return address and fall thru ;..fall thru to.. ;=============================================================== ; VPRINT - Print string addressed by stack stop w/rev video ; Entry: (STACK) - Points to 1st byte in character string ; Exit : - Nothing returned, Execution resumes after string end ; Uses : - None ; Special Requirements: None ;=============================================================== VPRINT: EX (SP),HL PUSH AF ; Save A and flags CALL VPSTR ; Print the line from HL POP AF ; Restore A and flags EX (SP),HL RET ;=============================================================== ; VPSTR - Print string whose address is in HL w/Rev Video ; Entry: HL - Points to 1st byte in character string ; Exit : HL - Points to byte after Null ending string ; A = 0, Zero flag set (Z) ; Uses : AF,HL ; Special Requirements: None ;=============================================================== VPSTR: LD A,(HL) ; Get char INC HL ; Pt to next RLCA ;1.3 Shift MSB to Carry SRL A ;1.3 .shift byte back insuring clear MSB ;1.3 OR A ; Done? RET Z ; ..quit if done PUSH AF ;1.3 Save Carry flag for later test CP 1 ; Stand out? JR Z,VP1 ; ..process if so CP 2 ; Stand end? JR Z,VP2 ; ..process if so CP 3 ;1.3 Erase to EOL? JR Z,VP3 ;1.3 ..process if so CP 4 ;1.3 Clear to End of Screen? JR Z,VP4 ;1.3 ..process of so ;1.3 CALL COUT ; Print char ;1.3 JR VPSTR CALL COUT7 ;1.3 Print char filtering MSB VPSTR0: POP AF ;1.3 Restore Carry Flag for End check JR NC,VPSTR ;1.3 .loop if Not end RET ;1.3 ..else quit here VP1: CALL STNDOUT ; Enter standout mode ;1.3 JR VPSTR JR VPSTR0 ;1.3 VP2: CALL STNDEND ; Exit standout mode ;1.3 JR VPSTR JR VPSTR0 ;1.3 VP3: CALL EREOL ;1.3 Erase to End of Line JR VPSTR0 ;1.3 VP4: CALL CLREOS ;1.3 Clear to End of Screen JR VPSTR0 ;1.3 END