;******************************************************************** ; ; ISEC: A ZCPR 3.3+ compatible routine, using the version 4 ; libraries, to draw an intersection character ; 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,at,ltisec,rtisec,uisec,lisec,isec,vpstr ext eval10,argv ; ; Constants defined: ; VERSION equ 1 MONTH equ 7 DAY equ 5 YEAR equ 90 ; DOS equ 5 BUFFER equ 080h CR equ 13 LF equ 10 ARGCNT equ 3 ; start: jp main db 'Z3ENV' db 1 z3eadr: ds 2 main: ld hl,(z3eadr) call gz3init and a,0fh ; check for presence of exended tcap jr nz,stack ld hl,oldtcpmsg call vpstr ; print old tcap warning message ret ; return to CCP ; ; setup stack... ; stack: ld hl,0 add hl,sp ld (oldsp),hl ld hl,(DOS+1) ld l,0 ld a,h add a,-8 ld h,a ld sp,hl ; ; Get command line parms, there should be 3 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 (row),a ; save row number ld hl,(parm3) call eval10 ld (col),a ; save column number ; ; else... init terminal as per V4 lib conventions ; call tinit ; ; Call AT to position cursor. ; call at row: db 0 col: db 0 ; ; Now select the intersection character to draw. ; left: ld a,(type) cp a,1 jr nz,right call ltisec jp fini right: cp a,2 jr nz,upper call rtisec jp fini upper: cp a,3 jr nz,lower call uisec jp fini lower: cp a,4 jr nz,inter call lisec jp fini inter: cp a,5 jr nz,badval call isec jp fini badval: ld hl,badchmsg call vpstr ; ; 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 - intersection char parm2: ds 2 ; address arg 2 - row parm3: ds 2 ; address arg 3 - col ; type: db 0 ; helpmsg: db 'ISEC, Version ',VERSION/10+'0','.',VERSION MOD 10+'0',CR,LF db 'ISEC - Draws an intersection character on the screen.',CR,LF db 'Syntax:',CR,LF db ' ISEC ',CR,LF db 'Where:',CR,LF db ' is an integer 1 for a left intersection, ',CR,LF db ' an integer 2 for a right intersection, ',CR,LF db ' an integer 3 for an upper intersection, ',CR,LF db ' an integer 4 for a lower intersection,',CR,LF db ' an integer 5 for a center intersection;',CR,LF db ' is the row on the screen to place the char;',CR,LF db ' is the column on the screen to place the char.' db CR,LF,0 ; badchmsg: db 'Invalid intersection character requested.',CR,LF,0 oldtcpmsg: db 'Extended TCAP not present.',CR,LF,0 end