-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathanimations.asm
67 lines (63 loc) · 1.28 KB
/
animations.asm
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/////////////////////////////////////////
// START ANIMATION
//
start_animation:
cmp player_anim
beq !end+
tax
sta player_anim
lda spr_anims_reload,x
sta player_anim_delay
inc player_anim_delay
lda spr_anims_to,x
sta player_anim_end
inc player_anim_end
lda spr_anims_from,x
sta player_anim_frame
tax
clc
adc #sprite_data/64
sta $07F8 // sprite data #1
lda eyes, x
clc
adc #sprite_data/64
sta $07F9 // sprite data #2
!end:
rts
/////////////////////////////////////////
// MOVE ANIMATION
//
move_animation:
lda player_anim
tax
dec player_anim_delay
bpl !end+
lda spr_anims_reload,x
sta player_anim_delay
inc player_anim_frame
lda player_anim_frame
cmp player_anim_end
bne !+
lda spr_anims_from,x
sta player_anim_frame
!:
tax
clc
adc #sprite_data/64
sta $07F8 // sprite data #1
lda eyes, x
clc
adc #sprite_data/64
sta $07F9 // sprite data #2
!end:
rts
eyes:
.byte 0,0,0,0,0,0,0,0
.byte 0,0,0,0,0,0,0,0
.byte 48,48,48,48,52,52,52,52
.byte 50,50,50,50,54,54,54,54
.byte 50,50,50,50,54,54,54,54
.byte 50,50,50,50,54,54,54,54
.byte 0,0,0,0,0,0,0,0
.byte 0,0,0,0,0,0,0,0
.byte 0,0,0,0,64,65,66,67