[comp.sys.att] wrastop on 7300 ?

elh@vu-vlsi.UUCP (Edward L. Hepler) (08/18/87)

I have been trying to use the wrastop(3T) function on my 3b1 with no
success.  I get a -1 returned with a perror() of "Bad Address".

The call looks somethine like:

wrastop(pw,
	ptr->where.address.pixrectptr,(short)((ptr->width+15)>>4),
	(unsigned short *)0,(short)0,
	(short)0,(short)0,
	(short)hh-ptr->xOffset-xscreen,(short)vv-ptr->yOffset-yscreen,
	(short)ptr->width,(short)ptr->height,
	SRCSRC,DSTOR,
	(unsigned short *)0)

where pw is the window number (from wcreate) and ...pixrectptr is a
pointer to an array of unsigned shorts (I know, it looks like a SUN
pixrect...).

I have used the Sun raster-op calls, so I am familiar with what should
be happening and I have printed the values that I am sending with
the wrastop call. All look OK.

Is there some trick that I need to know? What does the error really mean?
I looked at INTRO(2) and it says that Badd address refers to a hardware
fault while attempting to use an argument of a system call... Any ideas
which argument???

I am trying to place TeX fonts on the screen in support of a TeX previewer...

Thanks,

Ed Hepler
elh@vu-vlsi

elh@vu-vlsi.UUCP (Edward L. Hepler) (08/18/87)

In article <1067@vu-vlsi.UUCP>, elh@vu-vlsi.UUCP (Edward L. Hepler) writes:
> I have been trying to use the wrastop(3T) function on my 3b1 with no
> success.  I get a -1 returned with a perror() of "Bad Address".
> wrastop(pw,
> 	ptr->where.address.pixrectptr,(short)((ptr->width+15)>>4),

                                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^

I found that I misread the manual page on wrastop (Stupid me!).  I assumed
that since the address was a short that the width was the number of shorts.
NO. The width is the number of bytes. (It also seems that the number of bytes
must match the number of shorts*2). (Even if the actual width is only 7 pixels
(for example)).

Thanks,

Ed Hepler
elh@vu-vlsi