-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathkick003
510 lines (464 loc) · 7.83 KB
/
kick003
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
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
.PAGE 'KICK003'
;*--------------------------------------------------*
;* ENEMIES1 MOVE BY SPRITE MODE (SP5,SP6) *
;*--------------------------------------------------*
EN1MOV
LDA SPRITA
BMI EM1090
LDX #$07
EM1010 LDA SPRITA,X
AND #$F0
CMP #$20
BEQ EM1030
EM1020 DEX
CPX #$01
BNE EM1010
BEQ EM1090
EM1030
JSR SPRMOV
LDA WK5 ;MAN DONE?
BMI EM1040 ;NO
LDA #$80
STA SPRITA+0
LDA #$FF
STA SPRITA+1
LDA #$00
STA SPRITB+0
LDA #$00
STA TIMER3
EM1040
JSR SPRSPR ;FUUSEN BAUND
JSR SPRGEN
JMP EM1020
EM1090
RTS
;*--------------------------------------------------*
;* SPRITE PATTERN GENERATE *
;*--------------------------------------------------*
SPRGEN
LDA SPRITA,X
AND #$0C
CMP #$04 ;PACMAN?
BNE SPG090
LDA TIMER1
AND #$07
BNE SPG090 ;EXIT
LDY #$F6
LDA TIMER1
AND #$08
BNE *+3
INY
STY SV07F8,X
SPG090
RTS
;*-----------------------------------------------------*
;* CHECK FUUSEN BOUND *
;*-----------------------------------------------------*
SPRSPR
RTS
;*--------------------------------------------------*
;* SPRITE POINTER MOVE *
;* INPUT X-REG SPRITE NUMBER *
;*--------------------------------------------------*
SPRMOV
LDA #$FF
STA WK4 ;MOTIN FLAG OFF
STA WK5 ;UNDER LIMIT FLAG OFF
STA WK6 ;R-L LIMIT FLAG OFF
LDA SPRITA,X ;LIVE ?
BPL *+3 ;YES
RTS ;NOT LIVE RTS
LDA TIMER1
AND SPRITW,X ;WAITE CYCLE ?
BNE *+3 ;NO
RTS
DEC SPRITB,X ;INTERVAL TIMER ZERO?
BEQ *+3 ;YES
RTS ;NOT MOVE TIME RTS
TXA
PHA
LDA SPRITC,X ;GET FIXED TIMER
STA SPRITB,X ;SET INTERVAL TIMER
INC WK4 ;MOTION FLAG ON
;
;----- MOVE BY DIRECTION
LDA SPRITD,X ;GET DIRECTION
TAY
LDA WALKY,Y ;GET MOVE DISTANCE
STA WK0 ;SAVE
LDA WALKX,Y ;GET X MOVE DISTANCE
STA WK1 ;SAVE
TXA
ASL A
TAY ;Y=INDEX OF VIC-SPRITE
CLC
LDA VIC+1,Y
ADC WK0
STA VIC+1,Y ;RESET NEW Y POINTER
STA WK0 ;SAVE Y POINTER TO WK0
CLC
LDA VIC,Y
ADC WK1
STA VIC,Y ;RESET NEW X POINTER LOW
STA WK1 ;SAVE X POINTER TO WK1
CMP #$FE ;>=$FE?
BCC SPM010 ;NO
LDA MASKZ,X ;GET SPRITE X MSB MASK
AND MSIGX ;OFF X POINTER MSB
BCS SPM020 ;JMP
SPM010
CMP #$03 ;<$03?
BCS SPM030 ;NO
LDA MASKS,X ;GET SPRITE X MSB MASK
ORA MSIGX ;ON X POINTER MSB
SPM020
STA MSIGX ;SET X POINTER MSB OF VIC
SPM030
LDA MSIGX
AND MASKS,X
STA WK2 ;SAVE X POINTER MSB TO WK2
;
;----- CHECK LIMIT OF SCREEN UP-DOWN
LDA WK0 ;GET Y POINTER
CMP #30 ;>= 54?
BCS SPM040 ;YES
LDA #31 ;TUCH HEAD LIMIT
STA VIC+1,Y
BNE SPM090 ;JMP
SPM040
CMP #230 ;Y POINTER < 230 ?
BCC SPM100 ;YES NONE TUCH Y LIMIT
LDA #229 ;TUCH UNDER LIMIT
STA VIC+1,Y
INC WK5 ;UNDER LIMIT FLAG ON
SPM090
SEC ;CHANGE DIRECTION OF SPRITE
LDA #08 ;0-8,1-7,2-6,3-5,4-4,5-3,6-2,7-1
SBC SPRITD,X ;8-0,9-F,A-E,B-D,C-C,D-B,E-A,F-9
AND #$0F ;
STA SPRITD,X ;SET NEW DIRECTION
BPL SPM900 ;EXIT
;
;----- CHECK LIMIT OF SCREEN LEFT-RIGHT
SPM100
LDA WK2 ;X POINTER MSB ON?
BEQ SPM110 ;ON
LDA WK1 ;GET X POINTER
CMP #12 ;>=12?
BCC SPM900 ;NO GO TO EXIT
INC WK6 ;R-L LIMIT
LDA #11
STA VIC,Y
BNE SPM150
SPM110
LDA WK1 ;GET X POINTER
CMP #62 ;<62?
BCS SPM900 ;NO
INC WK6 ;R-L LIMIT
LDA #61
STA VIC,Y
SPM150
SEC ;CHANGE DIRECTION OF SPRITE
LDA #00 ;0-0,1-F,2-E,3-D,4-C,5-B,6-A,7-9
SBC SPRITD,X ;8-8,9-7,A-6,B-5,C-4,D-3,E-2,F-1
AND #$0F
STA SPRITD,X
SPM900
PLA
TAX
RTS
;*--------------------------------------------------*
;* ENEMY1 SET *
;*--------------------------------------------------*
EN1SET
LDA HEADTB+1
BPL E1S90A
LDA SPRITA
BMI E1S90A
LDA EN1WTV
BEQ E1S006
DEC EN1WTV
BNE E1S90A
E1S006 LDX #07
E1S008
LDA SPRITA,X
CMP #$FF
BEQ E1S010
DEX
CPX #01
BNE E1S008
BEQ E1S90A ;EXIT
E1S010
LDY ROUND
CPY #06
BCC *+4
LDY #06
LDA RANDOM
AND #$7F
ORA #$40
ORA ENTMTB-1,Y
STA EN1WTV
LDY #00 ;LOOK ENEMY2 LIVE TABLE
E1S020
LDA ENMY2A,Y ;LIVE ?
CMP #$FF
BNE E1S030 ;YES
INY
CPY #24
BCC E1S020
E1S90A JMP E1S900 ;EXIT
;
;----- CHENGE ENMY2 TO ENEMY1
E1S030
LDA RANDOM
AND #$07
STA WK0
TYA
CLC
ADC WK0
CMP #24
BCC E1S032
LDA #23
E1S032
TAY
E1S034
LDA ENMY2A,Y
CMP #$FF
BNE E1S036
DEY
BPL E1S034
JMP E1S900
E1S036
TXA
ASL A
TAX
LDA EN2YP,Y ;GET ENEMY2 Y POINT
STA SP0Y,X ;SET ENEMY1 Y POINT
LDA EN2XPL,Y ;GET ENEMY2 X POINT L
STA SP0X,X ;SET ENEMY1 X POINT
TXA
LSR A
TAX
LDA EN2XPH,Y ;GET ENEMY2 X POINT H
BEQ E1S040
LDA MASKS,X
ORA MSIGX
BNE E1S050
E1S040
LDA MASKZ,X
AND MSIGX
E1S050
STA MSIGX ;SET ENEMY1 X POINT MSB
LDA ENMY2A,Y
AND #$0F
ORA #$20 ;MOTION BIT ON
STA SPRITA,X
LDA #01
STA SPRITB,X ;SET DEC TIME
LDA #$08
STA SPRITD,X ;DOWN MODE
TYA
PHA ;Y-REG SAVE
LDA ENMY2A,Y
AND #$03
TAY
LDA EN2COL,Y
STA SP0COL,X ;SET COLOR
LDA DWITB1,Y
STA SPRITW,X ;WAITE DATA
LDA DWITB0,Y
STA SPRITC,X ;SET FIX TIME
PLA
PHA
TAY
LDA ENMY2A,Y
LSR A
LSR A
AND #$03
TAY
LDA EN2PTS,Y
STA SV07F8,X ;SET PTN-NO.
STA $07F8,X
DEY ;PACMAN ?
BNE E1S060 ;NO
LDA #$FF
STA EN1WTV ;INTERVAL RESET
E1S060
PLA
TAY
LDA SPENA
ORA MASKS,X
STA SPENA ;SPRITE ENABLE
;
;----- CLEAR ENEMY 2
LDA #$FF
STA ENMY2A,Y ;KILL STOP FUUSEN
TXA
PHA
TYA
TAX ;X=ENEMEY2 INDEX
JSR BITCHR ;GET SCREEN ADDRESS (WK0,WK1)
LDA #00
TAY
STA (WK0),Y
INY
STA (WK0),Y
LDY #40
STA (WK0),Y
INY
STA (WK0),Y
PLA
TAX
E1S900
RTS
ENTMTB .BYTE $80,$60,$50,$40,$30,$20
EN2PTS .BYTE $FA,$F6,$FB
DWITB0 .BYTE $02,$01,$01,$01
DWITB1 .BYTE $0F,$03,$07,$0F
;*--------------------------------------------------*
;* SHIP MOVE *
;*--------------------------------------------------*
SHPMOV
LDA SPRITA ;GET SHIP MODE
ORA KILLSP
BPL *+3 ;SHIP LIVE?
RTS ;NO
JSR READSW ;PLAYER'S SW READ
LDA FIRE ;KICK?
BEQ SHM080 ;NO
LDA DFIRE
BNE SHM055
LDA #$0A
STA FIREOF
STA KIKTIM
SHM055
LDA FIREOF
BEQ SHM080
DEC FIREOF
SHM060
LDA #$F4
STA SV07F8+1 ;SET KICK PATTERN
LDA #$02
STA $D01D ;X
LDA SP0X
SEC
SBC #12
STA SP1X
CMP #$FF-11
BCC SHM070
LDA MSIGX
AND #$FD
STA MSIGX
SHM070
JMP SHM900
SHM080
LDA KIKTIM
BEQ SHM100
DEC KIKTIM
BEQ SHM112
BEQ *+5
JMP SHM900
SHM100
LDA #00
STA $D01D
LDY #$04
LDA ROTATE
BEQ SHM120 ;EXIT
BPL SHM110
LDY #$0C
SHM110
STY SPRITD
LDX #00
JSR SPRMOV
SHM112 LDX SP0X
STX SP1X
LDA MSIGX
AND #$01
TAX
LDA MSIGX
AND #$FC
ORA MSTB,X
STA MSIGX
JMP SHM130
SHMIDL
SHM120
LDA TIMER1
AND #$0F
BNE SHM150
LDA TIMER1
AND #$E0
LSR A
JMP SHM140
SHM130
LDA SP0X
SHM140
LSR A
LSR A
LSR A
AND #$03
TAX
LDA PTNTBL,X
STA SV07F8+1
;
;----- ON HEAD WITH MOVE
LDX #$02
SHM150
LDA SPRITA,X
AND #$F0
BEQ SHM170
SHM160
INX
CPX #08
BNE SHM150
BEQ SHM900
SHM170
TXA
ASL A
TAY
LDA SP0X
STA SP0X,Y
LDA MSIGX
AND #$01
BNE SHM180
LDA MSIGX
AND MASKZ,X
JMP SHM190
SHM180
LDA MSIGX
ORA MASKS,X
SHM190
STA MSIGX
LDA SPRITA,X
AND #$0C
CMP #$04 ;PACMAN?
BNE SHM160
LDA TIMER1
ADC #$00
AND #$07
BNE SHM160
LDY #$F6
LDA TIMER1
AND #$08
BNE *+4
LDY #$F8
STY SV07F8,X
JMP SHM160
SHM900
RTS
MSTB .BYTE $00,$03
PTNTBL .BYTE $F1,$F3,$F2,$F1
;*--------------------------------------------------*
;* READ SW, JMP USED DEVICE *
;*--------------------------------------------------*
READSW
LDA SCANF
AND #$03
ASL A
TAY
LDA SWTABL,Y
STA WK0
LDA SWTABL+1,Y
STA WK1
JMP (WK0)
SWTABL .WORD RDKEY,RDKEY,RDKEY
.END