
; PutPixel32(chunky:a0:PTR TO chunky,x:d0:LONG,y:d1:LONG,colour:d2:LONG)(LONG)

	machine	mc68020
	fpu	1

	xdef	_PutPixel32

_PutPixel32
	cmpa.l	#0,a0
	beq.s	.finish
	tst.l	d0
	blt.s	.finish
	tst.l	d1
	blt.s	.finish
	cmp.l	(a0),d0
	bge.s	.finish
	cmp.l	(4,a0),d1
	bge.s	.finish

	muls.l	(a0),d1
	add.l	d0,d1
	lsl.l	#2,d1		; d1 now contains position in buffer
	movea.l	(8,a0),a1
	move.l	d2,(a1,d1.l)

.finish	rts
