M EQU Byte Ptr 0[BX] TITLE 'PHASE II MAIN MODULE' DGROUP GROUP DATA ; **************************************************************************** ; * * ; * RASOUT2 : Phase II Main Module, RASTER CONVERT, SCAN OUTPUT * ; * * ; **************************************************************************** ; * ; Revision : Jan. 05, 1984 File "RASOUT2.A86" Version 1.0 * ; * ;***** MODE NOTES : ********************************************************* ; Jan. 03, 1984 - Put Printer Output module POUT in seperate source file * ; PRINTIO for BDOS printer output function * ; ZPRINTIO for PC DOS Rom Bios Printer Output Function * ; Dec. 20, 1983 * ; Use Allocated memory block for bit map buffer * ; Bitmap_segment is either the allocated segment block or the internal * ; driver buffer for the bit map, change all bitmap segment from Ds to Es * ; Dec. 16, 1983 * ; Cramp Plot to Ymax, GIOS generate plot with in 0, 0, Xmax, Ymax space * ; Dec. 12, 1983 * ; Check Console key input and stop output if abort flag is set * ; Aug. 31, 1983 * ; Do not clip plot to ymax, allow for y to be longer than 9.5 inches. * ; Print only required lines for the last plot strip * ; Aug. 02, 1983 * ; 1. Ymax = Ymax + 1 (coordinate passed to the driver = 0 to 32767) * ; April 26, 1983 * ; 1. Add barcode to support optimized BAR Fill using Fill Area Routine * ; * ;***** MODE NOTES : ********************************************************* ; * ; Rasout (objcnt, object list buffer) * ; * ; Description : * ; * ; Initialize Bitmap Variables for Raster ans Scaner Routines; * ; do n = 1 to nstrip; * ; do n = 1 to objcnt; * ; Get next entry from Object List; * ; Call Raster to Process the Opcode; * ; end; * ; * ; Call Scaner to Output the Plot Strip; * ; Clear Bitmap; * ; end; * ; * ; Exit Graphic Mode; * ; * ;----------------------------------------------------------------------------+ cseg PUBLIC RASOUT EXTRN SETUPS:near, RASTER:near, SCANER:near, CLRBUF:near EXTRN GEXIT:near, msgout:near, Check_abort:near dseg PUBLIC TOPY, BOTY, BOTTY, barcode, lastband EXTRN NSTRIP:word, XMAX:word, YMAX:word, YSIZE:word, ZYMAX:word extrn pline:word, Abort_flg:byte Extrn Bitmap_segment:word ;----------------------------------------------------------------------------+ ; CURRENT PLOT STRIP START AND END COORDINATE (TOP-Y, BOTTOM-Y) + ;----------------------------------------------------------------------------+ TOPY RS 02 ;Plot strip Top clip edge BOTY RS 02 ;Plot strip Bottom clip edge BOTTY RS 02 ;Plot strip Bottom map edge barcode rs 02 ;GDP BAR Flag lastband rs 02 ;no. of print line in the last strip CSEG RASOUT: ; XMAX and YMAX passed to RASOUT by PHASE I MODULES Cmp Word Ptr Ymax, 0 Ja Yok Cmp Word ptr Xmax, 0 Ja Yok Jmp Noplot ; Generate No plot if both Xmax, Ymax = 0 Yok: Mov Ax, Word Ptr Zymax Cmp Word Ptr Ymax, Ax Jbe Checky Mov Word Ptr Ymax, Ax ; Make sure Plot is not outside ; Defined Max. Y space Checky: Inc Word Ptr Ymax ;----------------------------------------------------------------------------+ ; Compute BITMAP buffer row/column variables using the buffer size + ; BSIZE, the current Plot extents XMAX & YMAX and Printer dependent + ; value, No. of print wires per byte : PIXL + ;----------------------------------------------------------------------------+ Start: ; Get allocated bitmap Base Segment address and use Es as the bit map ; buffer segment reference, Es must not be clubbered ! Mov Ax, Word Ptr Bitmap_Segment Mov Es, Ax ; Setup Es as the bitmap buffer base segment mov ax, 3 call msgout ; I'm Here CALL SETUPS ;Setup parameters used by RASTER & SCANNER ;Modules : Xw, Pline, Nstrip, Ysize and Mapend ;----------------------------------------------------------------------------+ ; Initialize Outer Loop Count : No. of Plot Strips to Raster-Scan + ;----------------------------------------------------------------------------+ Mov Ch, Byte Ptr NSTRIP ; No. of Plot Strips to Process ; for this Plot, This is the Outer ; Loop Count of the raster, scan loop ;----------------------------------------------------------------------------+ ; Initialize Plot Strip Clipping parameters, TOPY and BOTY + ;----------------------------------------------------------------------------+ ; TOPY = YMAX MOV BX,Word Ptr YMAX ; Start Raster Scanning from YMAX ;----------------------------------------------------------------------------+ ; For n = 1 to nstrip + ;----------------------------------------------------------------------------+ NLOOP: ; Check the Abort_flg, may have been set during scan output in SCANER Cmp Byte Ptr Abort_flg, 0ffH Je Exit Call Check_abort ; Check any Console key pressed ? Cmp Byte Ptr Abort_flg, 0ffH ; Stop Output ? Je Exit ; Loop to Raster and Scan output the plot PUSH CX MOV Word Ptr TOPY,BX ;TOP Y-coord. of the First Plot Strip ; BOTY = TOPY - No. of vertical pixels per Strip (Y-axis) + 1 MOV dx,Word Ptr YSIZE ;Vertical pixels per Strip = PLINE * PIXL ADD BX,DX ; Bottom raster Line = TOPY - plot strip size MOV Word Ptr BOTTY,BX ;Bottom edge raster line ;Making sure BOTY >= 0 JNS RSOJ01 MOV BX,0 RSOJ01: MOV Word Ptr BOTY,BX ;BOTTOM Y-coord. of the first Plot Strip CALL CLRBUF ; Clear the bit map buffer mov ax, 4 call msgout ; I'm here ! CALL RASTER ;Rasterize next Plot Strip into BITMAP mov ax, 5 call msgout ; I'm here ! CALL SCANER ;Scan and Output this Plot Strip to Printer ;----------------------------------------------------------------------------+ ; Update TOPY and BOTY to process next Plot Strip + ;----------------------------------------------------------------------------+ MOV BX,Word Ptr BOTY ;Update TOPY = BOTY - 1, Start Y-coord of ;next Plot Strip DEC BX ;Making sure TOPY is > 0 POP CX ;Un-stack Strip count JS EXIT ;----------------------------------------------------------------------------+ ; Decrement Strip count, All done ? + ;----------------------------------------------------------------------------+ DEC CH jz exit cmp ch, 1 JNZ NLOOP ;Go do next Strip ; plotting the last plot strip mov ax, word ptr lastband ; get the no. of print lines for mov word ptr pline, ax ; the last plot strip jmp nloop ;----------------------------------------------------------------------------+ ; Exit Graphic Mode + ;----------------------------------------------------------------------------+ EXIT: ; Clear the Abort Output flag Mov Byte Ptr Abort_flg, 0 CALL GEXIT NOPLOT: RET END