Re: [cc65] TGI mode switch without tgi_clear()

From: Oliver Schmidt <ol.sc1web.de>
Date: 2010-01-26 17:15:45
Hi Fatih,

> This is doable in Atari too. But making it default would waste another ~1K of RAM in most cases and RAM is already scarce when using TGI on Atari.
>
> Would it make sense to have two versions of tgi_init(), one that preserves the text screen and one that doesn't?

Maybe I didn't get you right, but... I was at no point arguing that
something should be implemented that explicitly saves and restores the
text screen. Trying to clarify my perspective:

Some drivers implicitly clear the screen on INIT, others don't.
Currently the TGI kernel tgi_init() explicitly calls the CLEAR routine
after the INIT routine. This is in general of course good because
target independent programs thus can rely on a defined state.

However not every cc65 program is target independent - in fact most
are not. And so it should not be harder than necessary to combine the
cc65 "goodies" with some target specific "extras". And from that
perspective the current tgi_init() isn't optimal because it makes it
impossible to use TGI with a "preloaded" screen. On the other hand I'd
consider it not a big burden for target independent programs to
explicitly call tgi_clear() after tgi_init() to get the defined state.

In general this seems comparable to the text screen on program startup
(and/or shutdown). I presume that there are cc65 targets that
implicitly clear the text screen on startup (and/or shutdown). But
nobody would therefore clear the screen on all targets just to get the
same behaviour. Rather it's up to the target independent program to
call clrscr() on startup (and maybe cgetc() before shutdown).

Therefore my proposal is to:
- remove the call to CLEAR from tgi_init()
- adjust the doc to explicitly state that the screen may or may not be cleared
- add tgi_clear() after tgi_init() to the sample programs in question

I'd be willing to realize the listed changes...

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 Tue Jan 26 17:15:52 2010

This archive was generated by hypermail 2.1.8 : 2010-01-26 17:15:54 CET