Re: [cc65] Optimizations needed!

From: Jakub Dębski <debski.jakub1wp.pl>
Date: 2010-11-26 10:27:25
W dniu 2010-11-26 03:08, Maspethrose7@aol.com pisze:
> I am working on a text adventure for the C64 using cc65 and, if I 
> continue, will eventually run into memory problems.  At the end of 
> Chapter 1, the executable costs 18k, and I have 50k to play with.  I 
> will need to add significant functionality over the next few chapters 
> and am worried about running out of memory.  Can anybody give me some 
> suggestions?  Even down to 16k might be useful.  I am trying to decide 
> whether to publish this code as open-source and don't yet want to 
> reveal the code, so I'm looking for some general techniques.

1. Don't use structs. Generated code is terrible.
2. Use arrays of size <256
3. Use global variables instead of stack variables.
4. Try not to pass parameters to functions - used global data.
5. Load data from disk when necessary.
6. Split your game into separate parts that don't share data.
7. Don't use macros.
8. Use unsigned chars instead of ints wherever possible.
9. Never use printf. The library code to handle it is huge. Write your 
own functions to display text/number.

regards,
Jakub

----------------------------------------------------------------------
To unsubscribe from the list send mail to majordomo@musoftware.de with
the string "unsubscribe cc65" in the body(!) of the mail.
Received on Fri Nov 26 10:27:37 2010

This archive was generated by hypermail 2.1.8 : 2010-11-26 10:27:40 CET