[TI-ASM] key scanner with low values

Got questions? Got answers? Go here for both.

Moderator: MaxCoderz Staff

King Harold
Calc King
Posts: 1513
Joined: Sat 05 Aug, 2006 7:22 am

Post 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.
User avatar
Halifax
Sir Posts-A-Lot
Posts: 225
Joined: Mon 01 Jan, 2007 10:39 am
Location: Pennsylvania, US

Post 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!
Spencer
Extreme Poster
Posts: 346
Joined: Mon 17 Jan, 2005 8:56 am
Location: Indiana

Post 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.
User avatar
driesguldolf
Extreme Poster
Posts: 395
Joined: Thu 17 May, 2007 4:49 pm
Location: $4080
Contact:

Post 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 ;)
User avatar
Halifax
Sir Posts-A-Lot
Posts: 225
Joined: Mon 01 Jan, 2007 10:39 am
Location: Pennsylvania, US

Post by Halifax »

Oh yeah I agree with you driesguldolf. That is true. Thanks for the clarity!
Post Reply