Thursday, July 5, 2007

?No space in brain error

You all have noticed how 999 description text has extra space after the word "brain", haven't you? Twice, even. That's because the same string token is used for the first page of droid data, and space is needed to align the text. Three other strings are padded too, but they don't affect any other text. Instead of adding one more token costing five bytes I removed all trailing spaces and added code to do the aligning. Couple of changes later I had won one byte and nice warm feeling, knowing that now the text is perfect.

Speaking of space saving - I checked how much free memory I have, and I have 400+ more bytes than two weeks ago. If I continue like this the game doesn't use any memory at all after couple of years...

... no, not really. New TV static routine suggested by Mike is longer than the original. Oh, horror! However, it looks so much better than the original that I can accept the loss of six bytes.


Mike said...

Any chance of a screenshot with the new static? Or perhaps an animating GIF?


TNT said...

Here is a version which doesn't use timer low bytes for more random data. SID doesn't give too random data if read in tight loop, so now the loop does "lda $d431b; eor $dc04" and has some padding to make the loop take 25 cycles. 25 cycles because that makes it coprime with every possible timer value. Timer max value is in range [62,64] depending on VIC-II version. Who said math is useless?

Now the static also does the character animation if run on PAL/Drean C64, making it effectively 50 Hz effect. I have to check if I can do that on NTSC as well if I place the drawing start row more carefully. Now it's just "bit $d012;bpl *-3".