A83: _ILine Rectangle Routines


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

A83: _ILine Rectangle Routines





I've had to use Rectangle routines a current prog im working on that use 
_ILine rather than buffer drawing routines.  This first routine draws the 
outline of a rectangle and the second one fills in the defined rectangle...  
I would like for anyone to look over them as see if they can get the routines 
any smaller/faster, thanks... =)

Jason_K

Inputs: (B,C) = Top-Left Coords; (D,E) = Bottom-Right Coords; H = Color 
(0-White, 1-Black, 2-XOR).

_IRect:
	push bc	
	push de
	ld e, c
	call _ILine
	pop de
	push de
	ld d, b
	call _ILine
	pop de
	ld c, e
	call _ILine
	pop bc
	ld b, d
	jp _ILine

_IRectFill:
	ld a, c
	sub e
	inc a
	ld e, c
_IRectFill_Loop:
	push af
	call _ILine
	dec c
	dec e
	pop af
	dec a
	jp nz, _IRectFill_Loop
	ret