Code: Select all
ZAX // 2 bytes, 2 cycles (encode as .word $00AB)
TAY // 1 byte, 2 cycles
Moderator: Moderators
Code: Select all
ZAX // 2 bytes, 2 cycles (encode as .word $00AB)
TAY // 1 byte, 2 cycles
I am very impressed by exomizer's performance as well – it always pays out to read a good book about the topic, I guess. Didn't get around to hack that threaded code idea to see if it's worth to grab all memory exomizer would need instead. Rather depends on the nature of your application.johncl wrote: … Then I checked out exomizer and it was able to squeeze those sprites down even further than my own highly specialized routine.…
In the end compression works because of repetitive patterns. Kicking out CLCs and such could be quite counter-productive.johncl wrote: I know a lot of what could be optimized through some bytecode thing can be optimized away at a later stage, like figuring out when you can leave out the clc before an adc, although in many cases my adc's are often used to really add the y register being used in an indirect lda/sta in the loop. So there are bit of these (tya, clc, adc #NN, tay) to be found - if not for the variable NN I guess I could do a jsr to save some bytes at the expense of speed. A deflated bytecode version would ofc be faster except for the time deflation happens ofc.
I'm glad to read that.johncl wrote: Anyway an interesting thought experiment.![]()
Tried messing around with code like that. It's hopeless. Exomizer just got the math right already.johncl wrote: Atm I am happy just finding (as you have seen in my posts) what memory I can use - and I try to do short optimizations like a print routine that does not need zero termination but rather use a bit in the string bytes to indicate termination (or special code for e.g. a jump or color change). The tradeoffs are somewhat vague though at times where perhaps a ROM routine would be easier to use, although I tend to try to avoid having to set full word pointers but bunch text into blocks that can be indexed by a byte.
Edit: Checking the 6502 opcode table I see that low nybble values $3, $7, $b and $f are unused (lower two bits set of opcode) so nice byte keys to use as deflater keys. No doubt exomizer does any compression better so I am sure this is somewhat silly to contemplate.- But I see a number of "patterns" in my code when I look at it - like ldx before its being used in a sta/lda NN,x (same with y). Of course the many lda NN, sta MM (and similar for x,y). And lets not forget the initialization of a,x,y (varying number of these) before calling some subroutine.
LDXSTA NN,MM = ldx #NN , sta MM,x
Yay! Saved one byte!