🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.micro.mac
Article #6715

Re: Printe available?

#6715
From: Dolf Starreveld
Date: Thu, 07 Aug 1986 10:15
75 lines
3008 bytes
In article <212@unizh.UUCP> burger@unizh.UUCP writes:
>PAP Printer Access Protocol available?
>--------------------------------------
>	.
>	.
>	.
>???????????????????????????????????????????????????????????????????????????
>??  Has anybody out there seen the PAP resource, or even worked with it  ??
>???????????????????????????????????????????????????????????????????????????


Well,  I  needed  this  code  to. It seems that the code you need can be
found  in  a  resource of type PDEF, ID=10 inside thfe LaserWriter file.
The  resource  starts  with several branch instructions to thfe code for
PapOpen,  PapRead,  PapWrite  etc..  If I remember correctly, the branch
instructions are 4 bytes apart, but it might also be 2 (I don't have the
stuff  at  hand at this moment, so I can't look it up). Use ResEd to see
what  it  actually  is.  To  call these routines, you need some assembly
glue, something like:

-----
OpenOffset	equ	0
ReadOffset	equ	1*BrSize	; BrSize is either 2 or 4 (see above)
WriteOffset	equ	2*BrSize
		...

;	Handle to PDEF 10 resource (must be locked) should be in _pdefh.
;
PapDispatch:
	move.l	_pdefh(A5),A0	; Get handle to pap code
	move.l	(A0),A0		; Ptr to code
	lea	0(A0,D0.W),A0	; Address of correct branch instruction
	jmp	(A0)		; Call the routine

_PapRead:
	move.w	#OpenOffset,D0
	bra.s	PapDispatch

_PapRead:
	move.w	#ReadOffset,D0
	bra.s	PapDispatch

	...


Set up your C declarations something like:

pascal void PapOpen();
-----

Off  course  something  similar  for  Pascal users. Let me tell you that
calling  the  routines  in this way did work for me, but I don't like it
when  an  application  which  is  bypassing the original LaserWriter (as
you're going to do and I was doing) still needs to LaserWriter file. Off
course  you can steal the PDEF resource from the LW file (use ResEd) and
put  it  in your own application. I also asked Apple what their official
way of using PAP code was. It has been three months and still no answer!
-- 
			Dolf Starreveld
			Department of Computer Science, UvA

Usenet:			dolf@uva.uucp
			{seismo,decvax,philabs}!mcvax!uva!dolf

Snail mail:		Dolf Starreveld
			Department of Computing Science
			University of Amsterdam
			Kruislaan 409
			NL-1098 SJ  Amsterdam
			The Netherlands

Telefone:		In Holland:    020-592 5137/5022
			International: 31-20-592 5137 or 31-20-592 5022

Telex:			10262 HEF NL
Technical Details
Message-ID: <102@uva.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!lll-crg!seismo!mcvax!uva!dolf
References: <212@unizh.UUCP>

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!caip!lll-crg!seismo!mcvax!uva!dolf
From: dolf@uva.uucp (Dolf Starreveld)
Newsgroups: net.micro.mac
Subject: Re: Printe available?
Message-ID: <102@uva.UUCP>
Date: Thu, 7-Aug-86 06:15:44 EDT
Article-I.D.: uva.102
Posted: Thu Aug  7 06:15:44 1986
Date-Received: Sat, 9-Aug-86 08:34:54 EDT
References: <212@unizh.UUCP>
Reply-To: dolf@uva.UUCP (Dolf Starreveld)
Organization: Computer Science Dept., University of Amsterdam
Lines: 75
Apparently-To: rnews@mcvax