home *** CD-ROM | disk | FTP | other *** search
- ZPLOT Version 1.0 DOCUMENTATION
-
-
- ZPLOT USER'S GUIDE
-
- General Information
- Running ZPLOT
- Application Programming
- ZPLOT Commands
- Pitfalls and Limitations
- Error Messages
-
- INSTALLATION INSTRUCTIONS
-
- Sizing the Memory Map
- Printer Settings
-
- GENERAL INFORMATION
-
- ZPLOT is a program that can produce high resolution graphics on dot matrix
- printers. It reads a disk file created by the application program which is
- used to describe the pictures to be printed, and prints them on an Epson-
- compatible dot-matrix printer.
-
- The application program "plots" by writing simple plot commands to a disk file,
- which is later read and printed by ZPLOT level driver. This file is the key to
- the whole system, because it makes the application program independent of the
- plotting device and vice versa. It also makes it possible to plot pictures that
- were created on different computers or to plot the same picture on different
- types of hardware, such as CRT's and printers.
-
- ZPLOT will work with any printer supporting Epson bit-mapped graphics which
- includes most of the dot-matrix printers on the market today. ZPLOT lets you
- treat your printer as if it were a plotter capable of true vector graphics. All
- future versions of ZPLOT will support the same basic file format and will be
- compatible with each other. ZPLOT was derived from PLOT33 by Tom Speer and uses
- an identical file format.
-
- This documentation describes how to get ZPLOT installed, specifies the format
- for the disk file of plotting vectors (".VEC" files), and gives an overview of
- the user program interface. You will probably want to briefly skim over the
- descriptions below and go right to the Installation section.
-
- Capabilities
-
- ZPLOT's command set includes instructions for device independent graphics and
- commands that provide access to the unique capabilities of specific devices.
- The device independent commands are patterned after a pen plotter's
- characteristics, with a rudimentary capability for filling areas on raster scan
- devices. These device independent commands include the capability to move to a
- point without plotting, to plot points and straight line segments, to change
- the current color, and fill in a trapezoidal area. More complex areas can be
- decomposed into simpler regions for filling.
-
- The device dependent commands include the ability to plot/print a string using
- hardware character capabilities. The Upload command can be used to upload the
- red-green-blue values used for the color table on color graphics terminals (or
- stipple patterns to be used for "colors" on monochrome devices as in ZPLOT).
- The Erase command will clear the screen, establish the background color, or
- advance the page, as appropriate for the type of plotter or display. An Output
- command is used to produce hardcopy output or print the memory map. A general
- instruction that can be used to extend the command set for any other non-
- standard command required rounds out the device dependent commands.
-
- As mentioned above, all future updates to this version of ZPLOT will be
- compatible with the existing plot files and high level software. Future drivers
- are also planned for creating and interpreting the vector command file on
- mainframe computers using Calcomp or Tektronix plotters and terminals. As much
- as possible, the eXtend command should be used for adding neat new features for
- your printer or taking advantage of the capabilities of more advanced devices.
- This will make it possible to maintain the file format as a means of exchanging
- information without a fatal proliferation of exclusive versions.
-
- Acknowledgments
-
- ZPLOT is based on PLOT33, by Tom Speer, and is basically a Z80 version of that
- program, with rudimentary Z3 support (allowing .VEC files to be accessed from a
- different drive/user). The extreme compactness of Tom's .VEC file format was
- the primary attraction, especially if the format is to be used in real-time
- applications, such as driving a CRT display.
-
- RUNNING ZPLOT
-
- To use ZPLOT, first create a sequential disk file of plot commands. These are
- described fully in the next section. Then execute ZPLOT by typing:
-
- ZPLOT ifn [ofn]
-
- ifn is the input file name. A file type of .VEC is assumed if no file type is
- given. [ofn] is an optional output file name. If no output file is given, the
- output from ZPLOT will go directly to the printer (LST: device). If an output
- file is specified, all of the information normally sent to the printer will be
- stored in the disk file instead. In this case, no printed output will be
- produced. PRINT or some other utility may be used to print the picture. This
- option is useful for making multiple copies or for including graphics in the
- middle of text files. The default output file type is .PLT .
-
- Note: Output files are large- typically 40 to 60k. Be sure to leave enough
- space on the disk for the entire file.
-
- APPLICATION PROGRAMMING
-
- Application programs "plot" by writing the appropriate plot command to a disk
- file. This file later becomes ZPLOT's input file. The plotting area is a square,
- with the coordinates (0.0 , 0.0) located at the bottom left corner, and the
- coordinates (1.0 , 1.0) located at the upper right corner. These coordinate
- values are independent of the resolution or aspect ratio of the plotting
- device. ZPLOT converts these values to the actual number of rasters (dots) used
- by the printer to produce a square plot approximately eight inches on a side.
-
- All plot commands are written to disk one after the other, with no spaces or
- delimiting characters between them. Each command consists of an ASCII character
- followed by the binary data which it requires. Many languages, such as BASIC,
- insert extraneous characters, such as carriage returns or line feeds, at the
- end of each block written. Because of this, plotting commands should not be
- split between blocks, as these extra characters will be interpreted as data in
- a command. If the extraneous character occupies the position of a command
- character, however, it can be detected and ignored. The current application
- programs output plot commands in 128 byte blocks. If a command will not fit in
- a given block, the block is written to disk, and the next command written in a
- new block. This ensures that the extraneous characters will fall between
- commands where ZPLOT can deal with them. When using fixed length blocks or
- records, each can be padded with "N"'s to preserve its length before it is
- written.
- The recommended command sequence to produce a picture is:
-
- 1. Set the color to black or white (color values 127 or 0) for a
- background. Usually white is used.
- 2. Erase the picture to initialize the memory map area and establish
- the background.
- 3. Set the color value for plotting. Usually black (127) is used.
- 4. Establish a starting point by using the Move command, plotting a
- single point, or plotting a line segment using the Draw command.
- 5. Proceed to create the remainder of the plot. The Increment command
- is recommended when one line segment is connected to the previous
- one, as in a curve.
- 6. Be sure to include an Output command to print the final plot.
- 7. Use the Quit command to stop plotting. ZPLOT will terminate
- automatically at an end-of-file, but with an error message,
- and without printing the picture.
-
-
- ZPLOT COMMANDS
-
- Each command is of the form:
-
- Adata
-
- "A" represents the single ASCII character as explained below. "data"
- represents 0 to 86 bytes of data required for the particular command. Usually
- this consists of fixed point numbers giving the coordinates of points or ends
- of line segments. No spaces or delimitating characters are used between fields
- within a command or between commands. The individual commands are described in
- Table 1.
-
- The data values required for the plot commands are not ASCII character strings,
- but are binary byte values. The coordinate values are 16 bit fixed point
- binary fractions. This makes the format particularly easy to use in application
- programs written in assembler. Different word lengths, internal storage
- formats, and file structures have to be considered when constructing the
- command file on mainframes and microcomputers not based on the Z80 family. For
- instance on 68000-based machines the reversed byte order should be taken into
- account. The ability to structure a file as a byte stream is the basic
- requirement. The Dump utility can be used to ensure that the contents of the
- file are what you expected.
-
- The 16 bit data values are stored with the low order byte first (swapped
- format). This is the standard way of storing words for the Z80 processor. Note
- that because the data values are not ASCII strings, the TYPE command will not
- properly display the file at the console.
-
-
- TABLE 1
-
- PLOT COMMANDS
-
-
- Command Length
- Name Character Data (bytes) Command Data Description
- ----------------------------------------------------------------------
- Color C b 2 8 bit integer specifying one of a range of
- colors. 0 indicates white, 127 indicates black.
-
- Draw D X1,Y1, 9 Coordinate pairs for ends of line segments.
- X2,Y2
-
- Erase E 1 Sets the entire ploting area to the
- currently selected Color value.
-
- Fill F X1,Y1, 11 Coordinate pairs for ends of line segment
- X2,Y2,Yf and horizontal level (Yf) defines area to
- be filled in with currently selected color.
-
- Incre- I X,Y 5 Coordinate pair for end of line segment.
- ment Starting coordinate is last point plotted.
-
- Move M X,Y 5 Coordinate pair for new "pen" position.
-
- No-op N 1 Ignored. Used as space filler in sequence
- of commands to exactly fill a disk record.
-
- Output O 1 Causes current picture to be printed.
-
- Point P X,Y 5 Coordinate pair for point to be plotted.
-
- Quit Q 1 Commands normal termination of program.
-
- String S X,Y, 6 Coordinate pair for start of character
- string to string to be printed. String
- 86 MUST end with a Carriage Return.
-
- Text T string 2+ String of arbitrary length. String MUST
- end with a <NULL> (00H) character.
-
- Upload U N, 3 N is a 16 bit unsigned integer giving the
- values to number of values to follow. Values
- N+3 specify basis for creating new "colors".
-
- eXtend X N, 3 N is a 16 bit unsigned integer giving the
- values to number of values to follow. Values are N
- N+3 bytes of whatever data is necessary.
-
-
- The following sections describe the way in which the commands have been
- implemented in ZPLOT Version 1.0. Other drivers may not implement them in
- exactly the same way, but the general sense should be preserved.
-
- Colors are simulated in ZPLOT by using stipple patterns. These patterns apply
- to all points, lines, and filled areas. These patterns are based on 8 dot by 8
- dot cells that tile the entire picture area. Imagine cutting each figure out of
- a sheet entirely covered with the desired pattern and then pasting it on the
- plot in progress. This gives a general idea of the way in which the patterns
- work. Three different methods of generating the patterns are used. Each method
- trades off the memory required to store the basic patterns with the ability to
- specify exactly what the pattern will look like.
-
- When a Color command is given, all subsequent plotting will be done with that
- "color", or pattern, until it is changed with another Color command. The Color
- command simply acts as a selector to pick one of a number of colors or patterns
- that are currently available. A color code of 0 corresponds to white. Lines
- and filled areas plotted with this color will absolutely erase any dots that
- were previously plotted. Color codes from 1 through 48 will produce cross
- hatched patterns that generate checkered areas and other distictive patterns.
- Codes from 49 to 63 correspond to 15 special patterns that can be programmed to
- exactly match any desired pattern based on the 8 x 8 dot cells. Codes from 64
- through 127 are generated using an ordered dither matrix, in which each
- succeeding code is the same as the previous one, except for one more dot per
- cell being plotted. These are currently set to generate a range of shades of
- gray. All of these patterns can be changed under the control of the application
- program by using the Upload command.
-
- Each dot is added to the memory map by OR'ing it with the dots previously
- plotted. Each subsequent figure does not totally obscure the existing picture.
- For example, suppose that a gray shade is being used that consists of every
- other dot being plotted. The dots that are not plotted will not cause the
- existing dots to be set to white if they were previously plotted. Negative
- color values (-1 to -127) will use the same pattern as their positive
- counterpart, but will be XOR'ed with the existing picture. This means that the
- figure will be plotted black on white or white on black, depending on what the
- existing background is. Plotting the same figure twice with a negative color
- value will have no net effect on the picture. Filling the whole picture with -
- 127 (negative black) will have an effect like making a photographic negative.
-
- The String command is used to mix printed characters and graphics. The
- characters are printed using the printers normal character set. No facility is
- provided in ZPLOT to send <ESC> codes or control characters to the printer to
- change character sizes or font styles. The string is printed starting near the
- coordinates given in the command. The exact position will vary, but the first
- character will cover the coordinate location. The ambiguity comes from the fact
- that most printers can only print characters at their normal location on the
- page, and can't use graphics commands to position the characters at any
- arbitrary place on the line. In addition, a printed character can't be part on
- one line of print and part on another. Therefore, ZPLOT computes the closest
- character location to the desired coordinates and begins the string there.
-
- The Text command will immediately send a text string to the printer when the
- command is encountered. This is quite different from the String command,
- because the text is not put in the memory map and is not part of the picture.
- This command is useful for positioning the plot on the page, for printing
- titles and headers, and for advancing to the next page after the plot is
- printed. Any ASCII characters may be included in the string, including control
- codes, escape sequences, carriage returns, and linefeeds. The only exception is
- the null character, 00H, which is used to signal the end of the string. The
- string may be of any length. This makes it a convenient way of imbedding a
- figure in the middle of a document, since all of the text above the figure can
- be included in one Text command, as can all of the text after the plot. Any
- text to be included in the plotting area itself must be entered one line at a
- time with the String command.
-
- Upload Command
-
- The Upload command deserves some special attention, because it is the least
- standard of all of the commands currently implemented. Most dot matrix printers
- can, of course, only print in black. To give these printers a "color"
- capability, different patterns have been programmed to produce shades of gray
- and distinctive cross hatched patterns. The cross hatched patterns are intended
- to be used for bar charts, dotted and dashed lines, etc. The shades are the
- closest that ZPLOT can come to true colors. The special patterns are very
- useful for matching patterns produced by other systems, and for anything that
- just can't be done with the other two methods. The Color command acts as a
- selector to choose between the pre-defined patterns. The Upload command is only
- needed if the default patterns are not capable of producing the desired effect.
- It will redefine the patterns from which the Color command can select.
-
- The cross hatched patterns are based on seven bytes that provide the basic
- patterns in both the vertical and horizontal directions for each cell. One byte
- from the seven is selected as the X pattern and one byte from the seven is
- selected as the Y pattern. The X pattern is extended vertically throughout the
- cell, and the Y pattern is extended horizontally throughout the cell. The two
- patterns are reversed (XOR'ed) where they cross. The effect is much like
- weaving a plaid material. The selection of the bytes for the X and Y patterns
- is made by the Color code. The lower three bytes of the Color value select the
- X byte and the next three bytes select the Y byte. The best way to determine
- the exact apperance of each pattern is to experiment by filling blocks with
- different patterns.
-
- If the existing patterns are not acceptable, new ones can be Uploaded. Set the
- number field, N, to 07H. The next seven bytes will be the bytes that form the
- basis for the patterns. Each bit corresponds to a dot in the pattern. A byte
- of 07H for the X pattern would produce the pattern .....*** . If an F0H is used
- for the Y pattern, the final cell will look like:
-
- *****...
- *****...
- *****...
- *****...
- .....***
- .....***
- .....***
- .....***
-
- The second type of pattern, used for the 15 special patterns, is specified by
- giving the 8 bytes that produce the pattern. Thus, the sequence 00H 00H 99H 00H
- 00H 99H 00H 00H will produce the pattern:
-
- ..*..*..
- ........
- ........
- ..*..*..
- ..*..*..
- ........
- ........
- ..*..*..
-
- These patterns are uploaded by specifying 120 for N followed by the 120 bytes
- that define all 15 of the special patterns. No facility is provided for just
- uploading one set of 8 bytes.
-
- The other method for producing patterns for "colors" is an eight by eight byte
- dither matrix. In this method, each byte in the matrix corresponds to one dot
- in the eight by eight dot cell. These cells tile the picture plane, as before.
- Color code values from 64 to 127 are used to select the 64 patterns created by
- the dither matrix. Each element of the matrix is assigned a value from 63 to
- 126. If the Color value is greater than the value in the matrix corresponding
- to a given dot, that dot is plotted. Thus, 127 is greater than all of the
- elements, and all dots in the matrix will be plotted, producing black. If each
- element of the matrix is assigned a different value, then a unique pattern will
- be associated with each Color value. For example, if the Color code is 64, only
- the element with a value of 63 will produce a dot. If the Color value is 65,
- those elements with 63 and 64 will produce dots. As the Color code is
- increased, and figures are plotted, another dot in the "tile" has the potential
- for being plotted.
-
- The existing arrangement of values in the dither matrix is designed to produce
- shades of gray with a minimum appearance of organized patterns. This matrix
- came from Foley and Van Dam's "Fundamentals of Interactive Computer Graphics".
- A common use of the Upload command is to change the matrix to provide diagonal
- patterns for shading areas. This would produce a pattern that looks like (for
- four cells):
-
- ////
- ////
- ////
- ////
-
- To design an Upload sequence for a given pattern, lay out a matrix representing
- a single cell. Start with 63 and place the numbers in the matrix in the pattern
- desired. For example, a cell from the diagonal pattern above could be created
- from the matrix:
-
- 63 111 85 103 75 115 93 95
- 112 64 104 86 116 76 96 94
- 79 105 65 117 87 97 77 121
- 106 80 118 66 98 88 122 78
- 71 119 81 99 67 123 89 107
- 120 72 100 82 124 68 108 90
- 91 101 73 125 83 109 69 113
- 102 92 126 74 110 84 114 70
-
- To see the pattern, look at the matrix part way through its construction:
-
- 63 75
- 64 76
- 65 77
- 66 78
- 71 67
- 72 68
- 73 69
- 74 70
-
- For this matrix, the Color code 79 will result in all of the above points being
- plotted in any filled in area, and the diagonal pattern will emerge.
-
- Once the matrix is constructed, the Upload command to load it is formed by an
- ASCII "U" followed by 40H, 00H to indicate 64 bytes to come, and finally 03H,
- 6FH, etc., the bytes of the matrix. The matrix is read in one row after another
- ( the [1,1] element followed by the [1,2] element, ..., to the [1,8] element,
- then the [2,1] element, ...). All of the matrix values are binary 8 bit values.
-
- To summarize the Upload command: The Color codes from 1 to 48 are produced by
- cross-hatched patterns based on eight pattern bytes. These can by Uploaded by a
- "U" 08H 00H followed by eight new pattern bytes. The Color codes from 49
- throuth 63 are Uploaded by a "U" 78H 00H and the 120 bytes that define the 15
- cell patterns. The Color codes from 64 through 127 are produced by a dither
- matrix. This is created by assigning elements of an eight by eight matrix the
- values 63 through 126. The matrix is Uploaded by a "U" 40H 00H followed by the
- 64 elements in row major order.
-
-
- PITFALLS AND LIMITATIONS
-
- This section amplifies the more subtle points and limitations of ZPLOT's
- commands.
- The valid range for coordinate values is 0 to 1. This corresponds to binary
- integer values from 0 to 32767. As each point is plotted, a check is made to
- insure that the coordinate is within the memory map. If it is not, the point is
- not plotted. This is mainly to keep the program from running amok and writing
- over parts of memory that are not part of the memory map of the picture. This
- is not intended to be a form of windowing. If you want to zoom in on a part of
- a larger picture, the picture should be clipped by the application program.
- Note also, that most high level languages will not deal with positive integers
- that are larger than 32767, as these larger numbers represent negative
- integers.
-
- In contrast to the coordinate values used for all of the graphic commands, any
- coordinate value outside the picture used to indicate the start of printing a
- string will be set to zero. This is intended to make the String command act as
- much as possible like a normal printer. When the string goes off of the right
- hand side of the plot, the X coordinate for the next character will be set to
- zero and the string will wrap around - just like a carriage return without a
- linefeed. All characters that attempt to be printed above or below the plot
- will be printed on the bottom line.
-
- String has a few other points of interest. Only printable characters should be
- used. Control characters and escape codes will occupy their respective
- positions in the memory map but will not be printed. This will cause the rest
- of the line to be shifted to the left and destroy its alignment with the rest
- of the page. Also, the character pitch must agree with the character width set
- at assembly time, or the alignment will be affected.
-
- The coordinates for the start of the string are truncated to the nearest
- multiple of the size of the character. Thus the specified point will be within
- the first character, but the character will not be centered or aligned with the
- given coordinate position. This was done because most printers insist that the
- printed characters occupy these locations, and ZPLOT has to respect this or the
- aligment of the rest of the line will again be affected.
-
- ZPLOT prints the strings, it does not plot them as line segments. Because of
- this, a printed character will absolutely occupy its location on the plot, and
- any overlapping lines or points will not appear. If a character is printed on a
- patterned background, it will appear as if it were in a white box the size of
- the character. If true graphic characters are desired, they must be drawn by
- the application program as line segments. An additional implication of the
- printed characters is is their size relative to the graphic bit images that are
- sent to the printer. The graphics are printed in "strokes" that are one dot
- wide and seven dots high. Many printed characters are higher than seven dots
- especially those that have descenders. A printed character occupies a space
- that is seven dots high in the memory map. Thus, the top line of capital
- letters and the lower case descenders can overlap the graphics area above and
- below the nominal area of a printed character. The distance that the paper is
- advanced between lines is dictated by the height of a graphic "stroke", and is
- nearly always smaller than the normal single spaced distance. Printed lines
- must therefore be "double spaced" by specifying starting coordinates that are
- well separated vertically. This is a device dependent aspect, and a litle
- experimentation may be needed to achieve a good appearance.
-
- The last caution about the String command is that it MUST end with a carriage
- return character. This signals the end of the string, and without it, the
- program will continue to read the rest of the input file as part of the string
- until it either encounters a carriage return or the end of the file. The
- String and Text commands are the only commands with this potential, as all of
- the others have a definite number of bytes of data. All these caveats regarding
- the String command may sound a little gruesome, but it is really not much
- different from normal printing. If its limitations are too inhibiting, you must
- draw the characters instead of printing them.
-
- The Text command is output to the printer at a different time than any of the
- other commands. Its contents are sent immediately when it is read, whereas all
- other commands cause their actions to be stored in the memory map and only
- printed when an Output command is received. Thus, it cannot be used to send
- escape sequences to the printer in the middle of the plot. Whether graphics
- commands (such as Draw, Fill, etc.) preceed or follow a Text command is
- immaterial, since these commands affect the memory map at the time that they
- are read and not the printer. What really matters is the position of a Text
- command relative to the Output commands in the file.
-
- Like the carriage return at the end of the String command, omitting the 0
- byte at the end of the Text command can have disastrous consequences.
-
- The line spacing used in the Text command is different from the line spacing
- in the plot itself. The Output command sets the line spacing to be appropriate
- for graphics, and then resets it to the normal text single spacing when done.
- If a uniform appearance is required throughout, each Text command should
- contain the control characters or escape sequences required to set the line
- spacing to match that used in the plot itself.
-
- The final consequence of the line spacing is that the form length and the top
- of form position set in the printer will be wrong. The Output command will
- result in the printer being positioned at the bottom of the plot. This is to
- allow several plots to be printed sequentially as one continuous picture
- without any gaps between them. In order to advance to the top of the next page,
- the Text command must be used to issue the correct number of line feeds and
- then tell the printer to reset the top of form.
-
- The Output command does not erase the existing picture. Thus several copies
- of the same plot can be produced by repeating the command. In addition, this
- allows building up a picture in stages and printing it at each stage. To print
- one plot and start anew, you must Output the first, set the Color to white,
- Erase the page, and then set the Color back to the plotting color or pattern.
- The program does not automatically execute an Output command at the end-of-file
- or when Quitting. You must include an Output command to get any output at all.
- This philosophy is to accomodate those devices, like graphic terminals, that
- display the plot as it is being made, and only need an Output command for
- hardcopy.
-
-
- ERROR MESSAGES
-
- Disk is Full.
-
- Fatal error. No more room exists on the designated disk for writing the output
- file. Ensure that enough room is available and run ZPLOT again. Note that a
- different drive/user/directory may be specified for the output file than the
- one used for the input file (when running under ZCPR3). If disk space is not
- available, run ZPLOT in the direct printing mode.
-
- Any remnant of the output file may be printed, but the last record will
- probably contain an incomplete graphic output sequence. The printer will expect
- to receive additional bytes of graphics. This will produce a swath of dots with
- a random apperance, unless nulls are sent. In addition, the printer line
- spacing will remain set for the size of the graphic output.
-
- End of File.
-
- Fatal error. The end of the input file was encountered when ZPLOT attempted to
- read the next record. Add a Quit command for the normal termination of the
- program.
-
- File not Found.
-
- Fatal error. The file name given for the input file could not be found on the
- disk. Make sure that the spelling was correct, that the proper drive is
- specified in the file name, or the right drive is logged in as the default
- drive.
-
- No Directory Space Available.
-
- xFatal error. When ZPLOT tried to make a new output file, there was no more
- room in the disk directory. Erase a file, use a different diskette, or run
- ZPLOT in the direct printing mode, without making an output file.
-
- No File Specified.
-
- Fatal error. No input file name was given. ZPLOT will not prompt you for a
- file name, and there is no interactive mode for entering commands. Create an
- input file and try again.
-
- Undefined Command Character Encountered.
-
- Warning error. When ZPLOT attempted to interpret the ASCII letter portion of a
- command, a character was found which did not correspond to one of the
- established commands. ZPLOT ignores these characters and attempts to interpret
- the next character as a command. If a command does not have the proper number
- of data bytes, or if an extraneous character is inserted in the middle of the
- data portion of a command, the rest of the file will be out of sequence.
- Eventually, ZPLOT should get back in step with the command stream, but the
- overall effects are unpredictable.
-
-
- INSTALLATION INSTRUCTIONS
-
-
- SIZING THE MEMORY MAP
-
- ZPLOT has been designed to keep the printer driver program small while
- providing the necessary primitive graphic operations for producing most
- pictures and plots. The reason for the simplicity of the of the command set is
- because the bit map for the picture is LARGE. It can use as much memory as your
- computer can give it. The size of the memory available for the bit-map, in
- conjunction with the resoultion of your printer, sets the size of the plot that
- can be made. The first step in installing the program is to decide how large
- the memory area for the bit map can be. The program itself occupies about 4K.
- Subtract this from the size of the TPA, and reduce the result by a little more
- to provide a conservative pad. The end result is the target size for the size
- of the memory map.
-
- Divide the target size by the printer resolution (dots per inch) in the
- horizontal direction, and divide again by the printer's vertical resolution.
- Multiply this result by 7 (7 dots are stored in each byte). You now have the
- number of square inches that can be plotted. Take the square root, and round
- down to a convenient size for each side of the plot.
-
- Now multiply the height of the plot by the printer's vertical resolution and
- round down to the nearest multiple of 7. The number of dots in the vertical
- direction should be a multiple of 7 because seven dots are stored in each byte
- of the memory map. ZPLOT has no provisions for handling a byte which is
- contains bits that are part in and part out of the map. You now have the total
- number of dots in the vertical direction, and dividing by 7 gives the number of
- lines that will be printed when the plot is made. Finally, divide the number of
- dots in the vertical direction by the vertical resolution to get the final
- size, in inches, of the plot.
-
- Multiply the final size of the plot by the horizontal resolution to get the
- final number of dots accross the page. The final map size is the product of
- the number of dots horizontally multiplied by the number of dots vertically,
- divided by 7.
-
- As an example, consider a 56K system. Subtracting 4K for the PLOT program and
- 100H for the start of the TPA:
-
- Target Size = 57344 - 4096 - 256 = 52992 bytes
-
- The Epson MX-80 has 60 dots per inch horizontal and 72 dots per inch vertical
- resolution.
-
- Target Size/HRes/VRes*7=52992/60/72*7=85.9 sq.in
- ==> 9.2 in. per side
-
- Since the MX-80 can only plot 8 inches horizontally, the plot is limited by
- the physical limits of the printer, not by the memory avalilable. Calculating
- the vertical number of dots for an 8 inch plot:
-
- 8*72=576 dots ==> 82 lines @ 7 dots/line
- ==> 574 dots vertically
-
- Since only 2 dots were lost due to truncating to the nearest number of whole
- bytes, there is little point in trying to adjust the horizontal size to keep
- the plot square. The horizontal size is therefore:
-
- 8*60=480 dots
-
- The final map size is calculated as:
-
- 480*574/7=39360
-
- This is the default size to which the program is set, and if satisfactory, can
- be used as is. Virtually all Epson-compatible printers will accept this setting.
-
- PRINTER SETTINGS
-
- Once the plot has been sized, you are ready to modify the settings in the
- assembly language source file (ZPLOT.Z80), if you require a setting other than
- the default. The relevant equates are near the beginning of the program.
- MAPSIZE should be set to the value calculated above. MAXX and MAXY must be set
- to 1 less than the number of dots in the horizontal and vertical directions.
- For the example above, MAPSIZE becomes 39360, MAXX is set to 479, and MAXY to
- 573. Once the settings are made for your printer, assemble the program using
- ZAS or another Z80 assembler.
-
- DIFFERENCES BETWEEN ZPLOT AND PLOT33
-
- Functionally there are none. Every valid PLOT33 command is a valid ZPLOT
- command and operates identically. However when ZPLOT is operated under ZCPR3,
- it will recognize DU: or DIR: specifications in input or output files. The code
- has been extensively changed to make full use of the Z80 instruction set. All
- the registers are used (if your BIOS trashes IY, then ZPLOT won't work!).
- Despite the extra features, the code is about 1/2K smaller. Since virtually all
- dot-matrix printers today accept the Epson graphics commands, all the
- conditionals in the source code for non-Epson printers has been removed, making
- the source just editable by ZDE (if you have 60k tpa)
-
- FUTURE ENHANCEMENTS
-
- Zplot was intended to be a first step to a permanently resident plotting
- utility, living in banked memory that could be called by a BDOS call by any
- applications program. At the moment, there is no agreed method of handling
- memory over 64k in a portable manner, though writing the code so to do is not
- difficult. I had originally started writing a utility based on HP-GL plotter
- commands, then I discovered PLOT33, by Tom Speer, and decided the command set
- was much more elegant than the HP commands. So the first step was to translate
- PLOT33 into Z80, optimize it for that CPU, and add ZCPR3 support. The result is
- ZPLOT.
- One big improvement possible would be to use the Z280 multiply and divide
- instructions. This program is very multiplication and division intensive and
- would really benefit by having a Z280.
- Next, the error messages should be loaded into the Z3 message buffers instead
- of simply being displayed. With an appropriate error handler enabled, ZPLOT
- should be able to operate very robustly inside aliases.
-
-