EGAD Screen Print Technical Info

This file documents the internal operation of EGAD Screen Print, a DOS program which makes the Print Screen key really work the way you want.


Supplemental Data

EGAD Screen Print

Version 2.50

Copyright ⓒ 1993, 2002 − wlindley.com

To detect whether EGAD is in memory:

Use the DOS Interrupt 21h function 35h to retrieve interrupt vector 05h (Print Screen.) That function returns a segment:offset of the interrupt. Take that segment, with a 0 offset, to find the EGAD data segment, which is described below.

NOTE: Lines beginning with '>' indicate features found only in EGAD Version 2.50 and above.

HEGAD Data Segment contents.

OffsetContents
00h'QZ'The first two bytes are guaranteed to be 'QZ' in all versions of EGAD, from 1.00 upward.
02h(word)

Printer identifier *

* In versions less than 2.50, this is two characters which uniquely identify the printer type:

Matrix Printers:
'EP'Epson & Compatibles (9-pin) {EGADEP.EXE, EGADST.EXE}
'LQ'Epson LQ (24-pin) {EGADEP24.EXE}
'PP'IBM ProPrinter X24 {EGADPP.EXE}
'SC'Star NX-1000 / JX-80 Color
'DP'Dataproducts 8050
'MP'MPI 88/99/150
'NC'NEC 8023/C.Itoh 8510
'OK'Okidata 82/83/92/93
'OC'Okidata 292 (non IBM compatible)
'PT'Paper Tiger
'TO'Toshiba P3x1 (Not IBM/Epson compatible)
'TR'Tandy/Radio Shack DMP-105
Laser & InkJet Printers:
'HP'HP LaserJet, HP DeskJet 500, HP DeskJet 500C with black cartridge
'5C'HP DeskJet500C with color cartridge
'PJ'HP PaintJet
'QJ'HP QuietJet
'IJ'IBM ColorJet
'PC'PCPI LaserImage 2000
'PS'PostScript
'Pc'PostScript Color
'TC'Tandy/Radio Shack CGP-220 Inkjet
'XE'Xerox 4020

* In versions 2.50 and above, this is an integer containing the following information: (shown as a 16-bit integer)

+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+
| - |Ink|24P|Mat|Las|CTx|CGf| Printer Model | Manufacturer Code |
+---+---+---+---+---+---+---+---|---+---+---+---+---+---+---+---+

Bit fields:

  • '-' indicates reserved fields (all currently 0)
  • 'Ink' is 1 for Inkjet printers.
  • '24P' is 1 for 24-pin matrix printers.
  • 'Mat' is 1 for all matrix printers, 24-pin and 9-pin.
  • 'Las' is 1 for Laser printers.
  • 'CTx' is 1 if text can be printed in color (0=black only)
  • 'CGf' is 1 if EGAD supports color graphics printing
  • 0 if gray scale or black & white only.

Printer Manufacturer Codes:

0HP
1Epson
2IBM
3Toshiba
4NEC
5DP
6OKI
7MPI
8PCPI
9Xerox
10Tandy (Radio Shack)
11Adobe (PostScript printers)

Printer Model Codes: (** indicates defined but not yet used)

For Manufacturer = 0 (HP):

0LaserJet
1LaserJet II
2QuietJet
3LaserJet IIP or 3
4LaserJet 4 **
5PaintJet
6DeskJet 500 or 500C
7DeskJet 550C **

For Manufacturer = 1 (Epson):

0MX-80 (9-pin, 120 dpi)
1FX-80 (9-pin, 240 dpi)
2Star ("almost" Epson compatible 240 dpi)
3LQ-800 (24-pin)

For Manufacturer = 2 (IBM):

0ProPrinter II (9-pin) ** and ProPrinter X24 with AGM *OFF* [Selecting this printer in INSTALL will use the Epson driver.]
1ProPrinter X24 (24-pin mode, AGM *ON*)
2Color Inkjet 3852

Other Model codes are defined and can be found in "EGAD OEM" documentation.

04h(word)HB1 = Size of first header block, in bytes.
06hPalette data begins here. Each entry occupies one word.
Palettes start with color 0. Entries are as follows:
2-Color graphics palette (2 entries);
4-Color graphics palette (4 entries);
16-Color graphics palette (16 entries);
Text mode palette (16 entries).
052h(word)X1 {upper left corner} to print.
054h(word)Y1
056h(word)X2 {lower right corner} to print.
058h(word)Y2
05Ah(word)0=disable form-feed after printouts; 1=enable; 2=FF only
05Ch(word)1=LPT1..3=LPT3; -1=COM1..-4=COM4
05Eh(word)Enlargement factor: 0=Reduction, 1=1x, 2=2x, 3=3x, 4=4x 5=1.5x (Version 2.50 & above only)
060h(word)256-Color mode Color Divisor
062h(word)0=Disable user-adjustable crop box; 1=enable
064h(word)Centering (1=Left, 2=Right, 3=Center)
066h(byte)Vertical Centering (1=Top, 2=Bottom, 3=Center) (Version 2.50 & above only)
067h(byte)TSR Flags:
068h(word)Orientation: 0=Auto, 1=Portrait, 2=Landscape
06Ah(word)Crop box, color of "Currently Adjusting" corner
06Ch(word)Crop box, color of other corner
06Eh(word)[Reserved]

Following table starts at offset 052h + HB1 (e.g., if value at offset 04h is 001E, the table will be at 0070h):

OffsetContents.
+00h(word)Number of data words following [size of header]. With EGAD 2.41 and 2.50, this entry will be 000Ch.
+02h(word)EGAD Version identifier.
<241 EGAD Version 2.40 or earlier
241 EGAD Version 2.41
> 2500 EGAD Version 2.50.0
[Current and future versions will follow the convention:
major_version * 1000 + minor_version * 10 + revision
for example EGAD 2.50 would be 2500.]
+04h(word)PSP of TSR copy of EGAD [only when memory resident.]
+06h(word)Number of different graphics mappings available on this printer [e.g. a driver able to print the following resolutions: 320x200, 640x200, 640x350, 640x480, 720x348, Reduction would have 12 mappings if both portrait and landscape were offered for each mode.]
+08h(byte)Number of primary mappings [in preferred orientation] [usually above variable / 2.]
+09h(byte)Printer graphic byte orientation. 0=vertical [matrix] 1=horizontal [laser].
+0Ah(word)Number of different printer resolutions supported
+0Ch(word)Pointer to first graphics mode structure
+0Eh(word)Pointer to first pattern table
+10h(byte)Number of dithers used
+11h(byte)0=black and white; 1=color printer
+12h(byte)Number of dither levels ('colors') per dither table
+13h(byte)Number of printer color buffers (1=B&W; 3=CMY; 4=CMYK)
+14h(byte)Bytes per dither level
+15h(byte)Printer Graphics mode flags:
            +---+---+---+---+---+---+---+---+
            |NOT|RUN|COL|HEX| - | Gfx_Type |
            +---+---+---+---+---+---+---+---+
            Gfx_Type 0= 2 binary bytes, LSB first (Epson)
            1= 2 binary bytes, MSB first
            2= decimal ASCII digits (HP, NEC)
            3= Data Quoting (Okidata)
            4= Bit set for graphics data (MPI)
            5= Fixed graphics data length
            HEX TRUE if expand to ASCII hex digits (PostScript)
            COL TRUE if send count of COLUMNS (not BYTES)
            RUN TRUE if printer supports Run-length compression
            NOT TRUE if invert binary values to printer
+16h(word)Pointer to dither table