home *** CD-ROM | disk | FTP | other *** search
/ 17 Bit Software 1: Collection A / 17Bit_Collection_A.iso / files / 1036.dms / 1036.adf / PrtDriver / POSTER < prev    next >
Text File  |  1977-12-31  |  4KB  |  86 lines

  1. Article 9844 of comp.sys.amiga:
  2. Path: mcdsun!noao!hao!ames!amdcad!sun!pitstop!sundc!seismo!uunet!mnetor!utzoo!utgpu!utfyzx!oscvax!rico
  3. From: rico@oscvax.UUCP
  4. Newsgroups: comp.sys.amiga
  5. Subject: Re: mysteries of printer drivers  LONG!
  6. Summary: Here's an example
  7. Keywords: printer, driver, example, source
  8. Message-ID: <525@oscvax.UUCP>
  9. Date: 28 Oct 87 03:42:20 GMT
  10. References: <9312@ut-sally.UUCP> <518@oscvax.UUCP> <2594@cbmvax.UUCP>
  11. Reply-To: rico@oscvax.UUCP (Rico Mariani)
  12. Organization: Ontario Science Centre, Toronto
  13. Lines: 1090
  14.  
  15. In the spirit of previous GURU oriented postings, here's another one
  16. that I hope will help someone out there.   It's a printer driver
  17. for the toshiba 3 in one printer in its Qume (best) mode.  I hadn't
  18. ever seen the source for a printer driver posted before so hopefully
  19. this will make a good example for everyone out there.  It's implemented
  20. in Aztec C + assembler but porting it to Lattice + assembler should be
  21. simple.  The rendering function is a *minimal* graphics output generating 
  22. function, no attempt was made to optimize out unecessary print passes
  23. etc.  But this could be easily added.
  24.  
  25. This code was developed by me here at the Ontario Science Centre as part
  26. of my work (i.e. we needed this driver) and I've been authorized to
  27. release it to the public domain.  You may slice dice or whatever.  Needless
  28. to say there's no warranty etc. etc.  All usual disclaimers apply.
  29.  
  30.  
  31. Noteworthy items:
  32.  
  33.    - Aztec C doesn't preserve a6 across function calls.  This is required
  34.      in the printer driver code so special inline assembler was added
  35.      to the render() and dospecial() functions.  Look out for this 
  36.      Aztec users!
  37.  
  38.    - The toshiba is actually capable of printing 24 pixel rows at 360
  39.      dots/inch in a print pass however the printer.device didn't seem
  40.      to cope with this very well.  With these numbers in the printertag
  41.      the printer device would simply call "case 5" (pre initialization)
  42.      of the render function and then not send any other data.  No fuss,
  43.      no muss, no data.  When I reduced the 360 to the next best print
  44.      mode (180) all was well.  Sigh.  If anyone can shed some light on
  45.      this I'd appreciate it.
  46.  
  47.    - I've stolen the debugging code from the dos handler that Matt Dillon
  48.      recently posted and used this in my driver for debugging output. You
  49.      folks out there should think about using it to get debugging output
  50.      where you never dreamed it was possible.  The debugging package is a
  51.      really terrific little subsytem.  Thanks Matt!
  52.  
  53.    - I've also stolen the flush program from the dos handler, you can use
  54.      this for devoloping printer drivers as it will cause your Expunge
  55.      code to be run.  The next time you use the printer device your code
  56.      will be re-loaded, hence you can make recompile etc. and test your
  57.      new driver without resorting to preferences trickery.  Not to mention
  58.      testing your Expunge code...
  59.  
  60.    - Speaking of Expunge code, mine doesn't work when the debugging is
  61.      enabled.  Works perfectly in normal use though... oh well :-(
  62.      If I ever figure it out I'll post the fix.  Meanwhile if any of
  63.      you figure it out...
  64.  
  65.    - If you're writing a printer driver do whatever it takes but get
  66.      Carolyn's Cmd program.  This lets you easily "see" your driver's
  67.      output which is a must for testing.  I used this for my debugging
  68.      output before I installed Matt's code.  If you're checking the
  69.      output by eye then it sometimes helps if there's readable diagnostics
  70.      intermixed.   Thanks Carolyn!
  71.  
  72.    - To compile with debugging enabled just supply the -DDEBUG flag to
  73.      "cc" and -EDEBUG to "as".  Lattice people will have to use whatever
  74.      flags it is they use to predefine symbols in the compiler/assembler.
  75.  
  76. Enough babbling... here's the source + binary (uuencoded + shar'd)
  77.  
  78. --
  79. {watmath|allegra|decvax|ihnp4|linus}!utzoo!oscvax!rico
  80. or just rico@oscvax.UUCP if you're lucky
  81.  
  82. [NSA food: terrorist, cryptography, DES, drugs, CIA, secret, decode]
  83. [CSIS food: supermailbox, tuna, fiberglass coffins, Mirabel, microfiche]
  84. [Cat food: Nine Lives, Cat Chow, Meow Mix, Crave]
  85.  
  86.