[comp.sys.mac.hypercard] Usenet answers

PUGH@NMFECC.ARPA (03/09/88)

These fellows ask about Hypercard and non-Apple printer drivers:
	tgl@ZOG.CS.CMU.EDU and
	woody@tybalt.caltech.edu (William Edward Woody)

Hypercard makes use of a new print manager call PrGeneral which is documented
in IM V-410.  It is present in Imagewriter drivers >= 2.5 and LaserWriter
drivers >= 4.0, and not in any third party drivers (including SoftStyle's HP
Thinkjet driver that I have). 

Any drivers that intend for Hypercard to use them MUST implement the PrGeneral 
call.

Second:

edmoy@violet.berkeley.edu asks about odd address alignment on the Mac Plus
versus the Mac II. 

The 68000 has an exception condition raised when an odd memory reference
occurs.  The 68020 does not.  That accounts for the difference in behavior you
noticed between the two machines. 

Jon

woody@tybalt.caltech.edu (William Edward Woody) (03/10/88)

In article <44630@sun.uucp> PUGH@NMFECC.ARPA writes:
>These fellows ask about Hypercard and non-Apple printer drivers:
>	tgl@ZOG.CS.CMU.EDU and
>	woody@tybalt.caltech.edu (William Edward Woody)
>
>Hypercard makes use of a new print manager call PrGeneral which is documented
>in IM V-410.  It is present in Imagewriter drivers >= 2.5 and LaserWriter
>drivers >= 4.0, and not in any third party drivers (including SoftStyle's HP
>Thinkjet driver that I have). 
>
>Any drivers that intend for Hypercard to use them MUST implement the PrGeneral 
>call.

(he he he)  Excuse me, but it's 2:00 in the morning, and I'm a little
groggy...

(To PUGH@NMFECC.ARPA:  Please don't sound so rightous about something
you don't completely understand.  Had I had not known better, I would
have wasted several hours following your advice down the wrong trail...
It's late, so please excuse me if this sounds negative...)

Uh, (1) Yes, Hypercard makes use of the new print manager call PrGeneral
documented (incompletely--I used MacNosy to figger out the lil' bugger...)
in IM V-410, and (2) the lack of PrGeneral is not what's making Hypercard
go belly up.  It's the fact that PrDrvrVers() (IM II-163) is returning
0 for every third party driver I've seen, including mine, until Now!
And (as it turns out), if you (1) do set the version number correctly (see
below) in your printer driver, and (2) you DON'T implement PrGeneral AT ALL
(PDEF 7 doesn't even exist!), Hypercard WILL PRINT CORRECTLY.  (Gosh, I'm
so supprised.)  It's almost as if Hypercard isn't looking for PrGeneral...

What's going on is this:  Hypercard calls PrDrvrVers() to get the version
number of the driver, and checks to see if it is greater than or equal to
the constant iPrRelease.  Most third party compiler developers don't know
how to extract PrDrvrVers(), so they don't implement the routine in their
runtime support libraries, but (as Apple has their finger in the pie) MPW
does.

For Third Party Compiler Developers:  How to write PrDrvrVers() glue:
Open the printer driver in question.  Now, get the DCtlEntry for that
driver.  (IM II-190).  Now, get the low-order byte of the
dCtlQHdr.qFlags field in the DCtlEntry.  The low-order byte is the version.
Return version number.

For Third Party Printer Driver developers:  How to set the PrDrvrVers() val:
When your driver gets the Open call, somewhere during your driver open
routine, get your DCtlEntry, and place the version (at least 25 to fool,
er, ah, indicate to Hypercard to use your driver) into the low byte
of the dCtlQHdr.qFlags field.

The version number for the printer driver is placed in the low order
byte of the DCtlEntry.dCtlQHdr.qFlags field.  It says so right here,
buried in the middle of the first paragraph under the subject "The Driver
I/O Queue" in the Device Manager documentation. [IM II-191].  Obscure,
no?

How did I ever figure this out?  I took MacNosy to the _PrLink glue in
MPW, that's how!

Sorry if this is long and confusing, but it's late.  I posted this
in the .Hypercard group because this is where the discussion started,
and into the programmer's group because this is where the discussion
belongs.  Please follow up only in the programmer's group for any
more techno mumbo about drivers.
  -  William Edward Woody
     woody@tybalt.caltech.edu                   (Mac>][n&&/|\)&&(MacII>AT)
Disclamer:  I haven't the foggiest idea what I'm talking about...