Skip to content

Commit 8091f77

Browse files
committed
optimized loop condition in circle routines
1 parent 70b207f commit 8091f77

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

src/graphx/graphx.asm

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1673,9 +1673,11 @@ _Circle:
16731673
ld hl, (iy - 6)
16741674
or a, a
16751675
sbc hl, bc
1676-
jp p, .check
1676+
add hl, hl ; C = sign
1677+
jr nc, .check ; positive
16771678
jp pe, .sectors
1678-
jr .exit
1679+
; jr .exit
1680+
xor a, a ; sets PE
16791681
.check:
16801682
jp po, .sectors
16811683
.exit:
@@ -1798,11 +1800,11 @@ _FillCircle:
17981800
ld hl, (ix - 6)
17991801
or a, a
18001802
sbc hl, bc
1801-
jp p, .check
1803+
add hl, hl ; C = sign
1804+
jr nc, .check ; positive
18021805
jp pe, .fillsectors
1803-
ld sp, ix
1804-
pop ix
1805-
ret
1806+
; jr .ResetStack
1807+
xor a, a ; sets PE
18061808
.check:
18071809
jp po, .fillsectors
18081810
.ResetStack:

0 commit comments

Comments
 (0)