-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame_7_update_screen.asm
More file actions
405 lines (317 loc) · 4.82 KB
/
game_7_update_screen.asm
File metadata and controls
405 lines (317 loc) · 4.82 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
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
drawGame7:
;The code expects tempVar1 to be set before calling this method
;tempVar1==0 means no ball and tempVar2 == yes ball
;This will tell help the code figure out which boxes should be drawn with a ball and which should not.
LDA tempVar1
BEQ .draw_target_board
;draw update board
LDA stomp_input
JMP .start_draw
.draw_target_board:
LDA stomp_target
.start_draw:
ASL A
TAX
LDA game_7_boards+1, x
PHA
LDA game_7_boards, x
PHA
PHP ;this simulates getting a 16 bit address into mem for RTI
RTI ;this is not a normal RTI, no. This is a special RTI to jump to a table!
game_7_boards:
.dw gm_7_00, gm_7_01, gm_7_02, gm_7_03
.dw gm_7_04, gm_7_05, gm_7_06, gm_7_07
.dw gm_7_08, gm_7_09
gm_7_00:
JSR draw_7_00
RTS
gm_7_01:
JSR draw_7_01
RTS
gm_7_02:
JSR draw_7_02
RTS
gm_7_03:
JSR draw_7_03
RTS
gm_7_04:
JSR draw_7_00
JSR draw_7_01
RTS
gm_7_05:
JSR draw_7_01
JSR draw_7_02
RTS
gm_7_06:
JSR draw_7_02
JSR draw_7_03
RTS
gm_7_07:
JSR draw_7_03
JSR draw_7_00
RTS
gm_7_08:
JSR draw_7_00
JSR draw_7_02
RTS
gm_7_09:
JSR draw_7_01
JSR draw_7_03
RTS
draw_7_00:
LDA tempVar1
BNE .draw_ball
;;;;;;;;;;;do_not_draw_ball
;top of left_and_top_no_ball (02)
LDA #$21
STA $2006
LDA #$AD
STA $2006
LDA #$23
STA $2007
LDA #$24
STA $2007
;bottom of left_and_top_no_ball (02)
LDA #$21
STA $2006
LDA #$CD
STA $2006
LDA #$33
STA $2007
LDA #$34
STA $2007
JMP .continue
;;;;;;;;do draw ball
.draw_ball:
;top of left_and_top_yes_ball (06)
LDA #$21
STA $2006
LDA #$AD
STA $2006
LDA #$20
STA $2007
LDA #$21
STA $2007
;bottom of left_and_top_yes_ball (06)
LDA #$21
STA $2006
LDA #$CD
STA $2006
LDA #$30
STA $2007
LDA #$31
STA $2007
.continue:
;top of top_no_ball (01)
LDA #$21
STA $2006
LDA #$ED
STA $2006
LDA #$40
STA $2007
LDA #$41
STA $2007
RTS
draw_7_01:
LDA tempVar1
BNE .draw_ball
;;;;;;;;;;;do_not_draw_ball
;top of left_and_top_no_ball (02)
LDA #$21
STA $2006
LDA #$6F
STA $2006
LDA #$23
STA $2007
LDA #$24
STA $2007
;bottom of left_and_top_no_ball (02)
LDA #$21
STA $2006
LDA #$8F
STA $2006
LDA #$33
STA $2007
LDA #$34
STA $2007
JMP .continue
;;;;;;;;do draw ball
.draw_ball:
;top of left_and_top_yes_ball (06)
LDA #$21
STA $2006
LDA #$6F
STA $2006
LDA #$20
STA $2007
LDA #$21
STA $2007
;bottom of left_and_top_yes_ball (06)
LDA #$21
STA $2006
LDA #$8F
STA $2006
LDA #$30
STA $2007
LDA #$31
STA $2007
.continue:
;top of left_no_ball (00)
LDA #$21
STA $2006
LDA #$71
STA $2006
LDA #$22
STA $2007
;bottom of left_no_ball (00)
LDA #$21
STA $2006
LDA #$91
STA $2006
LDA #$32
STA $2007
RTS
draw_7_02:
LDA tempVar1
BNE .draw_ball
;;;;;;;;;;;do_not_draw_ball
;top of top_no_ball (01)
LDA #$21
STA $2006
LDA #$B1
STA $2006
LDA #$40
STA $2007
LDA #$41
STA $2007
JMP .continue
.draw_ball:
;top of top_yes_ball (05)
LDA #$21
STA $2006
LDA #$B1
STA $2006
LDA #$25
STA $2007
LDA #$26
STA $2007
;bottom of top_yes_ball (05)
LDA #$21
STA $2006
LDA #$D1
STA $2006
LDA #$35
STA $2007
LDA #$36
STA $2007
.continue:
;top of left_no_ball (00)
LDA #$21
STA $2006
LDA #$B3
STA $2006
LDA #$2D
STA $2007
;bottom of left_no_ball (00)
LDA #$21
STA $2006
LDA #$D3
STA $2006
LDA #$3D
STA $2007
;top of top_no_ball (01)
LDA #$21
STA $2006
LDA #$F1
STA $2006
LDA #$40
STA $2007
LDA #$41
STA $2007
;if stomp_target==6 we have to redraw the top right corner of the basket
LDA stomp_target
CMP #$06
BNE .end
;top of left_and_top_no_ball (02)
LDA #$21
STA $2006
LDA #$F1
STA $2006
LDA #$23
STA $2007
.end:
RTS
draw_7_03:
LDA tempVar1
BNE .draw_ball
;top of left_no_ball (00)
LDA #$21
STA $2006
LDA #$EF
STA $2006
LDA #$22
STA $2007
;bottom of left_no_ball (00)
LDA #$22
STA $2006
LDA #$0F
STA $2006
LDA #$32
STA $2007
JMP .continue
.draw_ball:
;top of left_yes_ball (04)
LDA #$21
STA $2006
LDA #$EF
STA $2006
LDA #$27
STA $2007
LDA #$28
STA $2007
;bottom of left_yes_ball (04)
LDA #$22
STA $2006
LDA #$0F
STA $2006
LDA #$37
STA $2007
LDA #$38
STA $2007
.continue:
;top of left_no_ball (00)
LDA #$21
STA $2006
LDA #$F1
STA $2006
LDA #$22
STA $2007
;bottom of left_no_ball (00)
LDA #$22
STA $2006
LDA #$11
STA $2006
LDA #$32
STA $2007
;top of top_no_ball (01)
LDA #$22
STA $2006
LDA #$2F
STA $2006
LDA #$40
STA $2007
LDA #$41
STA $2007
;if stomp_target==6 we have to redraw the top right corner of the basket
LDA stomp_target
CMP #$06
BNE .end
;top of left_and_top_no_ball (02)
LDA #$21
STA $2006
LDA #$F1
STA $2006
LDA #$23
STA $2007
.end
RTS