optimized disc (filled circle) drawing on c64, fixed off by 1 disc width in cx16 version

This commit is contained in:
Irmen de Jong 2020-12-06 00:33:32 +01:00
parent 6902834568
commit 00071d53d5
2 changed files with 10 additions and 14 deletions

View File

@ -158,21 +158,17 @@ graphics {
ubyte ycenter_plus_xx = ycenter + xx
ubyte ycenter_min_xx = ycenter - xx
for internal_plotx in xcenter to xcenter+xx {
internal_plotx = xcenter-xx
repeat xx*2+1 {
internal_plot(ycenter_plus_yy)
internal_plot(ycenter_min_yy)
internal_plotx++
}
for internal_plotx in xcenter-xx to xcenter-1 {
internal_plot(ycenter_plus_yy)
internal_plot(ycenter_min_yy)
}
for internal_plotx in xcenter to xcenter+yy {
internal_plot(ycenter_plus_xx)
internal_plot(ycenter_min_xx)
}
for internal_plotx in xcenter-yy to xcenter {
internal_plotx = xcenter-yy
repeat yy*2+1 {
internal_plot(ycenter_plus_xx)
internal_plot(ycenter_min_xx)
internal_plotx++
}
yy++
if decisionOver2<=0

View File

@ -110,25 +110,25 @@ graphics {
cx16.r0 = xcenter-xx
cx16.r1 = ycenter_plus_yy
cx16.FB_cursor_position()
repeat xx*2
repeat xx*2+1
cx16.FB_set_pixel(1)
cx16.r0 = xcenter-xx
cx16.r1 = ycenter_min_yy
cx16.FB_cursor_position()
repeat xx*2
repeat xx*2+1
cx16.FB_set_pixel(1)
cx16.r0 = xcenter-yy
cx16.r1 = ycenter_plus_xx
cx16.FB_cursor_position()
repeat yy*2
repeat yy*2+1
cx16.FB_set_pixel(1)
cx16.r0 = xcenter-yy
cx16.r1 = ycenter_min_xx
cx16.FB_cursor_position()
repeat yy*2
repeat yy*2+1
cx16.FB_set_pixel(1)
yy++