M EQU Byte Ptr 0[BX] TITLE 'Output MARKER TO PRINTER BITMAP' DGROUP GROUP DATA ;***************************************************************************** ; * ; DOMARKC : Clip the MARKER to the Current Printer Plot Strip and * ; Output the Character to the Printer BITMAP based on current * ; MARKER Size * ; * ;***************************************************************************** ; * ; REVISION : Nov. 07, 1983 FILE "DOMARKC.A86" Version 1.0 * ; * ; Input : * ; OBJLST - Object List Buffer Contains : * ; byte 1 : Opcode = 7 * ; 2 : Npt * ; 3,4 : X-coord. of Ist Marker * ; 5,6 : Y-coord. of Ist Marker * ; 7... : X, Y coord. of Markers * ; * ; nxtobj - points to next location in OBJLST * ; * ; * ; x,y - point Coord. for the Marker String * ; npt - No. of Markers in the Marker string * ; NDMKTY - Marker symbol in ASCII * ; NDMKSZ - scale factor for Marker symbol (1-12) * ; * ; CBUF - MARKER ASCII CHARACTER BUFFER 27 - 31 * ; * ; Program Variables : * ; * ; OBJLST - Object List Buffer * ; NXTOBJ - Next OBJLST Buffer location pointer * ; CHRPTR - Character Buffer byte pointer * ; PMKSZ - MARKER SIZE = 8 * MARKER SIZE (NDMKSZ) * ; CHROFF - Offset to next MARKER position * ; CCLIP - Character Clipping indicator, 1=do clipping * ; * ; Calls : * ; GETXY : Get X,Y (4 bytes) from OBJLST * ; GETPT : Get Coordinate from OBJLST (2 bytes) * ; GETNXT : Get 1 byte from OBJLST buffer * ; MUL8 : = * 8 * ; CLIPTX : Clip a Chracter cell (8*size) to the current PLot Strip * ; based on rotation * ; TEXTIT : Output a Character to the BITMAP buffer * ; * ;***************************************************************************** PUBLIC DOMARK EXTRN CMPDH:near EXTRN GETXY:near, GETNXT:near EXTRN CLIPTX:near, TEXTIT:near, ZSETCOR:near EXTRN MUL8:near, NEGHL:near DSEG EXTRN CBUF:word EXTRN NDMKTY:byte, NDMKSZ:byte, PMKSZ:byte, CSIZE:word, ZXMAX:word EXTRN NBYT:word, NBIT:byte, NDMKCO:byte, COLOR:byte EXTRN X1:word, Y1:word, Y2:word, XDIR:word, YDIR:word EXTRN FLGS:byte, CHROFF:word, CHRPTR:word, CCLIP:word extrn rflgm:byte, bmaskm:byte, ritflg:byte, bitmask:byte NPT RS 01 ;No. of MARKERS in the string cseg ;----------------------------------------------------------------------------+ ; Get NPT, no. of MARKERS + ;----------------------------------------------------------------------------+ DOMARK: ; rflgm and bmaskm is set by the set color and set writing mode routines mov al,rflgm ; setbit routine uses ritflg to decide mov ritflg,al ; whether to OR, AND or to XOR the bit in mov al,bmaskm ; the bitmap with the bitmask to produce mov bitmask,al ; the new data bit mov bl, byte ptr ndmkco mov byte ptr color, bl Call ZSETCOR ; Setup Color Parameters CALL GETNXT ;Returns Npt in MOV Byte Ptr NPT,AL ;Stack it for loop counter PUSH AX MOV AL,0EH ;Set 90 rotation for Marker symbols MOV Byte Ptr FLGS,AL ; Set up Size Factor for Raster routine XOR AL,AL MOV AL,Byte Ptr NDMKSZ MOV Byte Ptr CSIZE,AL RCL AL,1 RCL AL,1 ;Marker symbol size = NDMKSZ * 8 RCL AL,1 MOV Byte Ptr PMKSZ,AL ;----------------------------------------------------------------------------+ ; Get Marker symbol pointer + ;----------------------------------------------------------------------------+ MOV BL,Byte Ptr NDMKTY ;Returns Marker type ; Get Character Buffer byte address = K * 8 + CBUF AND BX, 07H CALL MUL8 ;8 bytes per Character in CBUF MOV DX,(Offset CBUF) ;Character buffer base address ADD BX,DX MOV Word Ptr CHRPTR,BX ;Pointer to the 8 bytes character cell ;in CBUF ; Set row, column direction flag for clipping ; 90 rotation, xdir = +1 column, ydir = +1 row MOV AL,1 MOV Byte Ptr YDIR,AL MOV Byte Ptr XDIR,AL ;----------------------------------------------------------------------------+ ; Do k = 1, Npt + ;----------------------------------------------------------------------------+ PMKL01: POP AX ;Unstack character count DEC AL JS PMK099 ;Done ? PUSH AX ;----------------------------------------------------------------------------+ ; Get x1, y1 from OBJLST + ;----------------------------------------------------------------------------+ CALL GETXY ;Returns = x1, = y1 mov word ptr x1, dx mov word ptr y1, cx ;----------------------------------------------------------------------------+ ; Clip Character cell based on Current Marker size + ; MARKER size use Current Marker size : NDMKSZ + ;----------------------------------------------------------------------------+ ; Get X2, Character cell WIDTH extent FOR MARKING CLIPPING ; X2 = X1 + PMKSZ MOV BX,Word Ptr PMKSZ dec bx mov dx, word ptr x1 ADD BX,DX ; = x2 mov dx, word ptr zxmax cmp bx, dx ; Marker extent > plot max ? JNB PMKL09 ; if yes, marker is clipped ; Get Y2, Character cell height extent : y1 to y2 ; y2 = y1 + PMKSZ MOV BX,Word Ptr PMKSZ DEC BX mov dx, word ptr y1 ADD BX,DX MOV Word Ptr Y2,BX ;Y2 = Y1 + PMKSZ ; Clip character to Current PLot Strip CALL CLIPTX ;----------------------------------------------------------------------------+ ; If Carry flag set, Trivial reject : Character outside current Strip + ;----------------------------------------------------------------------------+ JNAE L@1 CALL TEXTIT ;Output the Character byte to BITMAP L@1: ;----------------------------------------------------------------------------+ ; Next MARKER position + ;----------------------------------------------------------------------------+ PMKL09: JMPS PMKL01 PMK099: RET END