"Well, I'm back", he said.
Like Sam, I've been away for a good while having adventures in other places, but after becoming thoroughly disenchanted with the project last July I've now had enough of a break that I'm ready to step back into harness and continue the work. To that end, I've spent the last few days reviewing the code and deciding what to do first - that being a bit of a refresh of the way some parts work, and a root-and-branch cull of Zero Page usage.
I've identified about 50 bytes that can either be dispensed-with, compressed, or moved out to other memory areas without too much of a speed penalty. The single biggest win is the 25-byte dirty-row table, which I have now designed a sufficiently-fast pair of bit read-and-set routines that I can shrink it back down to 4 bytes; I can also rework the line rendering code to reduce the 8-byte glyph work area to a single byte. With a few other tweaks, I can potentially reclaim about 20% of the OS' current ZP demand and give myself some breathing-space again.
What's also quite interesting is the perspective that these six months off have granted me - I'm looking at some of my code and immediately seeing ways to speed it up, or shrink it, or both. I've also discovered a nice new tool to play with in the Assembler armoury - it turns out that although 'LAX immediate' is unstable on many (most?) 6502's, LAX #$00 isn't. This is due to the way that the instruction works in immediate-mode (a combination of LDA and TAX, rather than LDA and LDX in the other supported addressing-modes) so whilst there's a nasty floating-bus crosstalk problem which screws-up the bit-patterns as the immediate load happens, there isn't a bit-pattern to screw-up when the value is zero! So anywhere where I'm doing LDA #$00; TAX or LDX #$00; TXA I can now do LAX #$00 - and there are also a few places where I've written the code in such a way that having a LAX #$00 instruction means I can rewrite it a different, better way.
Onward!
No comments:
Post a Comment