M EQU Byte Ptr 0[BX] TITLE 'Draw Output Primitive Subroutines' DGROUP GROUP DATA ; **************************************************************************** ; * * ; * DODRAWC : Generate Output Primitives * ; * * ; **************************************************************************** ; * ; Revision : Nov. 02, 1983 File "DODRAWC.A86" Version 1.0 * ; ; ;***** MODE NOTES : ********************************************************* ; * ; 1) LINE STYLE SUPPORT VARIABLES IN PUBLIC : * ; LINE ENDPOINTS - X0, Y0, XN, YN, SPECIL * ; FILTER Y AND SET BIT FLAGS - ABOVE, INSIDE, ZONED * ; 2) Disk File Roll-Out on OBJLST Buffer OverFlow Supported by GETBYT * ; GETNXT routines * ; 3) Color Support ; May-04-83 Set Writing Mode support * ;***** MODE NOTES : ********************************************************* ; ; ; Calls : * ; * ; GETXY - Get the x,y coordinates of the next point in OBJLST (4 Bytes) * ; DRAWIT - Raster convert vector to pixel values, maps pixel * ; to bitmap address and 'sets' the bit * ; * ; GETPT : Get pt. coord. from PTSIN array (2 bytes) * ; PUTPT : Put pt. coord. into OBJLST buffer (2 bytes) * ; PUTBYT : Put 1 byte into OBJLST buffer * ; GETBYT : Get 1 byte from OBJLST buffer * ; GETNXT : Get Next byte from OBJLST buffer * ; GETMIN : Returns in the smaller of , values * ; GETMAX : Retruns in the larger of Values in and * ; * ;***************************************************************************** PUBLIC DOLINE, GETPT, PTADDR EXTRN GETNXT:near, GETBYT:near, GETXY:near EXTRN DRAWIT:near, ZSETCOR:near dseg EXTRN BNEXT:word, RSTAT:byte extrn bmaskl:byte, rflgl:byte, ritflg:byte, bitmask:byte EXTRN NDLNCO:byte PUBLIC NBIT, NBYT PUBLIC X, X1, Y, Y1, X2, Y2, DX1, DY, XDIR, YDIR PUBLIC FLG1, FLG2 PUBLIC X0, Y0, XN, YN, ABOVE, INSIDE, SPECIL ;----------------------------------------------------------------------------+ ; LINE DRAWING (RASTERIZE VECTOR TO PIXEL) VARIABLES + ;----------------------------------------------------------------------------+ X: X1 RS 02 ;line end points coordinates Y: Y1 RS 02 X0 RS 02 ;Line start point coord. Y0 RS 02 XN RS 02 ;Line end point coord. YN RS 02 X2 RS 02 Y2 RS 02 DX1 RS 02 ;DX1 = x2 - x1 DY RS 02 ;dy = y2 - y1 XDIR RS 01 ;if DX1>0 then xdir = 1 ;if DX1=0 then xdir = 0 ;if DX1<0 then xdir = -1 YDIR RS 01 ;y direction indicator FLG1 RS 01 ;Position indicator of a point FLG2 RS 01 ;relative to the Current Plot Strip ; Line Style Support Variables ABOVE DB 0 ;Which Line EndPoint ABOVE Strip Flag INSIDE DB 1 ;Line EndPoints INSIDE Strip Flag SPECIL RS 02 ;Line style bit pattern ;----------------------------------------------------------------------------+ NPT RS 1 ;No. of points PTADDR RS 2 ;ADDRESS OF NEXT POINT IN PTSIN ARRAY XPMIN RS 2 ;Polygon Min/Max Extents YPMIN RS 2 XPMAX RS 2 YPMAX RS 2 ;----------------------------------------------------------------------------+ ; BITMAP BUFFER ADDRESSING VARIABLES + ;----------------------------------------------------------------------------+ NBIT RS 01 ;bit location of a pixel = x mod 8 (0...7) NBYT RS 02 ;byte location of a pixel in bitmap cseg EJECT ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ ; Polyline + ;+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ DOLINE: ; rflgl and bmaskl is set by the set color and set writing mode routines mov al,rflgl ; setbit routine uses ritflg to decide mov ritflg,al ; whether to OR, AND or to XOR the bit in mov al,bmaskl ; the bitmap with the bitmask to produce mov bitmask,al ; the new data bit Mov Bl, Byte Ptr NDLNCO Call ZSETCOR ; Set up color for line CALL GETNXT ; = npt ; Call polyline routine CALL DRAWIT RET ;***************************************************************************** ; * ; GETPT : Get the next coordinate from PTSIN array * ; * ;***************************************************************************** ; * ; Getpt(from, coord) * ; * ; CALL GETPT * ; = Address of next coordinate in PTSIN * ; RET * ; = Address of next Coordinate in PTSIN * ; = The Coordinate * ; * ;***************************************************************************** GETPT: MOV DX,ES:DI ADD DI,2 RET END