git.y1.nz

gbdk-2020

GameBoy Development Kit
download: https://git.y1.nz/archives/gbdk.tar.gz
README | Files | Log | Refs | LICENSE

commit d6b2a80b0674a848d33a5bd942791a817118ed74
parent 5fa361b08e86bb90f3f74e680f9a5cb534781bff
Author: Toxa <56631470+untoxa@users.noreply.github.com>
Date:   Sat, 14 Mar 2026 12:17:18 +0300

Merge pull request #870 from bbbbbr/fix/apa_circle_radius
Diffstat:
Mgbdk-lib/include/gb/drawing.h10++++++++--
Mgbdk-lib/libc/targets/sm83/drawing.s8+++++++-
2 files changed, 15 insertions(+), 3 deletions(-)

diff --git a/gbdk-lib/include/gb/drawing.h b/gbdk-lib/include/gb/drawing.h @@ -119,8 +119,14 @@ void line(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2) OLDCALL; __style__ (one of NOFILL or FILL) */ void box(uint8_t x1, uint8_t y1, uint8_t x2, uint8_t y2, uint8_t style) OLDCALL; -/** Draw a circle with centre at __x,y__ and __radius__ using fill mode - __style__ (one of NOFILL or FILL)*/ +/** Draw a circle with center at __x,y__ and __radius__ using fill mode + __style__ + + @param x X center location in pixels + @param y Y center location in pixels + @param radius Value between 1 and 254 (no draw for values outside range) + @param style NOFILL or FILL + */ void circle(uint8_t x, uint8_t y, uint8_t radius, uint8_t style) OLDCALL; /** Returns the current colour of the pixel at __x,y__ */ diff --git a/gbdk-lib/libc/targets/sm83/drawing.s b/gbdk-lib/libc/targets/sm83/drawing.s @@ -1478,12 +1478,18 @@ _circle:: LD A,(HL+) ; C = y LD C,A LD A,(HL+) ; D = Radius + OR A + JR Z,$1 ; Don't draw circle of radius zero + INC A + OR A + JR Z,$1 ; Radius of 255 not supported + DEC A LD D,A LD A,(HL) LD (.style),A CALL .circle - +$1: POP BC RET

This webpage is intended to be an accessible preview of this repository. To get a fuller picture, clone it and use the git CLI.