You can see that you can print to the terminals defined by the crt and you can configure the terminals at runtime via ioctl().
I can see a bug in the terminal code in that attributes are being affected below the text windows. It may be an error in the fonts or in the fzx driver that I will have to look into.
I don't expect anyone to follow this, it's just an indication of the difference between a minimal barely functional library (sdcc) or a simple one reliant on the operating system (hitech) and one that tries to be complete (z88dk).
When comparing code sizes, you also have to keep in mind a compiler like hitech is relying on the operating system to provide functionality. So its binaries may occupy a certain size but it's also making use of operating system code that might be 8k or more in size that is hidden from the output binary. z88dk's binaries are completely independent and can exist apart from any operating system. You do have the option to write drivers that use the system software but we haven't done that yet for the new library.
In the zip you can also compare the asm output generated by sdcc and sccz80 by examing the files "fzx_term2_sdcc.asm" and "fzx_term2_sccz80.opt". In this case the sdcc-compiled binary is 13514 bytes and the sccz80-compiled binary is 13185 bytes. By using static variables, I've made sccz80's produced code better. The other differences have to do with sdcc needing ix preserved and the calling conventions of sccz80 being much better.
A further ~5k can be shaved off by doing the same sorts of things I did in the last post.
[свернуть]