Re: [cc65] tgi primitives...

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2004-10-27 17:05:19
On Wed, Oct 27, 2004 at 04:47:50PM +0300, Karri Kaksonen wrote:
> > I would suggest to add a simple circle implementation to the driver.
>
> OK. That will be an 8 sided polygon.

I'm not sure if this is not too simple, but it's a start:-) The C128 TGI
drivers written by Maciej do contain a CIRCLE implemtation derived from a C
source. All the code needs is a clipping setpixel function. Maybe it is
possible to reuse this code. Stefan Haubenthal did so for some other TGI
drivers.

> That is fine with me. I will the add new function defines to lynx.h like:
>
> #define tgi_sprite(spr) tgi_ioctl(0, (void *)(spr))
> #define tgi_flipscreen() tgi_ioctl(1, 0)
> #define tgi_setbgcolor(col) tgi_ioctl(2, col)
>
> This makes things less portable, but they are really required.

I would like to add some ioctl defines to tgi.h as specified in my last mail.
So there would be

       	#define TGI_IOCTL_SPRITE	0x00
	#define TGI_IOCTL_TRIANGLE	0x01

and maybe a few others. This may require adding the structures passed to the
driver also to tgi.h. But your approach is a starter, we can clean that up
once it is clear which standard ioctls make sense.

> Obviously I also need to write some magic code to transfer cputc
> output to a tgi_outtext call if I want to have conio to work on
> the Lynx.

For an 8x8 font, and character positions on pixel locations divideable by 8,
the conio routines can be written much simpler and faster than the tgi code
(which must be able to output text at arbitrary positions). So it may be worth
thinking about separating the two functions. But that's just an idea.

> PS. I know very little about the hardware for other cc65 platforms.
>     The Lynx is full of all kind of graphics accelerators as it was
>     designed to be a games console. So my views are a bit Lynx-biased.

No problem. I'm sometimes CBM biased myself:-)

Regards


	Uz



P.S.: I will leave now and will not be back before monday evening. I have mail
access again starting from saturday. So no mails from me for a few days and no
changes to the development code for some more.

-- 
Ullrich von Bassewitz                                  uz@musoftware.de
----------------------------------------------------------------------
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 27 17:05:23 2004

This archive was generated by hypermail 2.1.8 : 2004-10-27 17:05:32 CEST