-
Notifications
You must be signed in to change notification settings - Fork 85
/
Copy pathkick002
480 lines (405 loc) · 6.7 KB
/
kick002
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
.PAGE 'KICK002'
;*--------------------------------------------------*
;* GAME START INITIALIZE *
;*--------------------------------------------------*
GMINIT
LDA #00 ;SCORE CLEAR
STA SCORE
STA SCORE+1
STA SCORE+2
GMI000 LDA #$00
STA EXTCOL
STA BGCOL0
STA XTRA ;EXTRA SHIP FLAG OFF
STA ROUND ;ROUND NUMBER CLEAR
LDA #$FF
STA NUMENM ;ENEMY ALL DONE
RTS
;*--------------------------------------------------*
;* ROUND INITIALIZE *
;*--------------------------------------------------*
RDINIT
LDA #$7F
STA CIAICR ;CIA INTERRUPT DESABLE
LDA CIAICR ;CIA INTERRUPT CLEAR
LDA #$A5 ;FARST INT. POSISION
STA RASTER
LDA #$FF ;INTERRUPT CLARE
STA VICIRQ
LDA #$01 ;MASK SET
STA IRQMSK
STA IRQCNT ;COUNTER INIT
LDA NUMENM ;ENEMY ALL DONE?
BPL *+4 ;NO
INC ROUND ;NEXT ROUND NUMBER
LDX ROUND
CPX #$07 ;PAST 7 ROUND ?
BCC *+4 ;NO
LDX #$08
LDA ENMCNT-1,X ;GET NUMBER OF ENEMIES
STA NUMENM ;SET IT
LDA EN2TIM ;GET ENEMY2 MOVE WAITE TIME
STA EN2WTF ;SET IT
LDA #01
STA EN2WTV ;
LDA #$C0
STA EN1WTV ;DOWN START WAITE 3 SEC
LDA ROUND
CMP #08
BCC *+4
LDA #08
ASL A ;SET ENYMIES 2 TABLE
TAY
LDA EN2TB-2,Y
STA WK0
LDA EN2TB-1,Y
STA WK1
LDY #23
RDI010
LDA (WK0),Y
STA ENMY2A,Y
DEY
BPL RDI010
LDY #00 ;SET ENEMIES 2 TABLE
RDI040
LDA EN2BGN,Y
STA EN2YP,Y ;EN2YP(24),EN2XPL(24),EN2XPH(24)
INY
CPY #24+24+24
BNE RDI040
;
;----- KILL ALL SPRITE FUNCTION
LDY #08-1
LDA #$FF
RDI058
STA SPRITA,Y
DEY
BPL RDI058
LDY #24-1
LDA #01
RDI060
STA SPRITB,Y
DEY
BPL RDI060
;
;----- SET SPRITE FUNCTION
LDA #00
STA MSIGX
STA SPRITA+0 ;SET SPRITE 0 SHIP
STA SPRITA+1
LDA #170
STA SP0X
STA SP1X
LDA #250-24-22
STA SP0Y
LDA #250-24
STA SP1Y
LDA #ORANGE
STA SP0COL
LDA #PURPLE
STA SP1COL
LDA #$01
STA SPRITB+0
STA SPRITC+0
LDA #$FF
STA SPRITW+0
;
;----- CLEAR ON HEAD TABLE
LDA #$FF
LDY #$05
RDI070
STA HEADTB,Y
DEY
BPL RDI070
LDA #$00
STA HEADTB+6
LDA #$00 ;FLAGS INITIALIZE
STA FIRE
STA DFIRE
STA THRUST
STA FTIME
STA EN2IDX
STA TIMER2
STA TIMER3
STA KILLSP
STA KIKTIM
STA PACFLG
STA DWNCNT
LDX #$00
RDI090
STA $200,X
STA $300,X
INX
BNE RDI090
JSR CLRCRT ;CLEAR SCREEN
LDX #<GMSCRN ;FLAME DISPLAY
LDY #>GMSCRN
JSR CHROUT
JSR DSPSCR ;DISPLAY SCORE
JSR DSPHSC ;DISPLAY HIGH SCORE
JSR DSPSHP ;DISPLAY SHIP IN FLAME
LDA #%00000011
STA SPENA
LDA ROUND
AND #$03
TAY
LDA SNDADT,Y
STA ATDLY1
LDA SNDSRT,Y
STA SUREL1
LDA #$01 ;BGM SOUND
JSR SOUND
RTS
;
;----- BGM TBL.
SNDADT .BYTE $09,$00,$09,$00
SNDSRT .BYTE $F9,$F9,$F0,$F0
;*--------------------------------------------------*
;* DISPLAY SCORE *
;*--------------------------------------------------*
DSPSCR
LDX #<SCRN1
LDY #>SCRN1
STX WK0
STY WK1
LDX #0
LDY #5
SCO10
LDA SCORE,X
AND #$0F
STA WK2
INC WK2
LDA WK2
STA (WK0),Y
DEY
LDA SCORE,X
LSR A
LSR A
LSR A
LSR A
STA WK2
INC WK2
LDA WK2
STA (WK0),Y
INX
DEY
BPL SCO10
RTS
;*--------------------------------------------------*
;* DISPLAY HI-SCORE *
;*--------------------------------------------------*
DSPHSC
LDX #<SCRN2
LDY #>SCRN2
STX WK0
STY WK1
LDX #0
LDY #5
HSC10
LDA LSCORE,X
AND #$0F
STA WK2
INC WK2
LDA WK2
STA (WK0),Y
DEY
LDA LSCORE,X
LSR A
LSR A
LSR A
LSR A
STA WK2
INC WK2
LDA WK2
STA (WK0),Y
INX
DEY
BPL HSC10
RTS
;*--------------------------------------------------*
;* DISPLAY SHIP IN FLAME *
;*--------------------------------------------------*
DSPSHP
LDX #<SCRN3
LDY #>SCRN3
STX WK0
STY WK1
LDX NUMSHP
BEQ DSHP90
LDY #$00
LDA #$5A
DSHP20
STA (WK0),Y
INY
INY
DEX
BNE DSHP20
DSHP90
RTS
;*--------------------------------------------------*
;* SOMETHING ON-OFF BY TIME *
;*--------------------------------------------------*
;
;----- FLASH FLAME CONTROL
SOMONE
;
;----- CALL BOMB SUBROUTINE
SOM100
JSR BMBSPR
;
;----- WAITE TIMER RENEW
LDA NUMSHP
ORA NUMENM
ORA SPRITA
BMI SOM200
LDA TIMER3
AND #$3F
STA TIMER3
;
;-----
SOM200
RTS
;*--------------------------------------------------*
;* ENEMISE 2 MOVE *
;*--------------------------------------------------*
EN2MOV
DEC EN2WTV ;DISPLAY TIME ?
BEQ *+5 ;YES
JMP E2M090 ;EXIT
LDA EN2WTF
STA EN2WTV ;RESET INTERVAL TIMER
INC EN2IDX ;ENEMY 2 DISPLAY INDEX
LDX EN2IDX
CPX #24
BCC *+4
LDX #00
STX EN2IDX
LDA ENMY2A,X
CMP #$FF
BNE *+5
JMP E2M090 ;NONE EXIST
LDA ENMY2A,X ;GET ENEMISE 2 DIRECTION
AND #$C0 ;RIGHT?
BNE E2M010 ;NO
LDA ENMY2A,X
ORA #$80
STA ENMY2A,X ;CHENGE RIGHT TO LEFT
INC EN2XPL,X ;INC X POINT L
BNE *+4
INC EN2XPH,X ;INC X POINT H
JMP E2M080 ;GO TO DISPLAY
E2M010
LDA ENMY2A,X
AND #$3F
STA ENMY2A,X ;CHENGE LEFT TO RIGHT
DEC EN2XPL,X ;DEC X POINT L
LDA EN2XPL,X
CMP #$FF
BNE *+4
DEC EN2XPH,X ;DEC X POINT H
E2M080
JSR EN2DSP
E2M090
RTS
;*--------------------------------------------------*
;* DISPLAY ENEMY 2 *
;* INPUT X-REG DISPLAY ENEMY INDEX *
;*--------------------------------------------------*
EN2DSP
JSR BITCHR ;GET SCREEN ADDRESS (WK0,WK1)
CLC
LDA WK0
STA WORK+$00 ;ADS-L
ADC #40
STA WORK+$06
LDA WK1
STA WORK+$01 ;ADS-H
ADC #00
STA WORK+$07
LDA ENMY2A,X
AND #$03
TAY
LDA EN2COL,Y
STA WORK+$02 ;COLOR
STA WORK+$08
LDA ENMY2A,X
LSR A
LSR A
AND #03
TAY
LDA EN2PTN,Y
LDY ENMY2A,X
BPL E2D010
CLC
ADC #04
E2D010
TAY
STY WORK+$03
INY
STY WORK+$04
INY
STY WORK+$09
INY
STY WORK+$0A
LDY #$FE
STY WORK+$05
INY
STY WORK+$0B
LDX #<WORK
LDY #>WORK
JSR CHROUT
RTS
EN2COL
.BYTE YELLOW,RED,BLUE,GREEN
EN2PTN
.BYTE $3A,$3A+8,$3A+16,$3A+24
;*--------------------------------------------------*
;* BIT MAP ADDRESS CHANGE TO SCREEN ADDRESS *
;*--------------------------------------------------*
BITCHR
LDA #<SCREEN
STA WK0
LDA #>SCREEN
STA WK1
LDA EN2YP,X ;GET Y POINTER
SEC
SBC #48
AND #$F8 ;CUT OFF < 8
STA WK2
CLC ;POINTER/8*40=POINTER/8*8*5
ADC WK0
STA WK0
LDA WK1
ADC #00
STA WK1
LDA #00
ASL WK2
ROL A
ASL WK2
ROL A
CLC
ADC WK1
STA WK1
CLC
LDA WK2
ADC WK0
STA WK0
LDA WK1
ADC #00
STA WK1 ;(WK0,WK1)=(WK0,WK1)+(YPOINT-48)/8*40
LDA EN2XPH,X ;X POINT HIGH
LSR A ;CARRY = X POINT HIGH
LDA EN2XPL,X ;X POINT LOW
ROR A
LSR A
LSR A ;/8
SEC
SBC #03
CLC
ADC WK0
STA WK0
LDA WK1
ADC #00
STA WK1 ;(WK0,WK1)=(WK0,WK1)+(XPOINT-24)/8
RTS
.END