iPRN II (C) Peter Missel 1994-1997

"Yet another printout accelerator..."

Yes. Another one. But this one features printer state tracking.
And it is really fast. Almost 40 times the printing speed TOS yields
can be achieved.

"What does that mean, printer state tracking?"

Well, in addition to what you expect from a printout accelerator,
accelerating printout, iPRN II knows whether the printer is just busy printing
or is in an error condition (offline, power off, no paper, not connected...).
Thus the system always knows in advance whether or not the printer is 
ready to receive data.
In a nutshell, the annoying 40 second delay after giving a "Print" command
without having the printer ready is GONE. The error message appears instantly.


iPRN II is shareware. Demo versions (program file IPRN2D.PRG, version numbers
2-xx instead of 2.xx) may freely be distributed, but only in the complete
and unchanged IPRN2xxD.LZH package. 


Restrictions in the demo versions:
- Only the first printout is fully (i.e. GEMDOS-) accelerated
- The state tracking only works once per session.
  After the printer has once been offline and gone back online, the
  state tracking deactivates. The system continues normally, only the
  "printer memorial delay" is back.
- No control panel module:
  - no timeout configuration
  - no state tracking enable/disable (it disables by itself anyway)
  - no deskjet activation

Registered versions 2.00 and up cost DM 25,- in Germany and $20 elsewhere.


Registration
============
Europe: Send DM 25 / US$20 to this bank account:

Peter Missel, Stadtsparkasse Augsburg, BLZ 72050000, Kto. 1301522.
In the "usage" field, write "iPRN Firstname Lastname"

For proper identification of your payment, send a postcard to:
Peter Missel
Greiffstrae 11
86157 Augsburg
Germany.

Or send eMail to Peter_Missel@a.maus.de.


Alternatively, you might want to use the UK registration office run
by Denesh Bhabuta. Here are his instructions (address is listed in 
these instructions):

** iPRN registration via Denesh Bhabuta's CyberSTrider is 13 UKP plus 
extra for the required masterdisk, unless you ask for the full 
version to be sent to you via email (see below) **

 How to register/order in the UK
 -------------------------------

 If you require Masterdisks please add 1UKP per program, or 0.80UKP per 
 program if registering 5+ programs. Please note the different postage 
 and packing details for commercial items.
 1) Use the included ORDER_FM.TXT or ORDER_FM.UK to select required products
 2) Make a cheque or Postal Order payable to CYBERSTRIDER for total amount
 3) Don't forget to include your details
 4) Send completed order form and payment to CyberSTrider


 How to register/order from outside the UK
 -----------------------------------------
 If you require Masterdisks please add 1.50UKP (for 1 program) and 1.20UKP 
 per prg (for 2-4 programs) and 1 UKP per prg (for 5+ programs) to the 
 total order to cover postage. Please note the different postage and 
 packing details for commercial items.
 Send the money via one of the following methods:
 - A cheque payable in *Pounds Sterling* drawn on a *UK* bank address
 - A Eurocheque
 - An international Post Office Girocheque payable in *Pounds Sterling*
 - An international money order payable in *Pounds Sterling*
 - A cheque in your own currency (add 6 to the total fee for bank
   charges)
 - Cash - in Pounds Sterling, Dollars and DMs. Send cash at your own
   risk... and in a Registered Letter!

 Contact
 -------
 Mail: CyberSTrider, PO Box 2023, Wickford SS12 9RX, UK
 E-mail: General queries - dbhabuta@cix.compulink.co.uk
                           denesh@cyberstrider.org
         Support queries - support@cyberstrider.org
         Feedback        - feedback@cyberstrider.org                
 WWW: http://www.cyberstrider.org



Benchmarks (in characters per second)
=====================================

                                BIOS                 GEMDOS
System                          without/with iPRN    without/with iPRN II
-------------------------------------------------------------------------
ST, 8 MHz, TOS 2.06               1800  13500          1650  >64500
ST, 16 MHz, TOS 1.04              3200  >17200
Falcon030, TOS 4.04               3500  up to 36100 *  2930  >115000
Falcon030, TOS 4.04, display off  4500  up to 39370 *        >115000
Falcon030/32 MHz, display off     4800  up to 39370 *        >115000
TT030 w/o FastRAM, TOS 3.06       5600  up to 34100 *
TT030 w/ FastRAM, TOS 3.06          ?   up to 41000 *         >72000

("greater than" values are benchmarked ones where the system could have
gone faster, but the printer wasn't fast enough.)

* On 68030-based machines, speed depends on the position of
  driver and software in the CPU's cache; in a worst-case scenario,
  speed will be 20% less than the given maximum, normal average
  will be about 5% less.
  iPRN II's GEMDOS printing code fits completely into the 68030
  instruction cache, so that the above speeds can be achieved in almost
  any situation.


Installation
============
IPRN2.PRG is for your AUTO folder. It should be the physically last 
program there. MiNT users must place it in front of MINT.PRG or MINTNP.PRG.

IPRN2.CPX is a Control Panel Extension and must be copied into the folder
where all the others already are. Usually this is C:\CPX\. It is not included
in the demo version.


Operating
=========
There is nothing to operate on IPRN2.PRG (or IPRN2D.PRG for the demo version).
Your system automatically starts it from the AUTO folder, and it installs. 
If the installation fails, there will be an error message like "already 
installed" or "Printer port already in use" if the program already is 
installed or if another program hogs the printer port interrupt.
The Demo version will ask you to type "iPRN II<Return>" on system startup.
If you don't, it simply will not install. (Graphics card owners: Your system
will seem stuck in the boot sequence with the screen still blank; unless
you have some sort of boot screen redirector, you have to do the typing
without visual feedback.)

The Control Panel module is for program configuration.
- "Offline Timeout" is the maximum delay (while printing) in seconds before 
  the printer (being in BUSY state) is declared absent and an error condition
  is reported to the application program.
- "End-of-job delay" is the time frame in seconds (after the last byte 
  printed) within which a printer BUSY condition will be considered
  normal, error messages being suppressed meanwhile.
- "Printer state watchdog": Interrupt driven printer state tracking.
  May be enabled or disabled by the user at any time. Disabling it is 
  recommended before using a program that prints in some kind of 
  "Direct to Hardware" mode.
- Clicking "OK" or "Save" will also wake apathetic HP Deskjet printers.

The Control panel module is included with the registered versions only;
demo versions have "Offline Timeout" set to 45, "End-of-job delay" set to 2
seconds, and the "Printer state watchdog" disables after the first printer
error.


iPRN II useful side effects:

- The STROBE signal generation is independent from system speed. iPRN II
  works fine on any system, even those faster than the TT.

- Screen hardcopies are also accelerated; there also is no absent printer
  delay here.

- On system reset, the undefined garbage byte TOS sends to the printer is
  suppressed. Instead, a defined garbage byte (binary zero) is sent.
  It can't be completely supressed, as this is a bug in TOS (up to 1.04,
  at least).
  

Unwanted side effects:

- Application programs that print by accessing the printer port hardware 
  directly (instead of properly using GEMDOS or BIOS) will cause two 
  interrupts per byte printed. This will slow _these_ printouts down 
  (not much, luckily).
  This applies to some older programs like Calamus 1.x or Signum!2.
  (For the latter, there is a Freshup package available fixing this.)
  Registered iPRN II users can deactivate printer state tracking before
  using these programs.

- Many programs do not care about the error conditions the BIOS print function
  returns, so that the printer may not be turned offline while printing.
  iPRN II will supress offline error messages within 2 seconds after the last
  byte printed (this value can be configured in registered versions).
  This provides the user with more time to add paper, replace ink cartridges
  or whatever. Data will not be lost until the "big" timeout occurs, which
  is 45 seconds in the demo version and configurable in registered ones.
  After this time has passed without the printer being back online, 
  bytes will get lost and your printout will feature some additional
  special effects.
  This will also happen with plain TOS and is nothing to do with iPRN II.

- Similarly, the GEMDOS functions' return and error codes aren't 
  correctly treated or at all handled by various application programs.


Contraindications:

- Do not use with incompatible printer port hardware like on GEMulator or
  JANUS boards in DOS PCs or Mag!C Mac.

==============================================================================

Technical details: iPRN II hooks to the BIOS trap vector (XBRA ID is "iPRN")
and captures Bconout( 0, ... ) and Bcostat( 0 ) calls. Using the same ID, it
also installs in the GEMDOS trap vector and captures calls to Fcreate, Fopen,
Fclose, Fwrite, Fdup and Fforce, as far as printing is concerned. It also
installs in the xconout0, xcostat0, prv_lst, prv_lsto and resvector vectors.
It activates and uses MFP interrupt I0. A cookie "iPRN" is registered, with
its value being a pointer to configuration variables changeable through the 
Control Panel module. (Registered versions only, the demo versions' cookie 
value points to garbage.)

Functional improvements over TOS are:
Bcostat( 0 ), as opposed to the original call in TOS, always returns a proper
value, even during a printout, when TOS returns kind of a random value.
iPRN's Bcostat( 0 ) will as usual return -1 for "ready" and 0 for "not ready",
only that a normal BUSY condition will be considered "ready".

Fopen, Fcreate and Fdup immetiately return with error code EDRVNR if the
printer is offline.

Fwrite returns the actually printed number of bytes. On error situations,
this may well be less than the amount of data passed to the function. 
(The original TOS function will always return the amount passed, no matter
if the data were printed or not.)
An application program thus has to handle three possible situations:
- Fwrite's return value is positive and equal to the amount originally
  passed to it. This happens when everything printed OK.
- The return value is positive, but less than the amount passed to it.
  The application program is to inform the user about the printing problem
  and then (if the user chooses to do so) retry by passing the unprinted
  part of the previous data to Fwrite again.
- The return value is negative. In this case, zero bytes have been printed,
  and the return value is a GEMDOS error code, usually EDRVNR.
  The application program is to inform the user as above, and then retry
  by passing the entire previous data to Fwrite again.

==============================================================================

Thanks to:

Thomas Fladerer for trying out and daringly using every single version 
since 0.00;

The beta testers: Franz Blaha, Thomas Fladerer, Robert Federle, Andreas
Kohout, Heinz Ltkebohmert, Michael Nolte;

The non-volunteering testers: Werner Deinbck, Mathias Donat, Michael Ruge,
Walter Vieser.

Atari for hardware documentation, some small pieces of code about interrupt
handling and program startup, and the Control Panel Extension development
tools;

Julian F. Reschke for maintaining the list of programs using XBRA.

Harun Scheutzow for useful assistance in MFP chip wrestling.

Special thanks to Thomas Fladerer, Andreas Kohout and Michael Kunert 
for lending me their printers and not chargeing me for the ink used.


Peter Missel, in March 1997