I'm trying to do IO using stdio.h
on a Commodore 64, but I'm having with even the following program:
#include <stdio.h>
void main(void)
{
printf("Foo\n");
printf("Bar\n");
/* printf("Foo\n"); */
/* printf("Bar\n"); */
}
The problem is, if I leave 2 printf
s uncommented, then it works as expected. If I uncomment all four, then it doesn't work at all: if I RUN
it, I just see the lines flashing by before the screen resets to just showing READY.
on an empty screen.
If I have three, then it doesn't work for the first time (flashes to empty READY.
screen) but if I RUN
it again, then it works...
I should add that I've only tested this on VICE, not a real C64.
After following @Devolus's suggestion to do sanity checking with
sleep
, it turned out nothing, in general, was working properly. I've downgraded my CC65 installation from 2.13.9-svn5804 to 2.13.3, and that seems to have solved my problem.