: >     The place where nano-X and microwindows spend at *least* 95% of their
: > pixel-pushing code is in drawing horizontal lines.  All the demos but one
: > *never* draw a diagonal line, the only case where bresenham is used.  I had
: > completed test cases to prove this...
: 
: OK, granted. Nevertheless, does this mean it has to be slow? Suppose in
: the future someone writes a drawing program for ELKS, using the XOR algo
: to draw lines (and erase them again as the mouse pointer moves).

        Yes, microwindows is ready for this, the code is already
commented out, waiting for somebody to add it.  I just hadn't heard complaints
about the diagonal line drawing speed yet.  (check out devdraw.c, and you'll
see that *if* the clipping routines see that the line can be drawn full speed
with no clipping, then a commented out low level routine can be called
to perform the function at blinding speed.) 

: Hmm then that's something that could be checked for in between STOSB
: instructions (or the like). We could for example use something like this
: (just an idea), where ? is a flag that isn't used (maybe the carry flag?):
: 
: PUSH flags register
: CLI

        (we don't want to draw lines with interrrupts off)

: ...
: {If out needed} ST?
: ...
: {Bresenham}
: ...
: STOSB {or something like that, like OR}
: LOOPN?
: JN? :End
: ...
: {Perform OUT}
: ...
: LOOP
: ...
: 
: :End
: ...
: POP flags register
: 
: We could of course also use something else than a flag, like a register,
: if Bresenham doesn't already use all of them...
: Just an idea, I never did VGA 4 bit programming, I always used mode 13h.
: 
        Generally, it would be nice to have everything in asm for blinding
speed.  I've already done this with microwindows and nano-X, see the file
asmplan4.s..  I also have everything written in C so that it's easily understandable,
and portable.

        Why don't various people play with this code, and maybe
it should be part of the standard make?

Greg

Reply via email to