home *** CD-ROM | disk | FTP | other *** search
- ;********************************************************************
- ;
- ; LINE: A ZCPR 3.3+ compatible routine, using the version 4
- ; libraries, to place a graphics line on the screen
- ; for use in alias scripts.
- ;
- ; Version 3.0D (July 7, 1990) - Updated and re-linked based upon
- ; VLIB4D and version 4 libraries. Assembled with SLR's Z80ASM and
- ; linked with DRI's LINK. Thanks go to Dave Ramsey for producing
- ; an excellent set of command-level graphics tools. Bob Dean
- ;
- ;
- ; Author: Dave Ramsey Date: May 25, 1989
- ; Versions 1.0 and 2.0.
- ;
- ;********************************************************************
- ;
- ; VLIB/Z3LIB/SYSLIB references:
- ;
- ext gz3init,tinit,dinit,drhorz,drvert,vpstr
- ext eval10,argv
- ;
- ; Constants defined:
- ;
- VERSION equ 3
- MONTH equ 7
- DAY equ 5
- YEAR equ 90
- ;
- DOS equ 5
- BUFFER equ 080h
- CR equ 13
- LF equ 10
- ARGCNT equ 5
- ;
- start:
- jp main
- db 'Z3ENV'
- db 1
- z3eadr: ds 2
- main:
- ld hl,(z3eadr)
- call gz3init ; check for presence of extended TCAP
- and a,0fh
- jr nz,stack ; if present, proceed
- ld hl,oldtcpmsg ; else tell user
- call vpstr ; and exit
- ret
- ;
- ; setup stack...
- ;
- stack:
- ld hl,0
- add hl,sp
- ld (oldsp),hl ; save old stack pointer
- ld hl,(DOS+1)
- ld l,0
- ld a,h
- add a,-8
- ld h,a ; set stack below CCP
- ld sp,hl
- ;
- ; Get command line parms, there should be 5, and store results
- ;
- ld a,0ffh ; null terminate argument strings
- ld hl,BUFFER+1
- ld de,tokentbl
- call argv
- ld a,(numtok)
- cp a,ARGCNT ; did the user get it right?
- jp nz,gethelp ; nope, tell him how to call us.
- ;
- ; Else, store parm results directly inline for the drbox call and execute
- ;
- ld hl,(parm1)
- call eval10
- ld (type),a
- ld hl,(parm2)
- call eval10
- ld (hrow),a ; save row number
- ld hl,(parm3)
- call eval10
- ld (col),a ; save column number
- ld hl,(parm4)
- call eval10
- ld (length),a ; save height
- ld hl,(parm5)
- call eval10
- ld (direct),a ; save width
- ;
- ; else... init terminal as per V4 lib conventions
- ;
- call tinit
- ld a,(type)
- or a,a
- jr z,drawhline ; if a=0, draw horizontal line else
- ld bc,4
- ld de,vrow
- ld hl,hrow
- ldir ; get arguments
- call drvert ; draw vertical line
- vrow ds 4
- jp fini
- ;
- ; Call DRBOX routine to draw the box.
- ;
- drawhline:
- call drhorz ; draw horizontal line
- hrow: db 0
- col: db 0
- length: db 0
- direct: db 0
-
- ;
- ; deinit terminal and restore stack
- ;
- fini:
- call dinit
- ;
- fini2:
- ld hl,(oldsp)
- ld sp,hl
- ret
- ;
- ;
- gethelp:
- ld hl,helpmsg
- call vpstr
- jp fini2
-
- ;
- oldsp: ds 2
- ;
- tokentbl:
- maxtok: db ARGCNT ; I don't want to see more than 5 arguments,
- numtok: db 0 ; but how many were there really?
- parm1: ds 2 ; address arg 1 - line type
- parm2: ds 2 ; address arg 2 - row
- parm3: ds 2 ; address arg 3 - col
- parm4: ds 2 ; address arg 4 - length
- parm5: ds 2 ; address arg 5 - direction
- ;
- type: db 0 ; flag for type of LINE to draw
- ;
- helpmsg:
- db 'LINE, Version ',VERSION/10+'0','.',VERSION MOD 10+'0',CR,LF
- db 'LINE - Draws a LINE on the screen.',CR,LF
- db 'Syntax:',CR,LF
- db ' LINE <type> <row> <col> <height> <width>',CR,LF
- db 'Where:',CR,LF
- db ' <type> is an integer 0 for horizontal lines or',CR,LF
- db ' an integer 1 for vertical lines;',CR,LF
- db ' <row> is the start row of the line on the screen;',CR,LF
- db ' <col> is the start column on the screen;',CR,LF
- db ' <length> is the length of the line;',CR,LF
- db ' <direct> is the direction of the line, where:',CR,LF
- db ' 0 = left-to-right OR top-to-bottom; and',CR,LF
- db ' 1 = right-to-left OR bottom-to-top.',CR,LF,0
- ;
- oldtcpmsg:
- db 'Extended TCAP not present.',CR,LF,0
- ;
- end