10110010 byte 1.. 11010110 byte 2.. etc.. 00111001 01010110 11011010 10110101 00110011 10110100

11001101 01011000 10100111 11111111 00101000 01010101 11011010 00100110

This has to be repeated for blocks 'b', 'c', 'd' (using the right lookup tables), but since source4 was saved in Y, that code can start with TAY instead of 'LDY source4' to save 1 cycle.

tax lda moveHighNybbleToLowNybble,x is replaced by sta selfmod:+1 selfmod: lda moveHighNybbleToLowNybble

;------------------------------- ;4x4 & 2x2 rotation (195 cycles) ;------------------------------- ldy $61 lax $65 and #$0f eor shl4, y sta $81 tya and #$f0 eor shr4, x sta $85 ldy $63 lda $67 and #$0f eor shl4, y ldy $81 tax and #$33 eor shl2_eor_cc, y sta $91 tya and #$cc eor shr2_eor_33, x sta $93 lda $63 ldx $67 and #$f0 eor shr4, x ldy $85 tax and #$33 eor shl2_eor_cc, y sta $95 tya and #$cc eor shr2_eor_33, x sta $97 ldy $60 lax $64 and #$0f eor shl4, y sta $80 tya and #$f0 eor shr4, x sta $84 ldy $62 lax $66 and #$0f eor shl4, y ldy $80 and #$33 eor shl2_eor_cc, y sta $90 tya and #$cc eor shr2_eor_33, x sta $92 lda #$62 and #$f0 eor shr4, x ldy $84 tax and #$33 eor shl2_eor_cc, y sta $94 tya and #$cc eor shr2_eor_33, x sta $96 ;------------------------- ;1x1 rotation (104 cycles) ;------------------------- ldy $90 lax $91 and #$55 eor shl1_eor_aa, y sta $70 tya and #$aa eor shr1_eor_55, x sta $71 ldy $92 lax $93 and #$55 eor shl1_eor_aa, y sta $72 tya and #$aa eor shr1_eor_55, x sta $73 ldy $94 lax $95 and #$55 eor shl1_eor_aa, y sta $74 tya and #$aa eor shr1_eor_55, x sta $75 ldy $96 lax $97 and #$55 eor shl1_eor_aa, y sta $76 tya and #$aa eor shr1_eor_55, x sta $77