[A83] Re: variable horizontal line routine?


[Prev][Next][Index][Thread]

[A83] Re: variable horizontal line routine?




ok, this should work, and should be fast enough, if you want you could 
replace B_CALL IPoint with your own point drawing routine... but why waste 
the time... (I guess you would want to if you were doing it for a game...)
<SNIPPET>
Xline:
       ; a = x value to start
       ; c = y value of line
       ; currently destroys AF and B regs, but the way it's structured you 
could easily app 2 PUSH and 2 POP statements to prevent this...
push de
ld d,1
call XlineLoop
pop de
ret
XlineLoop:
ld b,a
B_CALL IPoint ; This should be fast enough, if not you'd have to program the 
routine yourself! Luckily this one doesn't destroy registers
cp 5Fh
ret z
inc a
jr XlineLoop
</SNIPPET>

-Nicolas Gilles


>From: "Joe Pemberton" <dArkSk8eR@buffbody.com>
>
>does anyone know of a routine that would let me draw a (fast) horizontal
>line across the gbuf?  I need the line to be able to start at a variable x
>coordinate and continue all the way to the right side of the screen without
>going over to the other side.  I could use a line drawing routine, but i
>need it to be _fast_.  kind of like a clipped horizontal line routine.
>
>_____________________________________________
>Free email with personality! Over 200 domains!
>http://www.MyOwnEmail.com
>
>
>

_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.




Follow-Ups: