-
Notifications
You must be signed in to change notification settings - Fork 0
/
input.a
141 lines (126 loc) · 1.69 KB
/
input.a
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
LSPEED = 9
RSPEED = 0-9
VSPEED = 0-20
GRAVITY = 10
lda CXPPMM
and #$80
beq input_nocol
ldy JUST_COLLIDED
bne input_nocol
; Collision energy transfer
lda SPEEDX0_LO
ldy SPEEDX1_LO
sta SPEEDX1_LO
sty SPEEDX0_LO
lda SPEEDY0_LO
ldy SPEEDY1_LO
sta SPEEDY1_LO
sty SPEEDY0_LO
lda SPEEDX0_HI
ldy SPEEDX1_HI
sta SPEEDX1_HI
sty SPEEDX0_HI
lda SPEEDY0_HI
ldy SPEEDY1_HI
sta SPEEDY1_HI
sty SPEEDY0_HI
lda #$f
sta COLLISION_SOUND
lda #4
sta JUST_COLLIDED
jmp input_nocheck
input_nocol
!zone { ; player 0
txa
and #$10 ; Up button
beq .noup
clc
lda SPEEDY0_LO
adc #<VSPEED
sta SPEEDY0_LO
lda SPEEDY0_HI
adc #>VSPEED
sta SPEEDY0_HI
.noup
txa
and #$80 ; Right button
beq .nor
clc
lda SPEEDX0_LO
adc #<RSPEED
sta SPEEDX0_LO
lda SPEEDX0_HI
sta P0LASTX
adc #>RSPEED
sta SPEEDX0_HI
jmp .nohor
.nor
txa
and #$40 ; Left button
beq .nohor
clc
lda SPEEDX0_LO
adc #<LSPEED
sta SPEEDX0_LO
lda SPEEDX0_HI
sta P0LASTX
adc #>LSPEED
sta SPEEDX0_HI
.nohor
}
!zone { ; player 1
txa
and #1 ; Up button
beq .noup
clc
lda SPEEDY1_LO
adc #<VSPEED
sta SPEEDY1_LO
lda SPEEDY1_HI
adc #>VSPEED
sta SPEEDY1_HI
.noup
txa
and #8 ; Right button
beq .nor
clc
lda SPEEDX1_LO
adc #<RSPEED
sta SPEEDX1_LO
lda SPEEDX1_HI
sta P1LASTX
adc #>RSPEED
sta SPEEDX1_HI
jmp .nohor
.nor
txa
and #4 ; Left button
beq .nohor
clc
lda SPEEDX1_LO
adc #<LSPEED
sta SPEEDX1_LO
lda SPEEDX1_HI
sta P1LASTX
adc #>LSPEED
sta SPEEDX1_HI
.nohor
}
input_nocheck
sta CXCLR
; Gravity p0
clc
lda SPEEDY0_LO
adc #<GRAVITY
sta SPEEDY0_LO
lda SPEEDY0_HI
adc #>GRAVITY
sta SPEEDY0_HI
; Gravity p1
clc
lda SPEEDY1_LO
adc #<GRAVITY
sta SPEEDY1_LO
lda SPEEDY1_HI
adc #>GRAVITY
sta SPEEDY1_HI