[cc65] Sharing circle ? (was: Tgi circle and font size magnification)

From: Oliver Schmidt <ol.sc1web.de>
Date: 2009-10-28 14:56:40
Hi,

>>> The circle command is really useless. Could it be removed?

> Anyway, I have not found this routine to be useful and still it takes space
> in every tgi implementation.

To be honest I agree with this perspective to some degree...

1. The primary usecase for TGI is probably displaying diagrams, graphs
and alike. There one doesn't need circles. Dots, lines, bars,
characters are the things usefull there. I'm actually having a hard
time to come up with a true usecase for a circle...

2. Likely I'm to Apple2-biased here, but it seems that there are often
ROM routines already available for drawing dots, lines, bars and
characters, but not for circles. Beside the fact that this might be
another indicator that they aren't that useful it means that the
circle routine is by far the largest in the driver.

Taking 1.) and 2.) together means that the cost-benefit ratio for
circle is significant lower than for all the other primitives. But
instead of abandoning it a limited commitment model might be
appropriate:

Instead of having each driver supply the CIRCLE routine there could be
just a single shared routine (incl. clipping) right inside tgi_circle:

- We'd have to maintain only one implementation (thinking i.e. about
the flaw currently in Apple2 and C128).
- A program not needing tgi_circle wouldn't need to have the
implementation in RAM at all (and I presume this is true for most
programs).
- At least some implementations aren't optimized in any way specific
to the driver, rather they more or less only repeatedly call SETPIXEL.

The interface from the tgi_circle into the driver could look something like this
- CIRCLEINIT called once at the start of circle drawing
- CIRCLEPLOT called for every pixel to be plotted
- CIRCLEDONE called once at the end of circle drawing

The CIRCLEPLOT parameters would be identical to SETPIXEL so a driver
could implement the three entrypoints by
- just returning on CIRCLEINIT and CIRCLEDONE
- aliasing CIRCLEPLOT to SETPIXEL

Best, Oliver
----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Wed Oct 28 14:56:49 2009

This archive was generated by hypermail 2.1.8 : 2009-10-28 14:56:51 CET