A83: My Crappy Box Routine...


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

A83: My Crappy Box Routine...




	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


Follow-Ups: