Page 2 of 2

Posted: Mon 27 Aug, 2007 11:32 am
by King Harold
That's your opinion.. IMO, you can hardly afford not to optimize every byte/tstate on such a limited system as our TI's. Of course you can over do it, but I have time enough to waste on a keyscanner.
Note though that I didn't initially optimize it, I just wrote it to do what it was supposed to do.
Oh and rotating isn't any faster than shifting unless you do it with A which in impossible ( =would hurt the code too much ) here.

Posted: Mon 27 Aug, 2007 3:31 pm
by Halifax
I agree with King Harold.

Even Insomniac Games optimizes every thing down to the last cycle and byte. Just check all the source code for Resistance that they post up on their website!

Posted: Tue 28 Aug, 2007 4:55 am
by Spencer
Any optimization I did was a side effect. Readability is what really matters. Especially when you share code, it's gotta be quick to understand.

Luckily Z80 assembly is one of those rare mediums in which the most optimized code is also good style.

Posted: Tue 28 Aug, 2007 11:14 am
by driesguldolf
King Harold wrote:Oh and rotating isn't any faster than shifting unless you do it with A which in impossible ( =would hurt the code too much ) here.
Well, I said I didn't completely read it, did I? :mrgreen:

To avoid misunderstandings:
Anyway, I meant that you should always optimize, but if you have to choose between speed and size, then choose wisely (depending on the situation):
In loading screens, menu's and stuff: I would optimize for size (and speed if possible without making the code unreadible like Spencer says)
In a costum grayscale program, loops within loops within loops and so on, I would optimize for speed (and size if possible, but speed has priority)

Wich you all do of course ;)

Posted: Tue 28 Aug, 2007 12:20 pm
by Halifax
Oh yeah I agree with you driesguldolf. That is true. Thanks for the clarity!