[A86] Re: SDCC v2.3.0


[Prev][Next][Index][Thread]

[A86] Re: SDCC v2.3.0





> > Do you really need libc when writing calc programs?  If you do, then you
> > probably need to rethink what you are doing.  Again, that's not the
> > purpose here.
>
> Uhm, I didn't mean standard stuff (text I/O, string.h, etc.), but graphics
> (routines) and the such. At the moment you can make a tremendously
> beautiful C compiled program that can't output anything (graphics text
> whatever), not usefull I think...
>
> You could off coarse define some ROM routines as 'external' (like _puts),
> SDCC passes the first argument via HL.

Luckily, just passing things in HL seems sufficient to handle
displaying text on just about every Z80 calculator.

Graphics could also be done with little difficulty just in C.  All you
would need to for the TI-85/TI-86 is to draw them into the screen buffer
at $FC00.  You don't need even one ROM routine for this.  On the lower
calculators, you'd need to use use one buffer copy routine, but that is
still just one simple ROM call.

The graphics routines included in the TIGCC library are themselves written
in C, and just directly access buffers like this.  Of course, if your
compiler tends to produce bad code, that might not be such a good idea.

Then again, if you are writing hugely complex generic graphics routines,
that might not be so efficient either as the code would need to handle
every imaginable case, when it might be much better for a routine to be
specifically adapted to the specific needs of the program.

Though on a more broad level, I might like to know exactly what is the
intended purpose of this particular project; while I have been told what
isn't the purpose, I'm less certain as to what is.





Follow-Ups: References: