[comp.windows.x] TeX

eichin@ATHENA.MIT.EDU (Mark W. Eichin) (03/14/88)

After some meditation:
xdvi [~ftp@charon.mit.edu:pub/x11dvi.tar.Z] now works on the IBM
PC/RT *AND* the VAX.

This required TWO LINES to be changed:
	1) The check for machine-endian-ness was deleted.
	2) image->bitmap_bit_order = LSBFirst.

A new tar file, as well as x11dvi.c.shar are now in place on charon.

My apologies for those (few?) of you who grabbed it and got core
dumps; as should have been fairly clear, I didn't pass a display to
the calls to XGetDefault. This is because I originally wrote it under
X11Beta, where XGetDefault had the X10 syntax and didn't require a
display. 

The current distribution compiles and runs on X11R2 on the IBM PC/RT
(4.3BSD Athena release 6.0a, your mileage WILL vary) and on X11R1++ on
the Vax (I haven't tried it on R2 yet) and between the two in either
direction. Would someone test it on a Sun and let me know what
happens? 

*********************Flash!**********************
Well, I decided to give texx one more try before I sent this message.
By taking the reverse_bytes() routine from xdvi, and putting it in
under #ifdef vax, I also have no problem running it all four ways. 

Even with this piece installed, texx is (well, seems) much faster than
xdvi on either architecture. Again, Sun testers welcomed. 

added to previewers/texx.c, line 944:
#ifdef vax
	/*
	 * This should get some runtime checking. At any rate, this
	 * little routine (taken from reverse_bytes() in xdvi.c) swaps
	 * the byte pairs into the correct order. I am still not sure
	 * why we must do this... [eichin:19880313.1601EST]
	 */
	{
	  register long x,y;
	  register char *bp;
	  register char c;

	  bp = g->g_raster ;
	  for ( y = 0 ; y < g->g_height ; y++) {
	    for ( x = 0 ; x < image->bytes_per_line ; x += 2) {
	      c = *bp ;
	      *bp = *(bp + 1) ;
	      bp++;
	      *bp++ = c ;
	    }
	  }
	}
	image->bitmap_bit_order = MSBFirst; /* MSB IS Correct (vax). */
#endif vax

It needs some work, but it does make it work vax->vax...


People who are further interested in this should perhaps get in touch
with me so that we (I) can stop flooding xpert with updates...

				Mark Eichin
			<eichin@athena.mit.edu>
		SIPB Member & Project Athena ``Watchmaker'' 

Note to athena users: /mit/sipb/{rt,vax}bin/{xdvi,texx} are installed.

							_Mark_

ps. charon.mit.edu:~ftp/pub/ {charon is 18.80.0.13} has
-rw-r--r--  1 eichin   sstaff      53294 Mar 13 13:37 x11dvi.c.shar
-rw-r--r--  1 eichin   sstaff      56336 Mar 13 13:37 x11dvi.tar.Z
Sums are:
37908   144 x11dvi.tar
22362    56 x11dvi.tar.Z
23858    53 x11dvi.c.shar