M EQU Byte Ptr 0[BX] TITLE 'EPSON Low Res. Graphics commands' DGROUP GROUP DATA ; **************************************************************************** ; * * ; * ZDFXLR : Support Enter/Exit Graphics Mode Commands for the * ; * Epson Low resolution Single Density, 60 by 72 dpi mode * ; * * ; **************************************************************************** ; * ; Revision : Jan. 05, 1984 FILE "ZDFXLR.A86" Version 1.0 * ; * ;***** MODE NOTES : ********************************************************* ; * ; PRINTER DEPENDENT SETUP MODULE * ; * ; SUPPORT PRINTER ENTER/EXIT GRAPHIC MODE COMMANDS * ; ALLOCATE Bit Map Buffer * ; * ; Function : * ; * ; GENTER : Enter Graphics Mode * ; GLF : Graphics Line Feed * ; ZFORM : Form Feed * ; GEXIT : Exit Graphics Mode * ; GSETUP : Setup Printer for Graphics Output, Calls GENTER * ; PRINTER_OUT : Output data string to printer device * ; * ; Program constants : * ; * ; PIXL : No. of dots printed in the graphics byte (Epson = 8 dots) * ; WIRE : No. of pixel wire per print pass * ; * ;----------------------------------------------------------------------------+ cseg PUBLIC GENTER, ZFORM, GEXIT, GLF, GSETUP EXTRN Printer_out:near dseg public pixl, wire, TMPXW, BWIDE PUBLIC BITMAP, BSIZE, WORDCOUNT EXTRN BYTEND:word, MAPEND:word, BMIN:word, XW:word ;----------------------------------------------------------------------------+ ; BITMAP Buffer ALLOCATION + ;----------------------------------------------------------------------------+ BUFSIZE EQU 3840 WCOUNT EQU 1920 WORDCOUNT DW WCOUNT BSIZE dw BUFSIZE BITMAP RS BUFSIZE ; bit map buffer for index 1 (black) ;----------------------------------------------------------------------------+ ; PRINTER CONSTANTS (EPSON FX-80/100, MX80/100, IBM Dot Matrix) + ;----------------------------------------------------------------------------+ ESC EQU 1BH ;Escape Code CR EQU 0DH ;Carriage return LF EQU 0AH ;Linefeed FF EQU 0CH ;Form Feed ESCK EQU 4BH ;Single Density 60 dpi mode PIXeL EQU 8 ;8 pixels printed per graphic byte PWIRE EQU 8 ;8 print wires per print pass PIXL dw pixel ;No. of pixels per data byte WIRE DW PWIRE TMPXW rs 02 BWIDE rs 02 cseg ;-------------------------------------------------------------------+ ; Enter Graphics dot Image Mode + ;-------------------------------------------------------------------+ GSETUP: ; Mapend = byte address to start scanning data from the BITMAP ; for printers with MSB = Top wire, Adjust byte pointer (MAPEND) ; so scan routine will map the bit pattern from TOP dot (MSB bit) ; up to the Bottom dot (LSB bit) ; MAPEND = BYTEND - XW Mov Ax, Word Ptr BYTEND ; Last byte in BITMAP Sub Ax, Word Ptr XW ; Offset to First byte of top row MOV Word Ptr MAPEND, Ax ; Graphic setup for the printer ; Set Graphics Line Spacing at 8/72 inches, 8 pixels per print line Push Cx Mov Cx, (Offset Gline_sp) Call Printer_out Pop Cx Ret Dseg ; ESC 3 24, Set Vertical Line Spacing to 24/216 inch: (8/72 = 8 dots) Gline_sp Db 03, ESC, 33H, 24 ; ESC, K, n1, n2 Graph_mode Db 05, CR, ESC, ESCK N1 rs 01 N2 rs 01 Cseg ;-------------------------------------------------------------------+ ; SET Single-density Bit Image Mode + ;-------------------------------------------------------------------+ ; Enter Low Resolution 60 dpi graphics mode GENTER: Push Cx ; No. of Graphic Bytes in BWIDE (16 bits) Mov Cl, Byte Ptr BWIDE ; Number of Graphis bytes Mov Byte Ptr N1, Cl Mov Cl, Byte Ptr (BWIDE + 1) Mov Byte Ptr N2, Cl Mov Cx, (Offset Graph_mode) Call Printer_out Pop Cx RET ;--------------------------------------------------------------------+ ; Do a FormFeed + ;--------------------------------------------------------------------+ Dseg ; Reset Line spacing to 6 lpi Exit_graph Db 02, ESC, 32H Form_Feed Db 01, FF Line_Feed Db 01, LF Cseg ZFORM: Push Cx MOV Cx, (Offset Form_feed) Call Printer_out Pop Cx Ret ;----------------------------------------------------------------------+ ; Exit graphic mode + ;----------------------------------------------------------------------+ GEXIT: Push Cx mov Cx, (Offset Exit_graph) ; Reset to Normal Line Feed Spacing Call Printer_out Pop Cx RET ;-------------------------------------------------------------------+ ; 8 Pin Graphics Mode + ; Graphic Line Feed, ADVANCE PAPER 8 PIXELS VERTICALLY + ;-------------------------------------------------------------------+ GLF: Push Cx MOV Cx, (Offset Line_feed) Call Printer_out Pop Cx Ret END