-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhandle_input_game_7.asm
More file actions
284 lines (275 loc) · 4.2 KB
/
handle_input_game_7.asm
File metadata and controls
284 lines (275 loc) · 4.2 KB
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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
handle_input_game_7:
LDA muteButtons
BNE .ignore_buttons
JMP .dont_ignore_buttons
.ignore_buttons:
RTS
.dont_ignore_buttons:
LDA buttons
BEQ .continue
LDA maskingTimer
CMP #$20
BMI .bad_buttons
JMP .continue
.bad_buttons:
DEC gamestate
RTS
.continue:
LDA buttons
; CMP #$80
; BEQ pressA_game7
; CMP #$40
; BEQ pressB_game7
CMP #$10
BEQ pressStart_game7
CMP #$20
BEQ pressSelect_game7
LDA buttons
AND #$08
BNE pressUp_game7
LDA buttons
AND #$04
BNE pressDown_game7
LDA buttons
AND #$02
BNE pressLeft_game7
LDA buttons
AND #$01
BNE pressRight_game7
RTS
pressSelect_game7:
JMP pressSelect_game7_2
;pressB_game7:
; JMP pressB_game7_2
;pressA_game7:
; JMP pressA_game7_2
pressRight_game7:
JMP pressRight_game7_2
pressLeft_game7:
JMP pressLeft_game7_2
pressDown_game7:
JMP pressDown_game7_2
pressStart_game7:
JMP handle_input_game7_done
pressUp_game7:
LDA stomp_target
CMP #$01
BEQ .good_input
CMP #$04
BEQ .good_input
CMP #$05
BEQ .good_input
CMP #$09
BEQ .good_input
;bad input
JSR game_7_bad_sound
JSR waitVBlank
DEC gamestate
JMP .end
.good_input:
LDA stomp_input
CMP #$FF
BEQ .first_input
CMP #$00
BEQ .four_board
CMP #$01
BEQ .first_input
CMP #$02
BEQ .five_board
CMP #$03
BEQ .nine_board
JMP .end
.four_board:
LDA #$04
JMP .draw_board
.five_board:
LDA #$05
JMP .draw_board
.nine_board:
LDA #$09
JMP .draw_board
.first_input:
LDA #$01
.draw_board:
STA stomp_input
LDA #$01
STA tempVar1
STA needDrawGame7
.end:
LDA buttons
AND #$01
BNE .jump_right
LDA buttons
AND #$04
BNE .jump_down
LDA buttons
AND #$02
BNE .jump_left
JMP handle_input_game7_done
.jump_right:
JMP pressRight_game7
.jump_down:
JMP pressDown_game7
.jump_left:
JMP pressLeft_game7
pressDown_game7_2:
LDA stomp_target
CMP #$03
BEQ .good_input
CMP #$06
BEQ .good_input
CMP #$07
BEQ .good_input
CMP #$09
BEQ .good_input
;bad input
JSR game_7_bad_sound
JSR waitVBlank
DEC gamestate
JMP .end
.good_input:
LDA stomp_input
CMP #$FF
BEQ .first_input
CMP #$00
BEQ .seven_board
CMP #$01
BEQ .nine_board
CMP #$02
BEQ .six_board
CMP #$03
BEQ .first_input
JMP .end
.six_board:
LDA #$06
JMP .draw_board
.seven_board:
LDA #$07
JMP .draw_board
.nine_board:
LDA #$09
JMP .draw_board
.first_input:
LDA #$03
.draw_board:
STA stomp_input
LDA #$01
STA tempVar1
STA needDrawGame7
.end:
LDA buttons
AND #$01
BNE .jump_right
LDA buttons
AND #$02
BNE .jump_left
JMP handle_input_game7_done
.jump_right:
JMP pressRight_game7
.jump_left:
JMP pressLeft_game7
pressLeft_game7_2:
LDA stomp_target
CMP #$00
BEQ .good_input
CMP #$04
BEQ .good_input
CMP #$07
BEQ .good_input
CMP #$08
BEQ .good_input
;bad input
JSR game_7_bad_sound
JSR waitVBlank
DEC gamestate
JMP .end
.good_input:
LDA stomp_input
CMP #$FF
BEQ .first_input
CMP #$00
BEQ .first_input
CMP #$01
BEQ .four_board
CMP #$02
BEQ .eight_board
CMP #$03
BEQ .seven_board
JMP .end
.four_board:
LDA #$04
JMP .draw_board
.seven_board:
LDA #$07
JMP .draw_board
.eight_board:
LDA #$08
JMP .draw_board
.first_input:
LDA #$00
.draw_board:
STA stomp_input
LDA #$01
STA tempVar1
STA needDrawGame7
.end:
LDA buttons
AND #$01
BNE .jump_right
JMP handle_input_game7_done
.jump_right:
JMP pressRight_game7
pressRight_game7_2:
LDA stomp_target
CMP #$02
BEQ .good_input
CMP #$05
BEQ .good_input
CMP #$06
BEQ .good_input
CMP #$08
BEQ .good_input
;bad input
JSR game_7_bad_sound
JSR waitVBlank
DEC gamestate
JMP .end
.good_input:
LDA stomp_input
CMP #$FF
BEQ .first_input
CMP #$00
BEQ .eight_board
CMP #$01
BEQ .five_board
CMP #$02
BEQ .first_input
CMP #$03
BEQ .six_board
JMP .end
.five_board:
LDA #$05
JMP .draw_board
.six_board:
LDA #$06
JMP .draw_board
.eight_board:
LDA #$08
JMP .draw_board
.first_input:
LDA #$02
.draw_board:
STA stomp_input
LDA #$01
STA tempVar1
STA needDrawGame7
.end:
JMP handle_input_game7_done
pressA_game7_2:
JMP handle_input_game7_done
pressB_game7_2:
JMP handle_input_game7_done
pressSelect_game7_2:
JMP handle_input_game7_done
handle_input_game7_done:
RTS