nanogui: Microwindows for Hercules
Subject:
Re: Microwindows for Hercules
From:
Ben Pfaff ####@####.####
Date:
19 Jul 1999 17:28:02 -0000
Message-Id: <87g12ky1k1.fsf@pfaffben.user.msu.edu>
Greg Haerr ####@####.#### writes:
: The code in devdraw.c is very naiive. It assumes pixel plotting is the underlyin
: op. On many cards line slices are the underlying operation, horizontal or
: vertical. What you probably want to do is generate a series of
:
: draw_horizontal(x,y,l)
:
: or
: draw_vertical(x,y,l)
:
: calls for most things
That's a good idea. This would certainly speed up diagonal lines
on systems with a fast horizontal line draw. The vertical doesn't add much,
as most video planes aren't optimized for vertical line drawing. Currently,
there aren't any applications that draw diagonal lines though, so the speed issue
is mute.
A few days ago I was considering a faster-than-Bresenham(sp?)
algorithm along the lines of what Alan was saying. I came up with two
problems, both of which would only apply to assembly-language
implementations on the 8086 through 80286:
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.
2. I can't think of a way to fit all the necessary info into
the 8086 register set. The standard Bresenham algorithm
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.
Can anyone inform me how long DIV r/m16 takes on an 8086? I seem to
have lost my cycle-timing books, or perhaps I threw them out in a fit
of optimism.
--
"Debian for hackers, Red Hat for suits, Slackware for loons."
--CmdrTaco <URL:http://slashdot.org/articles/99/03/22/0928207.shtml>