nanogui: Microwindows for Hercules


Previous by date: 19 Jul 1999 18:22:50 -0000 Re: Microwindows for Hercules, Alan Cox
Next by date: 19 Jul 1999 18:22:50 -0000 Re: Microwindows for Hercules, Greg Haerr
Previous in thread: 19 Jul 1999 18:22:50 -0000 Re: Microwindows for Hercules, Alan Cox
Next in thread: 19 Jul 1999 18:22:50 -0000 Re: Microwindows for Hercules, Greg Haerr

Subject: Re: Microwindows for Hercules
From: Ben Pfaff ####@####.####
Date: 19 Jul 1999 18:22:50 -0000
Message-Id: <87btd8xz1w.fsf@pfaffben.user.msu.edu>

Alan Cox ####@####.#### writes:

   > 	1. AFAICT it would require at least one division operation,
   >            whereas standard Bresenham doesn't need any.  This
   >            wouldn't be a problem for long diagonal lines, just for
   >            short ones.  Division is expensive.

   No. You can do it by using Besenham and still speed it up

   >            fits, just barely, but it looks like an ``extended''
   >            algorithm that keeps track of spans would need to use
   >            memory as well.  This is a big loss on the 8086 IIRC.

   Its not a big deal

   Firstly:

	   if(x2-x1 > y2-y2)
		   horizonal_optimised();
	   else
		   vertical_optimised();

Well, yes, obviously.

   Next for Bresenham you drop the plot_pixel call and instead when you 
   bump x (or y in vertical mode) you do plot_line(oldx,oldy, x,y); bump it
   oldx=x oldy=y

   Saves you function calls costs you four memory accesses per line - thats
   a win on everything.

Okay that's one way to look at it.  The routine that I was looking at
is in Wilton's _Programmer's Guide to PC and PS/2 Video Systems_.  He
has a routine that does one pixel per ten or so CPU instructions on
VGA16.  Getting that fast is easy; I was looking to do even better
than that using clever things with bit masks to write multiple pixels
at once.

You're looking at optimizing at the generic level with calls to a
hardware-specific routine; I was thinking about optimizing an already
fast x86 asm routine.  Oh well.
-- 
"Unix... is not so much a product
 as it is a painstakingly compiled oral history
 of the hacker subculture."
--Neal Stephenson

Previous by date: 19 Jul 1999 18:22:50 -0000 Re: Microwindows for Hercules, Alan Cox
Next by date: 19 Jul 1999 18:22:50 -0000 Re: Microwindows for Hercules, Greg Haerr
Previous in thread: 19 Jul 1999 18:22:50 -0000 Re: Microwindows for Hercules, Alan Cox
Next in thread: 19 Jul 1999 18:22:50 -0000 Re: Microwindows for Hercules, Greg Haerr


Powered by ezmlm-browse 0.20.