home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD1.iso / GFX / Cad / INTROCAD1.9.DMS / in.adf / PrtDef / PrtDef_Docs / prtdef.doc < prev    next >
Encoding:
Text File  |  1987-12-15  |  23.2 KB  |  576 lines

  1.           An author's description of IntroCAD PrtDef files
  2.  
  3.  
  4.     A printer definition file ("PrtDef›0m" file) describes, to IntroCAD, the
  5. physical specifications of a single printer when it is in (one or each of its
  6. several) graphics mode(s).  Normally, a PrtDef›0m file also contains information
  7. about the escape sequences which are to be sent to the printer along with
  8. graphics data.
  9.  
  10.     Alternatively, a PrtDef›0m file can be used to describe a "virtual
  11. printer" for the purpose of generating a file which is to be translated into
  12. printer commands and data for an actual printer that IntroCAD cannot be made
  13. to support directly.  In such a PrtDef›0m file it might be convenient to include
  14. messages to the translator program in place of or in addition to the printer
  15. escape sequences. 
  16.  
  17.  
  18.     First, the format of a PrtDef›0m file.  The first line of the file must
  19. begin with the word "PrtDef›0m" followed by whitespace.  The rest of the line
  20. may contain anything at all including nothing.  The remainder of the file is
  21. divided into two sections: the color information section and the graphics
  22. mode description section.  (There is no separating blank line between these
  23. sections, nor are there blank lines between the several graphics mode
  24. descriptions.  Generally, a PrtDef›0m file may contain no blank lines.)
  25.  
  26.     To simplify the following text, let's agree from the start that a
  27. number can be called a "word", since it is an uninterrupted sequence of
  28. non-blank characters.  Numbers which are to be part of escape sequences to be
  29. sent to the printer must be given as two hexadecimal digits.  With one
  30. general exception--the representation of bit masks--all other numbers in
  31. a PrtDef›0m file are decimal.
  32.  
  33.     Most of a PrtDef›0m file is escape sequences.  These are always
  34. represented in the file on a single line in the following manner:
  35.     D H H H H›0m ... H›0m
  36. where D›0m is the decimal number of H›0m's that occur on the line, and where
  37. each H›0m is a hexadecimal number that can be encoded into a single byte.
  38. D›0m is not part of the escape sequence.
  39.  
  40.  
  41. *********************************
  42. * THE COLOR INFORMATION SECTION *
  43. *********************************›0m
  44.  
  45.     The color information section occupies a variable number of lines. 
  46. Generally the number is one greater than the number of colors the printer
  47. supports, but for the special case of a one-color printer the entire color
  48. information section is a single line with a zero in column 1.  For
  49. color-capable printers, the section is terrifically easy to write once the
  50. format is understood.  Unfortunately, the format is quite a bit more
  51. difficult to describe than to understand, and so this description is
  52. long and careful.
  53.  
  54.     The color information section is divided into three parts.  Part
  55. one describes the color capability of the printer to IntroCAD. Part two
  56. lists lists the colors available on the print ribbon, characterizes those
  57. colors with "names›0m" (hexadecimal numbers that represent one byte bit masks),
  58. and includes the escape sequences which select those colors.  Part three
  59. lists the colors which can be printed by mixing two or more of the colors
  60. on the print ribbon and indicates which colors to mix, again with one-byte
  61. bit masks. 
  62.  
  63.  
  64. COLOR INFORMATION: Part 1›0m
  65.  
  66.     Part one is a single line which contains four words.  The first word
  67. is the number of different colors available on the printer ribbon--these
  68. colors will be called "pcolors›0m" in this description; we'll say there are
  69. #pcolors›0m of them.  The printer is assumed capable of switching freely between
  70. pcolors›0m, but will never be directed by IntroCAD to switch in the middle of a
  71. line of graphics.
  72.  
  73.     The second word is the number of additional colors that can be
  74. printed by mixing two or more of the ribbon colors--these colors will be
  75. called "scolors›0m" here; we'll say there are #scolors›0m of them.
  76.  
  77.     Word three of part one specifies the correspondence between IntroCAD
  78. color numbers and printer color numbers.  IntroCAD color numbers run from
  79. zero to fifteen: from left to right and top to bottom as seen in IntroCAD's
  80. "Color" menu; from left to right as seen in IntroCAD's palette requester. 
  81. Printer numbers run from zero to (#pcolors›0m + #scolors›0m - 1) in the order in
  82. which the lines describing them occur in the PrtDef›0m file.  It is assumed that
  83. (part of) the range of colors in IntroCAD exactly reproduces the range of
  84. colors available from the printer. 
  85.  
  86.     Calling the number represented in word three "c_off›0m", the printer
  87. color which corresponds to a given IntroCAD color is:
  88.     Printer_color = ((IntroCAD_color + c_off›0m) % (#pcolors›0m + #scolors›0m))
  89. where "%" is the modulus operator.
  90.  
  91.     The fourth and last word is a hexadecimal number.  It represents
  92. the one-byte code which directs the printer to perform a carriage return
  93. without advancing the page.
  94.  
  95.  
  96. COLOR INFORMATION: Part 2›0m
  97.  
  98.     Part two of the color information section comprises #pcolors›0m
  99. lines.  The first word on each line is the hexadecimal number which forms a
  100. one byte bit map--by which bit map the color is "named›0m".  There is
  101. absolutely no flexibility in this "naming›0m" system: the first color is "named›0m"
  102. "01›0m", the second "02›0m", the third "04›0m", the fourth "08›0m", and so on.  IntroCAD
  103. will enforce this if you don't.  The names, then, give IntroCAD no
  104. information; they are there for your use in writing part three of the
  105. color information section.
  106.     The remainder of each pcolor›0m line represents an escape sequence:
  107. a decimal number followed by exactly that many two-digit hexadecimal
  108. numbers.  The hex numbers form the escape sequence which is to be sent to
  109. the printer to select the pcolor›0m.  There may be at most five bytes in a
  110. color selection escape sequence.
  111.     Printer manufacturers generally recommend that light colors be
  112. printed first when colors are to be mixed.  IntroCAD prints pcolors›0m in the
  113. order in which they appear in the PrtDef›0m file. 
  114.  
  115.  
  116. COLOR INFORMATION: Part 3›0m
  117.  
  118.     Part three of the color information section comprises #scolors›0m lines
  119. of one word each.  The word is the hexadecimal number which is the sum of the
  120. "names›0m" of the pcolors›0m, given in the previous section, which are to be
  121. combined to print the scolor›0m. 
  122.  
  123.  
  124.  
  125. *****************************************
  126. * THE GRAPHICS MODE DESCRIPTION SECTION *
  127. *****************************************›0m
  128.  
  129.     There may be up to four graphics mode descriptions in a PrtDef›0m file;
  130. each description takes six lines which I'll describe one by one.  (Refer to
  131. the appended template files.)
  132.  
  133.     Line one contains instructions to IntroCAD.  This line is very much
  134. more complicated than the rest and so each word on the line will be explained
  135. in detail.  
  136.  
  137.     The first three words on line 1 will be displayed in an Amiga
  138. requester so that the user can know some details of the available graphics
  139. modes.  The first word should be five characters long and followed by a
  140. blank because the first six characters of the line are copied verbatim for
  141. use in the requester; this word should tersely describe the printout a user
  142. can expect from the graphics mode. 
  143.  
  144.     The second and third words are, respectively, the horizontal and
  145. vertical resolutions of the printer expressed in dots per inch.  The fourth
  146. and fifth words are the total numbers of dot locations available on a
  147. page--again, horizontally and vertically, respectively.  These specify the
  148. page size to IntroCAD since the dot resolution has been given.  The number
  149. of dots horizontally usually must agree with information specified later in
  150. an escape sequence.  There is no limit to the vertical size of the page,
  151. but if the number of vertical dot locations is specified as zero, IntroCAD
  152. will enforce the default vertical page size of ten inches.  The sixth word
  153. is the number of print head pins to be used for graphics printing.  The
  154. number of pins must be one of the following: [1,2,3,4,5,6,7,8,16,24].
  155.  
  156.     The seventh and last word on line 1 is the "interlace level›0m".  The
  157. interlace level›0m is one less than the number of passes the print head must
  158. make for each "strip›0m" of printing.  (Here, a "strip›0m" is the area covered by a
  159. single pass of the print head.)  Only printers which use eight or fewer pins
  160. for graphics can be made, by IntroCAD, to produce interlaced printouts.  For
  161. printers which use more than eight pins, the interlace level is ignored but
  162. should, for clarity's sake, be zero. 
  163.  
  164.     Lines two through six normally contain printer escape sequences
  165. encoded in the usual way.  IntroCAD derives no information from these
  166. sequences, but simply converts them to sequences of binary bytes and
  167. parrots those to the printer at the appropriate times.  There may be at
  168. most 24 bytes in each of these escape sequences. 
  169.  
  170.     The first word in each escape sequence line is different from the
  171. rest: it is not part of the escape sequence.  It is the (decimal) number of
  172. bytes in the escape sequence.  It is, therefore, the number of hexadecimal
  173. numbers which follow on the rest of the line. 
  174.  
  175.     Line two contains the printer initialization sequence.  This line is
  176. called "INIT›0m" in the template file.  The INIT›0m sequence is sent once before
  177. printing starts.  Normally this sequence resets the printer and sets the
  178. distance the paper is advanced by the line feed command which will be defined
  179. in line four or five.  Some printers are capable of bi-directional graphics
  180. printing; for these, the initialization sequence must disable the capability
  181. because IntroCAD cannot take advantage of it.  Also, it is a good idea to
  182. include one or more line feeds in this sequence so that the paper tension
  183. during the first pass of the print head will be the same as that during the
  184. remaining passes.
  185.  
  186.     Line three contains the escape sequence which readies the printer to
  187. receive graphics data.  This line is called "GSTART›0m" in the template file. 
  188. It is sent before each pass of the print head. 
  189.  
  190.     For most printers, the GSTART›0m sequence contains either the number of
  191. horizontal locations the print head can assume or the total number of bytes
  192. of graphics data which will be sent during a single pass of the print head.
  193. The number is used by the printer to distinguish graphics data from escape
  194. sequence data and printer manuals normally specify the maximum value of this
  195. number for each graphics mode.  The number must agree with the number on line
  196. one of the graphics mode description which tells IntroCAD how many dots to
  197. print horizontally. 
  198.  
  199. EXAMPLE: For the Epson_LQ-1000 printer.
  200.     The INIT›0m line for the "QUICK" graphics mode is:
  201.         "QUICK 60 60 480 0 8 0›0m"
  202.     The GSTART›0m sequence line for this mode is:
  203.         "4 1B 4B E0 01›0m"
  204.     Here, "E0 01›0m" is the Epson method of specifying the
  205.     number 480--the number that occurs on the INIT›0m line.
  206.  
  207.     Some printers implement a different method of distinguishing graphics
  208. data from escape sequence data: a special character, different from any
  209. possible graphics data "character", is used to end graphics printing. 
  210. IntroCAD does not support such printers directly unless very special and
  211. difficult-to-describe circumstances obtain.  A translator program is normally
  212. required. 
  213.  
  214.     Line four contains the escape sequence which is sent immediately
  215. after a complete strip›0m of graphics data.  This line is called "STRIP_FEED›0m"
  216. in the template file.  For non-interlaced printing, a complete strip›0m is
  217. the data for a single pass of the print head.  For interlaced printing it
  218. is the data for (interlace level›0m + 1) passes, plus the "LACE_FEED›m" escape
  219. sequences--described later--which are sent after each pass but the last.
  220. For non-interlaced printing, this sequence normally instructs the printer
  221. to simply do a carriage return and line feed. 
  222.  
  223.     Line five is ignored if the interlace level›0m specified on line one
  224. is zero.  Otherwise, it contains the escape sequence which instructs the
  225. printer to do a carriage return and the tiny paper advance appropriate
  226. for interlaced printing.  This line is called "LACE_FEED›0m" in the template
  227. file.
  228.  
  229.     The sixth and last line contains the escape sequence sent after
  230. printing is finished.  This line is called "CLOSE›0m" in the template
  231. file.  Normally this will be simply a form feed. 
  232.  
  233.  
  234.  
  235. *****************
  236. * SPECIAL NOTES *
  237. *****************›0m
  238.  
  239.     About the data bytes: The most significant bit of the first byte
  240. maps to the topmost pin of the print head, the MSB of the second byte (if
  241. there is one) maps to the ninth pin from the top, and so on.  This
  242. assumption, on the part of IntroCAD, is perhaps the major source of
  243. incompatibility with printers IntroCAD doesn't support. 
  244.  
  245.     The size of a line feed, normally encoded into the INIT›0m escape
  246. sequence should be equal to the number of print head pins used for graphics
  247. multiplied by the pin spacing.  Printer manuals rarely document the pin
  248. spacing and one must usually resort to trial and error here.  For eight pin
  249. printers, the spacing is normally either two or three times the smallest
  250. possible page advance: if that advance is 1/216 in. or 1/144 in., the pin
  251. spacing is almost certainly 1/72 in.--a very common spacing.  For 16 and 24
  252. pin printers emulating eight pin graphics modes, the pin spacing is usually
  253. either 1/60 in. or 1/80 in.
  254.  
  255.  
  256.     There is a potential problem with serial printers because the author
  257. of the PrtDef›0m file cannot know in advance whether or not the MSB of each data
  258. byte will be appropriated by the SER: device for use as a parity bit.  The
  259. user has complete control of this bit via Preferences.  If this bit is
  260. unavailable for graphics and the PrtDef›0m file indicates that all eight bits
  261. are to be used, narrow horizontal blank lines will occur in the printout. 
  262. (Normally though, blank lines indicate an inappropriate line feed size.)
  263. It seems like a bad idea to limit all PrtDef›0m files to seven bits as a
  264. method of avoiding this problem, since most printers do not communicate
  265. serially.  For 16 and 24 pin serial printers, parity cannot ever be used
  266. because IntroCAD demands all eight bits of every data byte.
  267.  
  268.  
  269.     For some printers, there is a hidden difficulty that makes the
  270. writing of a PrtDef›0m file for interlaced or color printing almost into a
  271. matter of trial and error.  The difficulty is that many printers buffer data
  272. as it arrives and only print the buffered data on receipt of one of a small
  273. number of control codes.  (The code for a carriage return can usually be
  274. relied on to cause a buffer flush.)  For such printers, the STRIP_FEED›0m
  275. command must always contain one of those special codes. 
  276.  
  277.     Interlaced and color printing can present apparent problems with
  278. these printers if 1) the desired LACE_FEED›0m and COLOR_SELECT›0m escape
  279. sequences don't happen to contain buffer-flushers, and 2) the printer's
  280. buffer isn't large enough to contain more than a single line of graphics. 
  281. The problem is especially difficult if the only buffer-flusher is a
  282. combined carriage return/line feed.
  283.  
  284.  
  285.  
  286. ***************************************
  287. * IMPLEMENTING AND USING A TRANSLATOR *
  288. ***************************************›0m
  289.  
  290.     If IntroCAD cannot be made to support a certain printer, at least a
  291. program can be written to translate IntroCAD's output into something that
  292. printer will accept.  Since IntroCAD can direct its output to a file, as well
  293. as to the PAR: and SER: devices, the use of a translator is certainly
  294. practical.  Since the Amiga multitasks, such use can be nearly transparent. 
  295. Obviously, writing a translator requires detailed knowledge of the file
  296. IntroCAD is to write. 
  297.  
  298.     At the time you write the PrtDef›0m file, you will know some of the
  299. numbers which describe the file IntroCAD will write.  The number of dots to
  300. be printed horizontally, for example, is "hardwired" into the file.  You can
  301. cause the INIT›0m string to contain a message to the translator program, giving
  302. it this information.  This might be nice if you want to use more than one
  303. printer resolution and don't want to have to keep track of sevaral
  304. translator programs. 
  305.  
  306.     You can never know in advance, however, what the number of dots to
  307. be printed vertically will be since it depends on the drawing and how it is
  308. scaled.  All that's required to work around this problem is the ability, on
  309. the part of your translator, to distinguish the CLOSE›0m string from the
  310. GSTART›0m string--quite easy if the CLOSE›0m string is a form feed. 
  311.  
  312.     Your translator will probably need to know how many bytes each
  313. escape sequence comprises.  The easiest way might be to prepend the number
  314. to the sequence--that is, put the (hex) number in the PrtDef›0m file so that
  315. IntroCAD will write it as the first byte of the sequence, and arrange that
  316. the translator "eat" the byte and send the rest of the sequence to the
  317. printer.
  318.  
  319.     Certainly you can get IntroCAD to "print" the graphics to disk or
  320. to RAM:.  It would be nice if you didn't have to manually run your
  321. translator in the background each time you printed a drawing, though. 
  322. Also, it would be nice if you didn't have to always have enough space
  323. available (possibly as much as a megabyte) for an entire print dump.
  324. There are two solutions I know of. 
  325.  
  326. 1)    Use Matt Dillon's PIPE: device.  This solves the memory problem,
  327.        but you still have to run a background job each time you print.
  328.        An example: you tell IntroCAD to print to the "file" PIPE:myfile.
  329.        In a background CLI, you run the command
  330.               "translate PIPE:myfile PAR:".
  331.        Here I've assumed your program is called "translate" and that it's
  332.        first command line argument is the name of the input file.
  333.        To run the translator, you will need to remember "Left-Amiga-M"
  334.        brings the Workbench screen to the front because IntroCAD has no
  335.        screen gadgets.
  336.  
  337. 2)    Write an Amiga device driver.  (I don't mean a printer driver
  338.     here, although it might be possible to combine the translator
  339.     function with general purpose printing.)
  340.     This is the prettiest solution, but undoubtedly has the steepest
  341.     learning curve.
  342.  
  343.  
  344.  
  345. **************************************
  346. * APPENDIX A: PrtDef template files. *
  347. **************************************›0m
  348.  
  349.  
  350. -------------- for black-only printers ------------------------------------
  351. PrtDef filename "company name"›0m
  352. 0›0m
  353. QUICK Hdpi Vdpi HDots VDots PrtWires Interlace›0m
  354. INIT›0m
  355. GSTART›0m
  356. STRIP_FEED›0m
  357. LACE_FEED›0m
  358. CLOSE›0m
  359. DRAFT Hdpi Vdpi HDots VDots PrtWires Interlace›0m
  360. INIT›0m
  361. GSTART›0m
  362. STRIP_FEED›0m
  363. LACE_FEED›0m
  364. CLOSE›0m
  365. FINAL Hdpi Vdpi HDots VDots PrtWires Interlace›0m
  366. INIT›0m
  367. GSTART›0m
  368. STRIP_FEED›0m
  369. LACE_FEED›0m
  370. CLOSE›0m
  371. ---------------------------------------------------------------------------
  372.  
  373. ---------------- for color printers ---------------------------------------
  374. PrtDef filename "company name"›0m
  375. #pcolors #scolors color_offset CR_no_LF›0m
  376. 01 codes for pcolor #0›0m          \               \
  377. 02 codes for pcolor #1›0m           | primary       | if no colors,
  378. 04 codes for pcolor #2›0m           | colors        | these lines
  379. .                                |               | do not occur
  380. .                                |               | in PrtDef file.
  381. .                               / ________       | There must be exactly
  382. smask1›0m  smask is logical AND    \                | (#pcolors + #scolors)
  383. .       of above pmasks          | secondary     | lines here.
  384. .       (01, 02, 04...) for      | colors        |
  385. .       pcolors which contribute |               |
  386. .       to this scolor           |               |
  387. smaskn›0m                          /               /
  388. QUICK Hdpi Vdpi HDots VDots PrtWires Interlace›0m
  389. INIT›0m
  390. GSTART›0m
  391. STRIP_FEED›0m
  392. LACE_FEED›0m
  393. CLOSE›0m
  394. DRAFT Hdpi Vdpi HDots VDots PrtWires Interlace›0m
  395. INIT›0m
  396. GSTART›0m
  397. STRIP_FEED›0m
  398. LACE_FEED›0m
  399. CLOSE›0m
  400. FINAL Hdpi Vdpi HDots VDots PrtWires Interlace›0m
  401. INIT›0m
  402. GSTART›0m
  403. STRIP_FEED›0m
  404. LACE_FEED›0m
  405. CLOSE›0m
  406. ---------------------------------------------------------------------------
  407.  
  408. --------------- sample PrtDef›0m file ----------------------------------------
  409. PrtDef Epson_JX-80 "Epson America, Inc."›0m
  410. 4 4 7 0D›0m
  411. 01 3 1B 71 34›0m !yel
  412. 02 3 1B 71 32›0m !cyn
  413. 04 3 1B 71 31›0m !mag
  414. 08 3 1B 71 30›0m !blk
  415. 03›0m  !grn
  416. 05›0m  !org
  417. 06›0m  !blu
  418. 0C›0m  !brn
  419. QUICK 60 72 480 0 8 0›0m
  420. 11 1B 40   1B 23   1B 55 01   1B 33 18 0A›0m
  421. 4  1B 4B E0 01›0m
  422. 2  0D 0A›0m
  423. 0›0m
  424. 3  0C 1B 40›0m
  425. DRAFT 120 72 960 0 8 0›0m
  426. 11 1B 40   1B 23   1B 55 01   1B 33 18  0A›0m
  427. 4  1B 59 C0 03›0m
  428. 2  0D 0A›0m
  429. 0›0m
  430. 3  0C 1B 40›0m
  431. FINAL 240 216 1920 0 8 2›0m
  432. 12 1B 40   1B 23   1B 55 01   1B 33 01   0A 0A›0m
  433. 4  1B 5A 80 07›0m
  434. 2  0D 0A›0m
  435. 9  0D 0A   1B 33 16   0A   1B 33 01›0m
  436. 3  0C 1B 40›0m
  437. ---------------------------------------------------------------------------
  438.  
  439.  
  440.  
  441. ********************************************
  442. * APPENDIX B: Details of the print output. *
  443. ********************************************›0m
  444.  
  445.     Probably the best way to concisely illustrate the format of the print
  446. output is to give pseudo-code examples of the routine that generates that
  447. output.  In the following examples, the words INIT›0m, GSTART›0m, STRIP_FEED›0m,
  448. LACE_FEED›0m, CLOSE›0m, and CR_no_LF›0m refer to the escape sequences named and described above. 
  449.  
  450.  
  451. --- non-interlaced black-only printing ------------------------------------
  452. send INIT›0m
  453. for (i=0; i<num_lines; i++) {
  454.    generate DATA
  455.    if any of DATA are non-zero {
  456.       send GSTART›0m
  457.       send DATA
  458.    }
  459.    send STRIP_FEED›0m
  460. }
  461. send CLOSE›0m
  462. ---------------------------------------------------------------------------
  463.  
  464.  
  465. --- black-only printing with Interlace = 1 --------------------------------
  466. send INIT›0m 
  467. for (i=0; i<num_lines; i++) {
  468.  
  469.    generate PASS_0_DATA and PASS_1_DATA
  470.  
  471.    if any of PASS_0_DATA are non-zero {
  472.       send GSTART›0m 
  473.       send PASS_0_DATA 
  474.    }
  475.    send LACE_FEED›0m 
  476.  
  477.    if any of PASS_1_DATA are non-zero {
  478.       send GSTART›0m 
  479.       send PASS_1_DATA 
  480.    }
  481.    send STRIP_FEED›0m 
  482. }
  483. send CLOSE›0m 
  484. ---------------------------------------------------------------------------
  485.  
  486.  
  487. --- black-only printing with Interlace = 2 --------------------------------
  488. send INIT›0m 
  489. for (i=0; i<num_lines; i++) {
  490.  
  491.    generate PASS_0_DATA, PASS_1_DATA, and PASS_2_DATA
  492.  
  493.    if any of PASS_0_DATA are non-zero {
  494.       send GSTART›0m 
  495.       send PASS_0_DATA
  496.    }
  497.    send LACE_FEED›0m 
  498.  
  499.    if any of PASS_1_DATA are non-zero {
  500.       send GSTART›0m 
  501.       send PASS_1_DATA
  502.    }
  503.    send LACE_FEED›0m 
  504.  
  505.    if any of PASS_2_DATA are non-zero {
  506.       send GSTART›0m 
  507.       send PASS_2_DATA
  508.    }
  509.    send STRIP_FEED›0m 
  510.  
  511. }
  512. send CLOSE›0m 
  513. ---------------------------------------------------------------------------
  514.  
  515.  
  516. --- non-interlaced color printing (2 primary colors) ----------------------
  517. send INIT›0m 
  518. for (i=0; i<num_lines; i++) {
  519.  
  520.    generate COLOR_0_DATA and COLOR_1_DATA
  521.  
  522.    if any of COLOR_0_DATA are non-zero {
  523.       send SET_COLOR_0 
  524.       send GSTART›0m 
  525.       send COLOR_0_DATA
  526.       send CR_no_LF›0m 
  527.    }
  528.  
  529.    if any of COLOR_1_DATA are non-zero {
  530.       send SET_COLOR_1 
  531.       send GSTART›0m 
  532.       send COLOR_1_DATA
  533.       send CR_no_LF›0m 
  534.    }
  535.  
  536.    send STRIP_FEED›0m 
  537.  
  538. }
  539. send CLOSE›0m 
  540. ---------------------------------------------------------------------------
  541.  
  542.  
  543. --- color printing with Interlace = 1 -------------------------------------
  544. send INIT›0m 
  545. for (i=0; i<num_lines; i++) {
  546.  
  547.    for (j=0; j<num_primary_colors; j++)
  548.       generate PASS_0_DATA[j] and PASS_1_DATA[j]
  549.  
  550.    for (j=0; j<num_primary_colors; j++) {
  551.       if any of PASS_0_DATA[j] are non-zero {
  552.          send SET_COLOR[j]
  553.          send GSTART›0m 
  554.          send PASS_0_DATA[j]
  555.          send CR_no_LF›0m 
  556.       }
  557.    }
  558.    send LACE_FEED›0m 
  559.  
  560.    for (j=0; j<num_primary_colors; j++) {
  561.       if any of PASS_1_DATA[j] are non-zero {
  562.          send SET_COLOR[j] 
  563.          send GSTART›0m 
  564.          send PASS_1_DATA[j]
  565.          send CR_no_LF›0m 
  566.       }
  567.    }
  568.  
  569.    send STRIP_FEED›0m 
  570.  
  571. }
  572. send CLOSE›0m 
  573. ---------------------------------------------------------------------------
  574.  
  575. Tim Mooney  12/7/87
  576.