M EQU Byte Ptr 0[BX] TITLE 'SCAN OUTPUT PROCESSOR - Color Printer' DGROUP GROUP DATA ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; ; ; SCANER : SCAN AND OUTPUT one 'PLOT STRIP' from BITMAP to PRINTER ; ; ; 8 colors, 4 color planes (bit map buffers) ; ; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ; ; ; Revision : Jan. 12, 1984 File "SCANCOR.A86" GSX-86 V1.3 1-0 ; ; ; ; Scaner (pline, xw) ; ; ; ; Function : SCAN and OUTPUT entire 'PLOT STRIP' from BITMAP to PRINTER. ; ; ; ; for j = 1 to PLINE ;loop to output one strip ; ; for c = 1 to 4 ; loop to output four colors ; ; for l = 1 to 4 ; loop to output four lines ; ; call GSCAN ; output one line ; ; output GLF } ; Graphic LineFeed ; ; ; ; Input : PLINE - No. of print lines per plot strip ; ; XW - No. of bytes per print line ; ; LSIZE - Offset to the start of next line to output in Bitmap ; ; MAPEND - First Byte address pointer in BITMAP buffer ; ; ; ; Output : None ; ; ; ; Calls : GSCAN - Transpose and output Image buffer to printer ; ; ; ;----------------------------------------------------------------------------; ; CALL SCANER ; RET ; PUBLIC SCANER Extrn GSCAN:near, GLF:near, Check_abort:near dseg EXTRN BITMAP:word, MAPEND:word, mpty:word, XMAX:word, YMAX:word EXTRN YW:word, PLINE:word, NSTRIP:word EXTRN mapend:word, XW:word, CCODE:byte Extrn Cormap_size:word, BMIN:word, Abort_flg:byte PUBLIC ISTBYT ISTBYT RS 02 cseg SCANER: MOV Bx, Word Ptr mapend ; = first byte address in bitmap ; to start scanning bit pattern Mov Word Ptr ISTBYT, Bx MOV Cx, Word Ptr PLINE ;No. of Print Lines per Strip ; PLINE = Outer loop count ; for j = 1 to pline JLOOP: PUSH CX ; Save pline count Push Bx ; Save Byte Pointer ; for color = 0 to 3 ; Scan four Color Bitmap buffers Mov Cx, 0 Mov Byte Ptr CCODE, 30h CLOOP0: Push Cx Push Bx ; If Bitmap is empty, skip scanning data for output Mov Bx, Cx Cmp Byte Ptr MPTY[BX], 0 ; Check Empty flag for this plane ; Je cloop9 ; for l = 1 to 4 ; print four lines in each pline Mov Cx, 4 loop0: Push Cx Call GSCAN ; OutPut Graphics Image bytes ; GSCAN Returns with the byte address pointer pointing to the ; First byte of next line in buffer Pop Cx Inc Byte Ptr CCODE ; change command output next pixel line Dec Cx Jnz loop0 cloop9: ; Update the Byte Pointer to Next Color Buffer Pop Bx ; Get Address pointer of First Byte Add Bx, Word Ptr cormap_size ; Offset address pointer to next ; Color 'Plane' Mov Word Ptr ISTBYT, Bx ; Update buffer Pointer Pop cx Inc Cx Cmp Cx, 3 Jbe cloop0 ; Scan next color jloop9: CALL glf ; Output Graphic LineFeed Pop Bx ; Get Byte Pointer POP CX ; Get PLINE count DEC CX ; Decrement pline count, Done yet? JZ sent ; Check console status Call Check_abort Cmp Byte Ptr Abort_flg, 0ffh Je Sent ; Stop output if abort flag is set Sub Bx, Word Ptr BMIN Mov Word Ptr ISTBYT, Bx ; Update Buffer Pointer Jmp Jloop sent: RET ; Yes, Return END