drawCircle:
	; first working atempt of me to
	; set up a circle draw routine based
	; on the mighty Bresenham-Algorithm
	; actually I just ported a C example
	; I found at wikipedia (quite line by line),
	; so it's extremely
	; unoptimised due to major lameness :P
	; I also kept the variable names as data labels
	
	move.w	r(pc),d1	;r in d1
	; int f = 1-radius
	moveq	#1,d2
	sub.w	d1,d2		; f result in d2
	move.w	d2,f		; f save

	; int ddF_x = 0 -> dc.w 0
	; int ddF_y = -2*radius
	move.w	#-2,d3
	muls.w	d1,d3
	move.w	d3,ddF_y	; save ddF_y

	; int x = 0 -> dc.b 0
	; int y = r
	move.b	d1,y		; y = r speichern

	; first set of pixels
	; setPixel(x0,y0 + r)
	move.w	x0(pc),d0
	move.w	y0(pc),d1
	add.w	r,d1		; add r to y0
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel
	;setPixel(x0,y0 - r)
	move.w	x0(pc),d0
	move.w	y0(pc),d1
	sub.w	r,d1
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel
	move.w	x0(pc),d0
	add.w	r,d0
	move.w	y0(pc),d1
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel
	;setPixel(x0 - r,y0)
	move.w	x0(pc),d0
	sub.w	r,d0
	move.w	y0(pc),d1
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel

	; Pixelloop
.lp:
	move.b	x,d0
	move.b	y,d1

	; while( x < y )
	cmp.b	d1,d0
	bge	.end
	; if( f >= 0 )
	cmpi.w	#0,f
	blt	.skip

	subq.b	#1,d1		; y--;
	move.w	ddF_y(pc),d2	; get ddF_y
	addq.w	#2,d2		; ddF_y += 2;
	move.w	d2,ddF_y	; save new ddF_y
	add.w	d2,f		; f += ddF_y
.skip:
	addq.b	#1,d0		; x++;
	move.w	ddF_x(pc),d2	; get ddF_x
	addq.w	#2,d2
	move.w	d2,ddF_x	; save new ddF_x
	addq.w	#1,d2
	add.w	d2,f		; f += ddF_x + 1

	move.b	d0,x		;save new x
	move.b	d1,y		;     "   y

	;setPixel(x0 + x,y0 + y)
	moveq	#0,d2
	move.w	x0(pc),d0
	move.w	y0(pc),d1
	move.b	x(pc),d2
	add.w	d2,d0
	move.b	y(pc),d2
	add.w	d2,d1
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel
	;setPixel(x0 - x,y0 + y)
	moveq	#0,d2
	move.w	x0(pc),d0
	move.w	y0(pc),d1
	move.b	x(pc),d2
	sub.w	d2,d0
	move.b	y(pc),d2
	add.w	d2,d1
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel
	;setPixel(x0 + x,y0 - y)
	moveq	#0,d2
	move.w	x0(pc),d0
	move.w	y0(pc),d1
	move.b	x(pc),d2
	add.w	d2,d0
	move.b	y(pc),d2
	sub.w	d2,d1
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel
	;setPixel(x0 - x,y0 - y)
	moveq	#0,d2
	move.w	x0(pc),d0
	move.w	y0(pc),d1
	move.b	x(pc),d2
	sub.w	d2,d0
	move.b	y(pc),d2
	sub.w	d2,d1
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel
	;setPixel(x0 + y,y0 + x)
	moveq	#0,d2
	move.w	x0(pc),d0
	move.w	y0(pc),d1
	move.b	y(pc),d2
	add.w	d2,d0
	move.b	x(pc),d2
	add.w	d2,d1
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel
	;setPixel(x0 - y,y0 + x)
	moveq	#0,d2
	move.w	x0(pc),d0
	move.w	y0(pc),d1
	move.b	y(pc),d2
	sub.w	d2,d0
	move.b	x(pc),d2
	add.w	d2,d1
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel
	;setPixel(x0 + y,y0 - x)
	moveq	#0,d2
	move.w	x0(pc),d0
	move.w	y0(pc),d1
	move.b	y(pc),d2
	add.w	d2,d0
	move.b	x(pc),d2
	sub.w	d2,d1
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel
	;setPixel(x0 - y,y0 - x)
	moveq	#0,d2
	move.w	x0(pc),d0
	move.w	y0(pc),d1
	move.b	y(pc),d2
	sub.w	d2,d0
	move.b	x(pc),d2
	sub.w	d2,d1
	move.w	d0,dpX
	move.w	d1,dpY
	bsr	drawPixel	
	bra	.lp
.end:
	rts

x0:	dc.w	100
y0:	dc.w	100
x:	dc.b	0
y:	dc.b	0
r:	dc.w	20
f:	dc.w	0
ddF_x	dc.w	0
ddF_y	dc.w	0


; this is the C example found during my search

;void rasterCircle(int x0, int y0, int radius)
; {
;   int f = 1 - radius;
;   int ddF_x = 0;
;   int ddF_y = -2 * radius;
;   int x = 0;
;   int y = radius;
; 
;   setPixel(x0, y0 + radius);
;   setPixel(x0, y0 - radius);
;   setPixel(x0 + radius, y0);
;   setPixel(x0 - radius, y0);
; 
;   while(x < y) 
;   {
;     if(f >= 0) 
;     {
;       y--;
;       ddF_y += 2;
;       f += ddF_y;
;     }
;     x++;
;     ddF_x += 2;
;     f += ddF_x + 1;    
;     setPixel(x0 + x, y0 + y);
;     setPixel(x0 - x, y0 + y);
;     setPixel(x0 + x, y0 - y);
;     setPixel(x0 - x, y0 - y);
;     setPixel(x0 + y, y0 + x);
;     setPixel(x0 - y, y0 + x);
;     setPixel(x0 + y, y0 - x);
;     setPixel(x0 - y, y0 - x);
;   }
; }