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.
| Offset | Contents | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 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:
* 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:
Printer Manufacturer Codes:
Printer Model Codes: (** indicates defined but not yet used) For Manufacturer = 0 (HP):
For Manufacturer = 1 (Epson):
For Manufacturer = 2 (IBM):
Other Model codes are defined and can be found in "EGAD OEM" documentation. |
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 04h | (word) | HB1 = Size of first header block, in bytes. | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 06h | − | Palette 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):
| Offset | Contents. | |
|---|---|---|
| +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 |