Re: [cc65] tgi_outtext x and y coordinates and new line

From: Ullrich von Bassewitz <uz1musoftware.de>
Date: 2009-10-29 19:42:35
On Thu, Oct 29, 2009 at 11:26:12AM -0700, Fatih Aygün wrote:
> I'm not sure how to interpret the coordinates when the text direction is 
> vertical.
> Is it supposed to be the lower left corner? Since the text will be written 
> rotated 90 degrees counter-clockwise, the text will flow from bottom to 
> top, right?

The coordinates do always point to the start of the text baseline, so for
vertical text (which flows indeed from bottom to top), pixels to the left of
this coordinates are used. This will also work nicely with the vector fonts.

> My second question is, is the driver supposed to interpret the "\n" and "\r" like
> conio does? Personally I could live without them :)

Since we must be able to use builtin character ROMs, handling of special
characters is implementation defined (which may also specify that it causes
undefined behaviour). Since the is no concept of lines, \n and \r should *not*
"move the cursor to the start of the line" or "move the cursor to the next
line". I would just ignore chars below $20.

It was really a bad idea not to implement OUTTEXT in the C64 driver, which was
used as a reference. I can only hope that the existing implementations do it
as described above :-(

BTW: There is an error in the C64 driver which is also in the C128 drivers
(and as I see now, also in the apple driver). I've used the register bank in
the zero page without saving the contents. This may overwrite variables in
programs that use register variables. So much for "having a reference driver
is a good thing".

Others have copied this error to their own drivers. For the future, please
note that all my bugs are copyrighted by me and may not be used without
written permission! If you want bugs in your TGI drivers, please create your
own! :-)

Regards


        Uz


-- 
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 Thu Oct 29 19:47:07 2009

This archive was generated by hypermail 2.1.8 : 2009-10-29 19:47:09 CET