Re: [cc65] Atari tgi update

From: Fatih Aygün <cyco1301yahoo.com>
Date: 2009-11-11 16:46:29
Hi,



Ullrich von Bassewitz wrote:

> TGI_ERR_NO_MEM is not an Atari specific error. I've refrained myself from
> adding it, because I didn't want to bloat the error messages, but it does
> definitely make sense. TGI_ERR_NO_IOCB is an Atari specific error code, and I
> would highly prefer to map it to something else (maybe TGI_ERR_NO_MEM, because
> that is probably what happens). Adding error codes needs also changes in
> tgi_geterrormsg.s, which will not work as it currently is. My suggestion is to
> remove TGI_ERR_NO_IOCB, add TGI_ERR_NO_MEM as a normal error (without Atari
> specific comments) and fix tgi_geterrormsg.s to work with the new error codes.

I agree in principle. But, for atari, lack of memory points to a very specific (and probably
common) problem, the fact that the user forgot to set __RESERVED_MEMORY__ when
linking. A separate code for NO_IOCB can save some people hours of debugging. What
about a platform dependent error code? tgi_geterror can return something like 
TGI_ERROR_PLATFORM and tgi_getplatformspecificerror can return the appropriate platform
specific error code, which are already a part of the library.

> Regarding the driver itself: I don't think it's a good idea to use .define -
> it has similar problems as its CPP counterpart. Please check if .define can be
> replaced by a simple constant definition using '=' or ':='.

Currently, atari drivers just define some defines and mode specific functions (only setpalette actually)
and then include "atari_tgi_common.inc" which does the actual work using some conditional
compilation, because the code is very similar and it's much easier to change one file then 15 in case there
is a bug. Unfortunately I get "Constant expression expected" when I try to use normal constants
with .if directive. I would love to be able to use normal constants if it's feasible and reasonable to
let the .if and similar directives could use them. I hate defines too :)

Regards,
Fatih.


      
----------------------------------------------------------------------
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 Nov 11 16:46:38 2009

This archive was generated by hypermail 2.1.8 : 2009-11-11 16:46:40 CET