Re: [cc65] Performance of Swiftlink routines

From: Daniel Serpell <daniel.serpell1gmail.com>
Date: 2009-12-31 12:37:40
Hi!

On Thu, Dec 31, 2009 at 12:41 AM, Tom Watt <tom719co@gmail.com> wrote:
> Hello,
>
> I've been working on a test terminal program to see if cc65 will work
> for me.  I think the terminal I wrote has "acceptable" speed, but I
> chose C because I honestly believed that C would be a faster
> alternative then a BASIC/ML combination approach.
>
[...]
>        if (status==SER_ERR_OK) printf("%c",key);

Printf is slow, you should use putchar(key) directly, or use the conio
function "cputc", that should be faster still, as uses direct screen I/O.

[...]
>        /* clear screen, set colors */
>        printf("%c%c",147,5);
>        POKE(53280,0);
>        POKE(53281,0);

Use "clrscr()" to make your program faster, smaller and portable at the
same time :-) .

>
>                /* Load SL driver */
>        err=ser_load_driver("c64-swlink.ser");
>        if (err!=SER_ERR_OK) printf("Error loading driver!\n");

You could use "puts" instead of "printf"...

    Daniel.
----------------------------------------------------------------------
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 Dec 31 12:37:47 2009

This archive was generated by hypermail 2.1.8 : 2009-12-31 12:37:50 CET