-
Notifications
You must be signed in to change notification settings - Fork 0
/
face_hero_northeast.s
97 lines (74 loc) · 2.15 KB
/
face_hero_northeast.s
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
; vim: set syntax=asm_ca65:
.include "constants.inc"
.include "macros/write_oam.inc"
TILE_0_INDEX_DEFAULT = $12
TILE_1_INDEX_DEFAULT = $12
TILE_2_INDEX_DEFAULT = $16
TILE_3_INDEX_DEFAULT = $15
TILE_0_INDEX_ANIMATION_A = $12
TILE_1_INDEX_ANIMATION_A = $12
TILE_2_INDEX_ANIMATION_A = $48
TILE_3_INDEX_ANIMATION_A = $47
TILE_0_INDEX_ANIMATION_B = $12
TILE_1_INDEX_ANIMATION_B = $12
TILE_2_INDEX_ANIMATION_B = $58
TILE_3_INDEX_ANIMATION_B = $57
.segment "ZEROPAGE"
.import frame_counter
.segment "CODE"
.proc face_hero_northeast
PHP
PHA
TXA
PHA
TYA
PHA
LDA frame_counter
CMP #$10
BCC @animation_a
LDA frame_counter
CMP #$20
BCC @default
LDA frame_counter
CMP #$30
BCC @animation_b
JMP @default
@default:
write_oam TILE_0_INDEX_DEFAULT, HERO_0_INDEX_OFFSET
write_oam TILE_1_INDEX_DEFAULT, HERO_1_INDEX_OFFSET
write_oam TILE_2_INDEX_DEFAULT, HERO_2_INDEX_OFFSET
write_oam TILE_3_INDEX_DEFAULT, HERO_3_INDEX_OFFSET
write_oam FLIP_HORIZONTALLY, HERO_0_ATTR_OFFSET
write_oam ZERO, HERO_1_ATTR_OFFSET
write_oam FLIP_HORIZONTALLY, HERO_2_ATTR_OFFSET
write_oam FLIP_HORIZONTALLY, HERO_3_ATTR_OFFSET
JMP @done
@animation_a:
write_oam TILE_0_INDEX_ANIMATION_A, HERO_0_INDEX_OFFSET
write_oam TILE_1_INDEX_ANIMATION_A, HERO_1_INDEX_OFFSET
write_oam TILE_2_INDEX_ANIMATION_A, HERO_2_INDEX_OFFSET
write_oam TILE_3_INDEX_ANIMATION_A, HERO_3_INDEX_OFFSET
write_oam FLIP_HORIZONTALLY, HERO_0_ATTR_OFFSET
write_oam ZERO, HERO_1_ATTR_OFFSET
write_oam FLIP_HORIZONTALLY, HERO_2_ATTR_OFFSET
write_oam FLIP_HORIZONTALLY, HERO_3_ATTR_OFFSET
JMP @done
@animation_b:
write_oam TILE_0_INDEX_ANIMATION_B, HERO_0_INDEX_OFFSET
write_oam TILE_1_INDEX_ANIMATION_B, HERO_1_INDEX_OFFSET
write_oam TILE_2_INDEX_ANIMATION_B, HERO_2_INDEX_OFFSET
write_oam TILE_3_INDEX_ANIMATION_B, HERO_3_INDEX_OFFSET
write_oam FLIP_HORIZONTALLY, HERO_0_ATTR_OFFSET
write_oam ZERO, HERO_1_ATTR_OFFSET
write_oam FLIP_HORIZONTALLY, HERO_2_ATTR_OFFSET
write_oam FLIP_HORIZONTALLY, HERO_3_ATTR_OFFSET
@done:
PLA
TAY
PLA
TAX
PLA
PLP
RTS
.endproc
.export face_hero_northeast