Subj : Re: Looking moremore optimizations! To : Pekka Takala From : Harry Potter Date : Sat Nov 10 2018 11:29 am On Saturday, November 10, 2018 at 12:10:24 PM UTC-5, Pekka Takala wrote: > Also, creating the game as modules helps you if you exceed the usable > memory. You can then split things if they do not depend on each other > and load them from disk/tape/cartridge when needed. If the code is in > one big snippet, the splitting is WAY more difficult to do if needed. > Well, the game currently *is* modularized. In fact, the executable is currently split into multiple parts, but, currently, all parts are loaded in at once. The main executable loads first, then two stubs loaded into the first k, then some strings and misc. data behind the I/O and kernal ROM to be accessed using my cc65 Hidden64 library. > Commenting is important- what does what. The comments DO NOT take any > space after compiling, the compiler just skips them completely. It helps > you to read the code afterwards and makes guessing less needed. And > also, if you make the code as modules, you can support various hardware > easier since you can load various pieces to memory depending on hardware. > I used to comment extravagantly but recently stopped. I don't know why. :( > And, when you have tasks those are common, in their own files, you > lessen the trouble of getting hard-to-repair bugs. You can parametrise > the functions so that you can use same code to little various tasks, > still being similar. For example, you can read keyboard with its own > function. If parametrised, you can restrict the keys needed to read, so > you do not need to check them in later code since the keyboard code does > that for you already. This method makes the code less prone to exploits, > although on commodore platform the exploit avoiding is not so important > than on platforms those are connectable to Internet. Still practicing > this makes you better coder on other platforms also. Well, I have my own input routine called AltInput for cc65. It is a front-end to my CBMSimpleIO library. Both are at https://sourceforge.net/projects/cc65extra/files/ui/. --- SoupGate-Win32 v1.05 * Origin: Agency HUB, Dunedin - New Zealand | Fido<>Usenet Gateway (3:770/3) .