M EQU Byte Ptr 0[BX] TITLE 'EPSON High Res. Graphics commands' DGROUP GROUP DATA ; **************************************************************************** ; * * ; * ZDFXHR : Support Enter/Exit Graphics Mode Commands for the * ; * Epson High Res., Double Density, interlaced mode * ; * * ; **************************************************************************** ; * ; Revision : Jan. 03, 1984 FILE "ZDFXHR.A86" Version 1.0 * ; * ;***** MODE NOTES : ********************************************************* ;***** 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 * ; ESC3 : Micro Line Feed 1/3 dots * ; ZFORM : Form Feed * ; GEXIT : Exit Graphics Mode * ; GSETUP : Setup Printer for Graphics Output, Calls GENTER * ; PRINTER_OUT : Output Data string to Printer * ; * ; Program constants : * ; * ; PIXL : No. of dots printed in the graphics byte (Epson hr. = 8) * ; WIRE : No. of pixel wire per print pass (double pass, wire = 16 dots)* ; * ;----------------------------------------------------------------------------+ cseg PUBLIC GENTER, ZFORM, GEXIT, GLF, ESC3, GSETUP ; EXTRN POUT:near Extrn Printer_out:near dseg public pixl, wire, XWTWO, TMPXW, BWIDE PUBLIC BITMAP, BSIZE, WORDCOUNT EXTRN BYTEND:word, MAPEND:word, BMIN:word, XW:word ;----------------------------------------------------------------------------+ ; BITMAP Buffer ALLOCATION + ;----------------------------------------------------------------------------+ BUFSIZE EQU 3844 WCOUNT EQU 1922 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 ;Line Feed FF EQU 0CH ;Form Feed ESCL EQU 4CH ;Dual-Density Mode PIXeL EQU 8 ;8 pixels printed per graphic byte PWIRE EQU 16 ;16 print wires per print pass PIXL dw pixel ;No. of pixels per data byte WIRE DW PWIRE TMPXW rs 02 XWTWO rs 02 BWIDE rs 02 cseg ;-------------------------------------------------------------------+ ; Enter Graphics dot Image Mode + ;-------------------------------------------------------------------+ ; There is no special Graphic setup for the printer 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 Xw Add Ax, Ax Mov Word Ptr XWTWO, Ax 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 RET ;-------------------------------------------------------------------+ ; SET Dual-Density Bit Image Mode + ; No. of Graphic Bytes in EPSON1 (16 bits) + ;-------------------------------------------------------------------+ DSEG ; entering High Resolution 120 dpi graphics mode ; ESC, L, n1, n2 Graph_mode db 05,CR,ESC,ESCL N1 rs 01 N2 rs 01 CSEG GENTER: Push Cx 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 + ;-------------------------------------------------------------------+ ZFORM: Push Cx MOV Cx, (Offset Form_Feed) Call Printer_out Pop Cx RET ;-------------------------------------------------------------------+ ; Exit graphic mode + ;-------------------------------------------------------------------+ Dseg Exit_graph Db 02, Esc, 32H Form_feed Db 01, FF Cseg 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 7.67 PIXELS VERTICALLY + ;-------------------------------------------------------------------+ DSEG ; ESC 3 n, Set Line Spacing to n/216 inch ; Change Vertical line spacing to 23/216 inch Graph_LF db 04,ESC,33H,23,LF ; 1/216 = 1/3 dot space Micro_LF db 04, ESC, 33H, 01, LF CSEG GLF: Push Cx Mov Cx, (Offset Graph_LF) Call Printer_out Pop Cx Ret ;-------------------------------------------------------------------+ ; Graphic Line Feed, ADVANCE PAPER 1/3 dot 2nd pass + ;-------------------------------------------------------------------+ ESC3: Push Cx Mov Cx, (Offset Micro_LF) Call Printer_Out Pop Cx RET END