Okay, now I have working code for tilting a 64x64 sprite.
Code:
big_sprite_rotation:
phb
lda #$7e7e
pha
plb
plb
ldy #$0000
sty {temp4}
sty {temp3}
lda #$0008
clc
adc {shift_factor} //shift factor is between -8 and 7
asl #2
sta {temp2}
-;
and #$0038
asl #2
clc
adc {temp3}
tax
jsr copy_collumn
lda {temp4}
clc
adc #$0020
sta {temp4}
tay
lda {temp3}
clc
adc #$0004
sta {temp3}
cmp #$0020
beq +
lda {temp2}
sec
sbc {shift_factor}
sta {temp2}
bra -
+;
ldx #$0000
lda {shift_factor}
asl #5
sta {temp}
-;
lda {temp}
lsr #6
sep #$20
cmp #$00
beq ++
bpl +
jsr shift_pixels_left
bra ++
+;
jsr shift_pixels_right
+;
rep #$20
lda {temp}
sec
sbc {shift_factor}
sta {temp}
inx
inx
txa
and #$001f
cmp #$0010
bne -
txa
clc
adc #$00f0
tax
cpx #$0800
beq +
jmp -
+;
plb
rts
copy_collumn:
lda #$0008
sta {temp}
-;
lda {rotating_sprite}+$0000,x
sta {rotating_sprite_buffer}+$0000,y
lda {rotating_sprite}+$0002,x
sta {rotating_sprite_buffer}+$0010,y
lda {rotating_sprite}+$0020,x
sta {rotating_sprite_buffer}+$0002,y
lda {rotating_sprite}+$0022,x
sta {rotating_sprite_buffer}+$0012,y
lda {rotating_sprite}+$0040,x
sta {rotating_sprite_buffer}+$0004,y
lda {rotating_sprite}+$0042,x
sta {rotating_sprite_buffer}+$0014,y
lda {rotating_sprite}+$0060,x
sta {rotating_sprite_buffer}+$0006,y
lda {rotating_sprite}+$0062,x
sta {rotating_sprite_buffer}+$0016,y
lda {rotating_sprite}+$0080,x
sta {rotating_sprite_buffer}+$0008,y
lda {rotating_sprite}+$0082,x
sta {rotating_sprite_buffer}+$0018,y
lda {rotating_sprite}+$00a0,x
sta {rotating_sprite_buffer}+$000a,y
lda {rotating_sprite}+$00a2,x
sta {rotating_sprite_buffer}+$001a,y
lda {rotating_sprite}+$00c0,x
sta {rotating_sprite_buffer}+$000c,y
lda {rotating_sprite}+$00c2,x
sta {rotating_sprite_buffer}+$001c,y
lda {rotating_sprite}+$00e0,x
sta {rotating_sprite_buffer}+$000e,y
lda {rotating_sprite}+$00e2,x
sta {rotating_sprite_buffer}+$001e,y
txa
clc
adc #$0100
tax
tya
clc
adc #$0100
tay
dec {temp}
beq +
jmp -
+;
rts
shift_pixels_right:
-;
pha
lsr {rotating_sprite_buffer}+$0000,x
ror {rotating_sprite_buffer}+$0020,x
ror {rotating_sprite_buffer}+$0040,x
ror {rotating_sprite_buffer}+$0060,x
ror {rotating_sprite_buffer}+$0080,x
ror {rotating_sprite_buffer}+$00a0,x
ror {rotating_sprite_buffer}+$00c0,x
ror {rotating_sprite_buffer}+$00e0,x
lsr {rotating_sprite_buffer}+$0001,x
ror {rotating_sprite_buffer}+$0021,x
ror {rotating_sprite_buffer}+$0041,x
ror {rotating_sprite_buffer}+$0061,x
ror {rotating_sprite_buffer}+$0081,x
ror {rotating_sprite_buffer}+$00a1,x
ror {rotating_sprite_buffer}+$00c1,x
ror {rotating_sprite_buffer}+$00e1,x
lsr {rotating_sprite_buffer}+$0010,x
ror {rotating_sprite_buffer}+$0030,x
ror {rotating_sprite_buffer}+$0050,x
ror {rotating_sprite_buffer}+$0070,x
ror {rotating_sprite_buffer}+$0090,x
ror {rotating_sprite_buffer}+$00b0,x
ror {rotating_sprite_buffer}+$00d0,x
ror {rotating_sprite_buffer}+$00f0,x
lsr {rotating_sprite_buffer}+$0011,x
ror {rotating_sprite_buffer}+$0031,x
ror {rotating_sprite_buffer}+$0051,x
ror {rotating_sprite_buffer}+$0071,x
ror {rotating_sprite_buffer}+$0091,x
ror {rotating_sprite_buffer}+$00b1,x
ror {rotating_sprite_buffer}+$00d1,x
ror {rotating_sprite_buffer}+$00f1,x
pla
dec
beq +
jmp -
+;
rts
shift_pixels_left:
-;
pha
asl {rotating_sprite_buffer}+$00e0,x
rol {rotating_sprite_buffer}+$00c0,x
rol {rotating_sprite_buffer}+$00a0,x
rol {rotating_sprite_buffer}+$0080,x
rol {rotating_sprite_buffer}+$0060,x
rol {rotating_sprite_buffer}+$0040,x
rol {rotating_sprite_buffer}+$0020,x
rol {rotating_sprite_buffer}+$0000,x
asl {rotating_sprite_buffer}+$00e1,x
rol {rotating_sprite_buffer}+$00c1,x
rol {rotating_sprite_buffer}+$00a1,x
rol {rotating_sprite_buffer}+$0081,x
rol {rotating_sprite_buffer}+$0061,x
rol {rotating_sprite_buffer}+$0041,x
rol {rotating_sprite_buffer}+$0021,x
rol {rotating_sprite_buffer}+$0001,x
asl {rotating_sprite_buffer}+$00f0,x
rol {rotating_sprite_buffer}+$00d0,x
rol {rotating_sprite_buffer}+$00b0,x
rol {rotating_sprite_buffer}+$0090,x
rol {rotating_sprite_buffer}+$0070,x
rol {rotating_sprite_buffer}+$0050,x
rol {rotating_sprite_buffer}+$0030,x
rol {rotating_sprite_buffer}+$0010,x
asl {rotating_sprite_buffer}+$00f1,x
rol {rotating_sprite_buffer}+$00d1,x
rol {rotating_sprite_buffer}+$00b1,x
rol {rotating_sprite_buffer}+$0091,x
rol {rotating_sprite_buffer}+$0071,x
rol {rotating_sprite_buffer}+$0051,x
rol {rotating_sprite_buffer}+$0031,x
rol {rotating_sprite_buffer}+$0011,x
pla
inc
beq +
jmp -
+;
rts