Re: [cc65] Autostart ROM VIC-20 or C64 template project?

From: Groepaz <>
Date: 2013-06-29 06:19:39
On Saturday 29 June 2013, you wrote:
> On 6/28/2013 5:35 PM, Groepaz wrote:
> > ie: the key "trick" is to avoid using ANYTHING that uses standard file
> > access. use conio.h for screen exclusively. use cbm_.. functions for
> > disk. forget printf, forget fopen :)
> Understood.  I just put them in the template as a placeholder so the
> entire thing would compile and run first time out.

yeah for that better use another target that has more memory...3.5k is really 
tight without C already =)

> I was just not expecting that you can't use stdio AT ALL on an
> unexpanded VIC with a ROM.  That implies printf and software stack takes
> more than 3.5K of RAM.
> My app is:
> #include <stdio.h>
> void main(void)
> {
>    printf("hello\n");
> }
> I figured you'd have to forego stdio and the rest of the lot to anything
> non trivial on the vic, but I thought at least hello world would compile
> on the vic.

#include <conio.h>
void main(void)


the problem with printf really is that... well. as said before, the nice thing 
about cc65 is that it tries to be standard compliant - so printf really is 
doing a lot of stuff. as oliver suggested, try puts() instead, and have a look 
at what impact that has (a lot!, the whole vaprintf or whatever printf calls 
can be omitted). now replace by cputs() - the impact will be massive :)

when writing a vic20 program with cc65, you probably also want to take a look 
at the size of your software stack... i found that something like $200 bytes 
is really good enough for anything i do (i still use $400, however on a c64) 
... depending on what your code does, you can probably even get away with just 
$100 bytes or so :)


Wenn die Menschen nur über das sprächen, was sie begreifen, dann würde es sehr 
still auf der Welt sein. 
<Albert Einstein>

To unsubscribe from the list send mail to with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Sat Jun 29 06:18:50 2013

This archive was generated by hypermail 2.1.8 : 2013-06-29 06:18:52 CEST