home *** CD-ROM | disk | FTP | other *** search
-
-
- PSU
- Printer Setup Utility
-
- Tom Peters
-
- This document describes PSU, Versions 1.0, 1.1, and 1.2.
-
- Version 1.1 doubled the buffer size to 2048 bytes (0800h) and version 1.2
- does a directory of *.PSU and lists any such file on the screen.
-
- PSU IS NOT PUBLIC DOMAIN SOFTWARE! BUT:
-
- PSU may be freely distributed PROVIDED
- 1. that all copyright notices are left intact, and that
- 2. it is distributed with all documentation and other files included, and that
- 3. no charge is made other that normal media costs (<$10).
- 4. all PSU datafiles (*.PSU) contain the copyright notice included with the
- sample files, either in the ID line or the test pattern.
-
- The easiest way to implement item 4 above is to build any PSU
- files using the enclosed SAMPLE.PSU as its basis.
-
- If you find PSU usefull (I'm sure you will) please send a contribution ($20
- suggested) to me. This will enable me to continue to write software.
-
- Tom Peters, 2811 W. Green Tree, Glendale, WI 53209
-
- Using PSU
-
- In order for PSU to work, you must be already able to talk to the printer. If
- it is a serial printer, you may need to issue a command like the ones below:
-
- SETUP LPT1:=COM1
- SETUP COM1:baud,parity,databits,stopbits,P
-
- Where baud, parity, databits, and stopbits are the values appropriate to your
- printer, and P is always specified. (P means "continuous retry on error").
-
- Your computer may use a MODE command similar to the SETUP command; see your
- DOS manual.
-
- Under Concurrent DOS or CP/M-86, you may need to issue the
- appropriate PRINTER n command, where n is the printer number you will be
- using. Also insure that your LPRS file is set up correctly; the LPRS file
- accomplishes the same task as the MODE or SETUP commands.
-
- PSU datafiles
-
- PSU ignores case in filenames. You may enter the name of a file in all caps,
- all lowercase, or any combination.
-
- Case IS significant in the menu, though. Items "c" and "C" may perhaps both
- appear, and they are different.
-
- You may have one or more PSU files on a drive. They all end in .PSU and all
- have a similar structure. PSU must be told which file to use, which you can
- do in any of 3 ways.
-
-
-
-
-
- 1
-
-
-
- 1. DEFAULT: Copy the PSU file you use most often into DEFAULT.PSU. The
- command to do this would look something like that below:
-
- A>COPY OKI192.PSU DEFAULT.PSU
-
- If PSU can find DEFAULT.PSU, and if you invoke PSU without any filename, PSU
- will use the data in DEFAULT.PSU without further input from you. The menu
- that appears in this case will tell you what printer the DEFAULT file assumes
- you have. Henceforth, you could enter the command below to run PSU using the
- DEFUALT data:
-
- A>PSU
-
- 2. SPECIFIED ON COMMAND LINE: If you know that the file TALLY160.PSU exists
- on the current disk, you may specify that file on the command line:
-
- A>PSU TALLY160
- -or-
- C>PSU A:TALLY160
-
- In this case, PSU will use the file TALLY160 without further input from you.
-
- 3. SPECIFIED AT PROMPT: If DEFAULT.PSU is not available, or you type a name
- on the command line that doesn't exist or has something wrong with it, PSU
- will prompt you for the name of the file you wish to use. PSU reports that it
- couldn't find DEFAULT.PSU. It then checks to see if any other PSU files
- exist, and lists any it finds, and asks you to enter one of them.
-
- Note that PSU doesn't understand paths under MS-DOS (tm). PSU.EXE may exist
- in any directory or drive you have a path to, but the datafiles (*.PSU) must
- be in the current directory.
-
- THE MENU
-
- The menu consists of the FILE ID, the MENU CHARACTERS, and the DESCRIPTIONS.
- The FILE ID appears at the top. It just tells you what model(s) printer this
- file is appropriate for.
-
- The MENU CHARACTERS are single letters/numbers/symbols along the left edge of
- the menu. Below is a line from the middle of an average menu:
-
- C Set compressed print (16 CPI)
-
- The menu character above is "C", so entering C will cause Compressed print
- (16 characters per inch) to be activated. The DESCRIPTION in the above
- example is of course "Set compressed print (16 CPI)" and describes what the
- function does.
-
- WHEN DONE
-
- PSU always presents the option "(CR to quit)" at the bottom of the menu. CR
- is shorthand for "Carriage Return" and means press the RETURN or ENTER key.
- This takes you out of PSU. If you enter the PSU menu and see that the ID at
- the top is for a printer other that the one you have, press CR right away,
- rather than confuse your printer with control codes it won't understand.
-
-
-
-
-
-
-
- 2
-
-
-
- TECHNICAL STUFF
- ===============
-
- MAKING YOUR OWN PSU FILES
-
- 1. The file is 2048 bytes long or less.
- 2. All data is plain ascii text. Case matters, BUT hex values may be upper or
- lower case. All hex characters are TWO characters, lead zeros if required.
- 3. The high bit is not ignored, so if the PSU file was created in Wordstar's
- Document mode it probably WON'T WORK. ***Fixed in version 1.2: Only menu
- descriptions need have the hi-bit clear. Hex values will evaluate correctly.
- 4. Item 1 in the file is a label or identifier detailing printers applicable
- and the last revision date of that particular PSU file. The label is ascii
- text and ends with "$". Example:
- OKIDATA 192 & 193 PRINTERS revised 03/08/86
- $
- Note that in the above example, there is an extra cr/lf before the
- terminating dollar-sign. If the menu gets to big for 1 screen, place the
- "$" on the same line as the ID.
- 5. All remaining items are function entries, except the terminator entry.
- 6. A function entry consists of a backslash, the menu option letter, <SPACE>,
- the function description, '$',hex codes, '$'. Example function entries:
-
- \A 10 Characters/Inch$1E$
- \B 12 Characters/Inch$1C$
- \C 17 CPI$1D$
- \D Draft Quality mode$1B 30$
- \Q Correspondence Quality mode$1B 31$
- 7. The last item is a terminating entry:
- \$
-
- The hex codes can be separated by any non-alphabetic character, (except $ or
- \) or not separated at all. All of the examples below will work:
-
- \T Short test pattern$41 42 43 44 45$
- \T Short test pattern$41,42,43,44,45$
- \T Short test pattern$41-42-43-44-45$
- \T Short test pattern$4142434445$
-
- Example setup file:
-
- OKIDATA 192 & 193 PRINTER SETUP FILE 03/08/86$
- \P Set 10 pitch$1E$
- \E Set 12 pitch$1C$
- \C Set 16 pitch$1D$
- \D Go to Draft quality$1B 30 79$
- \L Go to Letter quality$1B 31 79$
- \H Start Enhanced print$1B 48$
- \Z Start Emphasized print$1B 54$
- \C Cancel Emphasized AND Enhanced print$1B 49$
- \0 Skip no lines at bottom of page$1B 25 53 00$
- \4 Skip 4 lines at bottom of page (for performation)$1B 25 53 04$
- \Q Start Underlining$1B 43$
- \N Stop Underlining$1B 44$
- \U Print Unidirectionaly (left-to-right only)$1B 2D$
- \B Print Bidirectionaly$1B 3D$
- \T Set top-of-form to current position$1B 35$
- \F Feed to top of next page$0C$
- \# Print a Test Pattern$41 42 43 44 45 46 47 48 49 4A 4B 4C 4D 4E
- 4F 50 51 52 53 54 55 56 0D 0A$
-
-
- 3
-
-
-
- \$
-
- In the example above, there are too many lines to fit on one screen. One line
- is saved by making the Identifier Line one line instead of two. This is done
- by placing the terminating "$" on the same line.
-
- Setup file names all end with .PSU and are 1-8 characters long. You should make
- the names as descriptive as possible. Some conventions to follow:
-
- 1. Make the name a abbreviation of the make followed by the model number.
- 2. Name the file with the lowest common denominator model number. For example,
- the control codes for the Okidata 192 printer apply the the 193 as well;
- name the file OKI192.PSU
-
- A few notes about the content of the file:
-
- 1. Menu letters: Use all capital letters and minimize the use of symbols, if
- possible.
- 2. Always include a test pattern.
- 3. If the file contains more than 2048 bytes (characters) of date, only the
- first 2048 bytes will be read. If options near the end of the file don't
- appear on the menu, the file may be too long.
- 4. It is often convenient to have \F Form feed$0C$ in the file.
-
- PSU cares little about where carriage returns and linefeeds are.
- The only place you can't sprinkle them in is in the middle of a hex value.
-
- PATCHING PSU
-
- Those of you who are adventurous and know how to use DEBUG can make a few
- patches. The structure of the data area of PSU is shown below.
-
- (The prompts and strings appear here)
-
- BUF_SIZE EQU 0800h
- read_buf db BUF_SIZE dup (0) ; 2048 byte disk read buffer
- read_buf_end db 0 ; address for the end of the buffer
- ; DEFAULT FCB- TRY TO OPEN IF NO DATA ON COMMAND LINE
- DEF_FCB db 00 ; drive code: 0=default, 1=a:, 2=B:, 3=C:, 4=D:
- DFCB_NAME DB 'DEFAULT ' ; FILENAME
- DFCB_TYPE DB 'PSU' ; FILETYPE
-
- You could, for example, patch the byte at DEF_FCB to 01 to force PSU to
- always look on drive A: for DEFAULT.PSU rather than the default drive.
-
- You should not attempt to run any of the code in PSU if you are going to
- patch it. PSU plays games with CS, DS, and ES, so you may not be able to
- find the data. Use the default DS that DOS gives you when debug is started.
-
- Here is a list of approximate locations in the DS. The relationship between
- them shouldn't change, tho the adresses may.
-
- 0000 PSP
- 0100 Stack
- 039E Strings
- 0A07 File read buffer
- 1208 Drive and Name of default PSU file
-
-
-
-
-
- 4
-