DEF GDISK X,Y,RADIUS,COL
IF RADIUS<1 THEN GPSET X,Y,COL:RETURN
VAR PX=MIN(MAX(X,0),512-1)
VAR PY=MIN(MAX(Y,0),512-1)
VAR DX=PX-X
VAR DY=PY-Y
IF DX*DX+DY*DY > RADIUS*RADIUS THEN RETURN
GCIRCLE X,Y,RADIUS,8
GPAINT PX,PY,COL,8
GCIRCLE X,Y,RADIUS,COL
END
GPAINT x, y, fill_color, border_color will flood fill all pixels that aren't
border_color.
This will work even there other things on the GRP, as long as you don't use that special color.
I chose 8 (that is, alpha: 0, red: 0, green: 0, blue: 8). There's no reason to ever use this color anywhere else (since it looks identical to color 0), and it should be safe.
This is much faster than filling the circle manually using GLINE/GFILL/GTRI/etc.
