Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[GRAPH/BASIC] implement GRAPH_draw_oval and BASIC "OVAL" and "RING" commands #356

Merged
merged 3 commits into from
Sep 5, 2024

Conversation

mooinglemur
Copy link
Collaborator

@mooinglemur mooinglemur commented Aug 30, 2024

This is a fast implementation of an extended Bresenham circle algorithm to draw ellipses, based on http://members.chello.at/~easyfilter/bresenham.html

It adds a fast 8x8 multiply routine, fast 16 bit squaring, and a traditional 16x32 shift and add multiply routine.

@Fulgen301
Copy link
Collaborator

As of R47, the KERNAL requires a VERA version with FX features; could we use the VERA's FMA functionality to speed up the non-8-bit multiplications?

@mooinglemur
Copy link
Collaborator Author

We certainly can. I think it might we worth some design discussion about which routines can use it, and what part of VRAM would be used as scratch. I'd like to cut a new release here within a week, so there'll be plenty of time to work that out rather than rushing it now.

@mooinglemur mooinglemur merged commit 2f5e9c6 into X16Community:master Sep 5, 2024
1 check passed
@irmen
Copy link
Contributor

irmen commented Sep 5, 2024

Nice that it is implemented!

However, the algorithm used creates a small artefact when drawing a circle (width=height):

image

Maybe it's related to this routine being more general (it can draw ovals) but the circle algorithm I have been using so far produces "flat" edges on the left and right sides, reflecting the same edges as on the top and bottom:

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants