Harry Potter Posted December 26, 2022 Share Posted December 26, 2022 Hi! I am working on a text adventure for the C64 using cc65 and, if I succeed, plan to port it to other platforms, including the Atari. Somebody over at the applefritter.com forum told me to check the output code from cc65, and I found a few inefficiencies. While converting them to assembler, I got the text adventure to work but not my text adventure skeleton codes. One symptom is that they display garbage when displaying room descriptions. I use my printtok() function which displays token-compressed strings. Replacing it with prints() from my *SimpleIO libraries works. i added code to print both the address of the string passed to the function and the one received by the function, and the numbers don't match. They are AdvSkelVic65 and AdvSkel65 and are at c65 additions - Manage /game at SourceForge.net. BTW, the former has an Atari cartridge version, and the latter has an AtariXL version, but I don't remember if it also has a regular Atari 400/800 version. I am also looking to optimize my own text adventure. I attached some example code in the hopes that somebody here can give me some ideas to optimize it. Example TextAdv Code #001.txt Quote Link to comment Share on other sites More sharing options...
_The Doctor__ Posted December 27, 2022 Share Posted December 27, 2022 if the initial target is C64, wouldn't it make sense to post on the C64 section of the forum?? Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted December 27, 2022 Author Share Posted December 27, 2022 _The Doctor__, I thank you for your information. I will look for it now. Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted December 27, 2022 Share Posted December 27, 2022 Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted December 27, 2022 Author Share Posted December 27, 2022 Thank you. Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted December 27, 2022 Author Share Posted December 27, 2022 The ones you specified should be useful. Now, I have my own list of cc65 optimizations. Should I post a link to them? Quote Link to comment Share on other sites More sharing options...
Wrathchild Posted December 27, 2022 Share Posted December 27, 2022 (edited) Have seen it on other posts If you want the functionality of printf then use it, the advice to not include it due to the space it (and associated code) takes, so if that isn't an problem then a non-issue. Edited December 27, 2022 by Wrathchild Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted December 27, 2022 Author Share Posted December 27, 2022 The docs. you gave state that one should avoid printf(). I have a very efficient replacement called *SimpleIO. *SimpleIO provides functions that print certain things on a screen in such a way that very little overhead is required. It is at c65 additions - Manage /ui at SourceForge.net. AtaDisk65 provides an API to the Atari8 OS and is much more efficient than the standard file operations. It is in the same location. Try them out! Quote Link to comment Share on other sites More sharing options...
Harry Potter Posted December 27, 2022 Author Share Posted December 27, 2022 I usually don't use printf() and use *SimpleIO instead because the latter produces much tighter code. Quote Link to comment Share on other sites More sharing options...
Ecernosoft Posted December 28, 2022 Share Posted December 28, 2022 (edited) On 12/26/2022 at 4:36 PM, Harry Potter said: Hi! I am working on a text adventure for the C64 using cc65 and, if I succeed, plan to port it to other platforms, including the Atari. Somebody over at the applefritter.com forum told me to check the output code from cc65, and I found a few inefficiencies. While converting them to assembler, I got the text adventure to work but not my text adventure skeleton codes. One symptom is that they display garbage when displaying room descriptions. I use my printtok() function which displays token-compressed strings. Replacing it with prints() from my *SimpleIO libraries works. i added code to print both the address of the string passed to the function and the one received by the function, and the numbers don't match. They are AdvSkelVic65 and AdvSkel65 and are at c65 additions - Manage /game at SourceForge.net. BTW, the former has an Atari cartridge version, and the latter has an AtariXL version, but I don't remember if it also has a regular Atari 400/800 version. I am also looking to optimize my own text adventure. I attached some example code in the hopes that somebody here can give me some ideas to optimize it. Example TextAdv Code #001.txt 3.54 kB · 10 downloads Here's a trick: If (for some reason) you want extra color, you can get more (In antic 2, 3, F) by overlaying player/missile gfx. Since you can fill the screen with this kind of graphics at 4x wide, you can get extra color. Edit: it seems you are coding in basic/don’t care about obscure tricks. Ignore this post. Edited December 30, 2022 by Ecernosoft Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.