blocky:		equ	5
start:
	moveq	#2,d2
	lea	coords,a0
	bsr	dx1

	nop
	nop




*********************************************************
*	Routine to calculate stretchy stuff		*
*	Pass x width in d2				*
*	array to fill in a0				*
*********************************************************
dx1:
	moveq	#blocky,d3		;replaces need for dy calc
	cmp.w	d2,d3
	bgt	dx1b

	move.w	d3,d4
	asl.w	#1,d4		;dy*2
	move.w	d4,d1		;incrm1
	sub.w	d2,d4		;2*dy-dx=d
	sub.w	d2,d3
	asl.w	#1,d3		;incrm2=2*(dy-dx)
	moveq	#0,d0
	move.w	d0,(a0)+
	subq.w	#1,d2
lloop1:
	tst.w	d4
	bpl.s	dok1
	add.w	d1,d4
	move.w	d0,(a0)+
	dbf	d2,lloop1
	move.w	#-1,(a0)+
	rts
dok1:
	addq.w	#1,d0
	add.w	d3,d4
	move.w	d0,(a0)+
	dbf	d2,lloop1
	move.w	#-1,(a0)+
	rts

dx1b:
	exg	d2,d3
	move.w	d2,d5
	neg	d3
	neg	d2
	move.w	d3,d4
	asl.w	#1,d4		;dy*2
	move.w	d4,d1		;incrm1
	sub.w	d2,d4		;2*dy-dx=d
	sub.w	d2,d3
	asl.w	#1,d3		;incrm2=2*(dy-dx)
	moveq	#0,d0
	move.w	d0,(a0)+
	move.w	d5,d2
	subq.w	#1,d2
lloop1b:
	tst.w	d4
	bpl.s	dok1b
	add.w	d1,d4
	move.w	d0,(a0)+
	dbf	d2,lloop1b
	move.w	#-1,(a0)+
	rts
dok1b:
	addq.w	#1,d0
	add.w	d3,d4
	move.w	d0,(a0)+
	dbf	d2,lloop1b
	move.w	#-1,(a0)+
	rts


coords:	ds.w	100