Re: A83: My Crappy Box Routine...


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

Re: A83: My Crappy Box Routine...




Um, why not:

drawrect:pushbc;bc = upper left, de = lower right
pushde
ldh,1
lde,c
call_ILINE
popde
popbc
pushbc
pushde
ldh,1
ldb,d
call_ILINE
popde
popbc
pushbc
pushde
ldh,1
ldc,e
call_ILINE
popde
popbc
pushbc
pushde
ldh,1
ldd,b
call_ILINE
popde
popbc
ret

I wrote this long ago, but I've never ever had any use of it (!).

Linus

On 20-Jul-98, Jkhum98@aol.com wrote:

>Can somebody help me optimize this box drawing routine I made for myself? Its
>the straight forward approach, but a little more advanced than going line by
>line and having to re-enter numbers... Is there a better way to do this
>though, or even an already made routine? Thanx, anybody...
>--Jason

>Just as an example, i'll use the coordinates for the border of the screen...
>Heres the code:

>...
>ld (BoxLeft), 0
>ld (BoxUpper), 1
>ld (BoxRight), 94
>ld (BoxLower), 63
>ld h, 1
>call DrawBox
>...

>DrawBox:
>ld b, (BoxLeft)
>ld c, (BoxUpper)
>ld d, (BoxRight)
>ld e, (BoxUpper)
>call _Iline
>ld b, (BoxRight)
>ld c, (BoxUpper)
>ld d, (BoxRight)
>ld e, (BoxLower)
>call _Iline
>ld b, (BoxRight)
>ld c, (BoxLower)
>ld d, (BoxLeft)
>ld e, (BoxLower)
>call _Iline
>ld b, (BoxLeft)
>ld c, (BoxLower)
>ld d, (BoxLeft)
>ld e, (BoxUpper)
>call _Iline
>ret



References: