-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathKEEPATT.ASM
450 lines (445 loc) · 8.55 KB
/
KEEPATT.ASM
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
;THIS STUFF WAS TAKEN OUT OF ATTRACT.ASM
;
;HSTDTAB:
; JSRP WNDWON
; CALLA KILBGND ;KILL OLD BACKGROUND IF ANY EXISTED
; MOVI CLSNEUT|TYPTEXT|SUBWNDW,A0
; CLR A1
; NOT A1
; CALLA KILOBJ
;
; MOVI CHAMPS,A0
; MOVE A0,@BAKMODS,L
; CALLA BGND_UD1
;; MOVI CHAMPS,A0
; MOVE A0,@BAKMODS,L
; CALLA BGND_UD1
; MOVI CHAMPS,A0
; MOVE A0,@BAKMODS,L
; CALLA BGND_UD1
; MOVI HSC,A0
; CALLA BLAKOUT
; MOVI NUARENAP,A0
; CALLA BLAKOUT
;
; MOVI SCRNEND,A0 ;[256,405],A0
; MOVE A0,@SCRNLR,L
;
; MOVI PAL4TAB,A0
; MOVK 2,A1 ;FADE TITLE SCREEN IN FROM BLACK
; CALLA FADEIN
;
; SLEEP 20
;
; MOVI HSC,A8 ;PAL NAME
; MOVI PAL1,A9 ;RAM AREA
; MOVI [50,55],A10 ;BEGIN/END COLOR #
; MOVK 5,A11 ;RATE IN TICKS
; CREATE CYCPID,COLCYC ;COLOR CYCLER ON
;
; MOVI HSC,A8 ;PAL NAME
; MOVI PAL2,A9 ;FIRST COLOR TO CYCLE
; MOVI [55,58],A10 ;LAST COLOR TO CYCLE
; MOVK 9,A11 ;RATE
; CREATE CYCPID,COLCYC
;
;;DISPLAY SCORES HERE!
;
; CALLA COLRPRC
; CLR A0
; MOVE A0,@GAMERASE,W
; SLEEP 2
; CALLA GETHIGH
;
; SLEEP 5*60
; MOVE @KEEPON,A0
; JRZ TY6
; SLEEP 14*60
; CLR A0
; MOVB A0,@CANT
; MOVE A0,@KEEPON
; MOVK 3,A11 ;FADE RATE
; CREATE 0,FADE_DOWN
; SLEEP 40
; SOUND1 MUSICOFF
; MOVK 3,A11 ;FADE RATE
; CREATE 0,FADE_UP
;
;
;TY6 MOVK 1,A0
; MOVE A0,@GAMERASE,W
;
; MOVI CYCPID,A0
; CLR A1
; NOT A1
; CALLA KILALL
;
; MOVI PAL4TAB,A0
; MOVK 2,A1 ;FADE TITLE SCREEN OUT TO BLACK
; CALLA FADEOUT
;
; SLEEP 30
; CALLA CLR_SCRN
; RETP
;
;OFFERT:
; JSRP WNDWON
; CALLA KILBGND ;KILL OLD BACKGROUND IF ANY EXISTED
;
; MOVI OFFER,A0
; MOVE A0,@BAKMODS,L
; CALLA BGND_UD1
;
; MOVI CLSNEUT|TYPTEXT|SUBWNDW,A0
; CLR A1
; NOT A1
; CALLA KILOBJ
;
; MOVI HSC,A0
; CALLA BLAKOUT
; MOVI DUXPAL,A0
; CALLA BLAKOUT
; MOVI smlg,A0
; CALLA BLAKOUT
;
; MOVI SCRNEND,A0 ;[256,405],A0
; MOVE A0,@SCRNLR,L
;
; MOVI PAL5TAB,A0
; MOVK 2,A1 ;FADE TITLE SCREEN IN FROM BLACK
; CALLA FADEIN
;
; MOVI DUXPAL,A8 ;PAL NAME
; MOVI PAL1,A9 ;RAM AREA
; MOVI [1,6],A10 ;BEGIN/END COLOR #
; MOVK 8,A11 ;RATE IN TICKS
; CREATE CYCPID,COLCYC ;COLOR CYCLER ON
;
; SLEEP 8*60
;
; MOVI CYCPID,A0
; CLR A1
; NOT A1
; CALLA KILALL
;
; MOVI PAL5TAB,A0
; MOVK 2,A1 ;FADE TITLE SCREEN OUT TO BLACK
; CALLA FADEOUT
;
; SLEEP 35
; CALLA CLR_SCRN
; MOVB @CANT,A0
; JREQ ACJAZ
;ADPAZ SLEEP 1
; JRUC ADPAZ
;ACJAZ RETP
;PRINTIT:
; JSRP SNKNOW
; CLR A0
; MOVI 03E3EH,A6 ;COLOR
; JSRP STRCNRMO ;PRINT OUT SHIT
; JSRP EXPSCRN
; SLEEP 60*5 ;5 SECONDS
; MOVI CLSNEUT|TYPTEXT|SUBTXT,A0
; CLR A1
; NOT A1
; CALLA KILOBJ
RETP
;
;SY .LONG SY1,S2,S2,S3,S4,S2,S5,S6,S2,S8,S9,S10,S11,S2,S13,S14,S15,S16,S17
; .LONG S2,S2,S20,S21,S22,S23,S2,S24,S2,S24A,S2,S25,0
;SY2 .LONG FSY1,S2,FS3,FS4,S2,FS5,S2,FS5A,S2,FS6,FS8,S2,FS9,FS10,FS11,FS13,FS14,FS15,FS15A,FS16,FS17
; .LONG S2,FS21,FS22,S2,FS23,S2,FS24,S2,S25
; .LONG S2,S2,NM1,NM2,NM3,NM4,NM5,NM5A,NM6,NM7,NM7A,NM8,NM9,NM10,NM11
; .LONG NM12,NM12A,NM12B,NM12C,NM12E,NM12D,NM12F,NM12G,S2,S2,S2,NM13,S2,NM14,0
;
;SY1
; .STRING "The year is 1999"
; .BYTE 0
; .EVEN
;S2 .STRING " "
; .BYTE 0
; .EVEN
;;
;; ATTPLAY - ATTRACT MODE GAME PLAY
;; NOTE: CALL WITH JSRP
;;
;NATTWAVS .SET 3 ;# OF ATTRACT MODE WAVES
;
;ATTPLAY:
; MOVK 1,A0
; MOVE A0,@SOUNDSUP,W ;TURN ALL SOUNDS OFF
; MOVE @AWAVE,A0,W
; INC A0
; CMPI 2,A0
; JRNE NOMUT
; MOVE A0,@AWAVE
; MOVI 10,A0
; JRUC MUT0
;NOMUT CMPI NATTWAVS,A0
; JRLS ATTWGO
;ATTWRST:
; MOVK 1,A0 ;RESET TO WAVE 1
;ATTWGO:
; MOVE A0,@AWAVE,W
;MUT0
; MOVE A0,@WAVE,W
; MOVK 1,A0
; MOVE A0,@PLAYPAGE,W ;MARK IT AS THE PLAY PAGE
;; MOVI DLSTZ,A1
;; CALLA UNGET
;; MOVI DLST,A1
;; CALLA UNGET
; CALLA CLNPAL
; JSRP AMODWAVE ;START WAVE #1-3
; MOVI P1DATA,A11 ;MARK PLAYER 1 FOR DEMO
;; MOVE @AWAVE,A9,W
;; DEC A9
;; SLL 5,A9
;; ADDI AMOVETAB,A9 ;SCRIPTED PLAYER MOVEMENT
; ;BASED ON WAVE WE ARE ON
;; MOVE *A9,A9,L ;GET THIS WAVES MOVEMENT TABLE
; MOVI AWAV1MOV,A9
;ATTNEXT:
; MOVE *A9+,A0,W ;GET SOME JOYSTICK BITS
; CMPI 0FFFFFFFFH,A0
; JREQ ATTWXXX
; MOVE A0,@P1CTRL,W
; MOVE *A9+,A10,W
; JSRP ATTSLP ;PROCESS SLEEP TIME
; JRUC ATTNEXT
;ATTWXXX:
; CLR A1
; NOT A1
; MOVI PCPID,A0
; CALLA KILALL
;
; JSRP WNDWON
;
; MOVI ICONPID,A0
; CLR A1
; NOT A1
; CALLA KILALL
;
; CALLA CLR_ALL
;
;;GLITCH HERE?
; SLEEP 2
;
;
; CLR A0
; MOVE A0,@SOUNDSUP,W ;TURN ALL SOUNDS ON
; CALLA DELWNDW
; RETP
;;
;; SCRIPTPLAY - PLAYER MOVEMENT FOR IN/OUT OF WAVES
;; PARMS
;; SCRIPT NUMBER IN FROMDR
;; SENT WITH EITHER P1CTRL OR P2CTRL IN A8
;;IF A9=1 THEN PLY1 START, 2=PLYR2 START 0=REG MOVEMENT PLAYER TABLE
;SCRIPTPLAY:
; MOVE A9,A9
; JREQ REG
;;PLAYERS ABOUT TO BEGIN A GAME
; CMPI 1,A9
; JRNE SX
; MOVB @KP_LS,A0
; CMPI 0FFFFFFFFH,A0
; JREQ ZA
; MOVI 1,A0
; MOVI 10,A1
; CALLA SET_GATE_2
;;TURN ON RINGS AROUND THIS PLAYER
;;MAKE SURE IMAGE IS STARTED BEFORE THIS
;ZA
; CALLR C_SHO2
;; MOVI 1,A9
;;ALREADY A 9!
; MOVI 190,A10 ;TIME RINGS ARE ON
; CREATE RNGPID,RINGS
; MOVI LDRS,A9
; MOVB @BOSSON,A0
; JRZ NEXTMOV
; MOVI LDRS2,A9
; JRUC NEXTMOV
;SX
; MOVB @KP_RS,A0
; CMPI 0FFFFFFFFH,A0
; JREQ ZA1
; MOVI 2,A0
; MOVI 10,A1
; CALLA SET_GATE_2
;ZA1
; CALLR C_SHO1
;; MOVI 2,A9
;;ALREADY A9=2
; MOVI 190,A10 ;TIME RINGS ARE ON
; CREATE RNGPID,RINGS
; MOVI RDRS,A9
; MOVB @BOSSON,A0
; JRZ NEXTMOV
; MOVI RDRS2,A9
; JRUC NEXTMOV
;C_SHO1 CLR A0
; MOVE @PLYRPRCS+32,A1,L
; JRZ RETOUT
; MOVE *A1,A1,L
; MOVE *A1(LEG_PRC),A1,L
; MOVE A0,*A1(SHOECNT)
; RETS
;C_SHO2
; CLR A0
; MOVE @PLYRPRCS,A1,L
; JRZ RETOUT
; MOVE *A1,A1,L
; MOVE *A1(LEG_PRC),A1,L
; MOVE A0,*A1(SHOECNT)
;RETOUT RETS
;REG
; CALLR C_SHO1
; CALLR C_SHO2
; MOVE @FROMDR,A0,W
; JRNZ REG3
;;TV SET RUN IN
; CMPI P1CTRL,A8
; JRZ REG4
; MOVI TVMOV2,A9
; JRUC NEXTMOV
;REG4 MOVI TVMOV,A9
; JRUC NEXTMOV
;REG3 SLL 5,A0
; ADDI GMOVTAB,A0 ;SCRIPTED PLAYER MOVEMENT
; MOVE @CIRCUIT,A9
; CMPI 2,A9
; JRNZ REGCONT
; MOVE @WAVE,A9
; CMPI 7,A9
; JRNZ REGCONT
; MOVI SNAKELST,A9
; JRUC NEXTMOV
;REGCONT MOVE *A0,A9,L ;GET MOVEMENT TABLE DATA
;NEXTMOV:
; MOVE @HALT,A0
; JRZ NXM
; SLEEP 1
; JRUC NEXTMOV
;NXM
; MOVE *A9+,A0,W ;GET SOME JOYSTICK BITS
; CMPI 0FFFFFFFFH,A0
; JREQ MOVEXIT
; MOVE A0,*A8,W ;P1/P2CTRL
; MOVE *A9+,A10,W
; JSRP ATTSLP ;PROCESS SLEEP TIME
; JRUC NEXTMOV
;MOVEXIT:
; DIE
;;
;; ATTSLP - PROCESS ATTRACT MODE PLAYER SLEEP
;; A10 = # TICKS TO SLEEP
;; RETURNS:
;; CARRY CLEAR = SLEEP COMPLETED
;; CARRY SET = STILL SNOZZIN'
;;
;; NOTE: CALL WITH JSRP
;;
;ATTSLP:
; PUSHP A10
;ATTSLPL:
; SLEEP 1
; SETC
; DSJS A10,ATTSLPL ;PROCESS SLEEP LOOP
; CLRC
; PULLP A10
; RETP
;;
;; AMODWAVE - INITIALIZE AN ATTRACT MODE WAVE:
;; CURRENT ATTRACT WAVE MUST BE INDICATED IN VARIABLE, AWAVE.
;; NOTE: CALL AS JSRP!
;;
;AMODWAVE:
; CALLA INIT_DEMO
; RETP
;
;AMOVETAB:
; .LONG AWAV1MOV,AWAV2MOV,AWAV3MOV,AWAV4MOV,AWAV5MOV,AWAV6MOV
;GMOVTAB:
; .LONG TVMOV,LFTDOOR,RGTDOOR,TOPDOOR,BOTDOOR
;
;ATTRACT MODE PLAYER MOVEMENT TABLES
; .WORD STICK_BITS,SLEEP_TIME
; .
; .
; .WORD 0FFFFH
;
;AWAV1MOV:
;PLACE SCRIPT FOR WAVE 2 HERE!
; .WORD 0,60*4
; .WORD PFRYTE|PUP,20H
; .WORD PFRYTE|PDOWN,40H
; .WORD PFRYTE,20H
; .WORD 0,5H
; .WORD PFRYTE,20H
; .WORD PLEFT,20H
; .WORD PFRYTE|PUP,50H
; .WORD PFRYTE|PDOWN,20H
; .WORD PFRYTE|PUP,20H
; .WORD PFRYTE|PDOWN,40H
; .WORD PUP,26H
; .WORD 0,20H
; .WORD PRYTE,25H
; .WORD PUP,10H
; .WORD PRYTE|PFDOWN,55H
; .WORD PFUP|PDOWN,20H
; .WORD PFRYTE|PLEFT,20H
; .WORD PFRYTE|PUP,20H
; .WORD PFRYTE|PDOWN,30H
; .WORD PFRYTE,20H
; .WORD PLEFT,20H
; .WORD PFDOWN|PRYTE,15H
; .WORD PUP,26H
; .WORD PRYTE|PFDOWN,22H
; .WORD PFUP|PDOWN,20H
;; .WORD 0FFFFH
;
; .WORD PFRYTE|PLEFT,30H
; .WORD PFRYTE|PUP,20H
; .WORD PFRYTE|PDOWN,35H
; .WORD PFLEFT|PUP,20H
; .WORD PFLEFT|PDOWN,35H
; .WORD PFRYTE|PDOWN,30H
; .WORD PFRYTE,20H
; .WORD PRYTE|PUP|PFDOWN,30H
; .WORD PLEFT,20H
; .WORD PFDOWN|PRYTE,15H
; .WORD PUP,26H
; .WORD PRYTE|PFDOWN,22H
; .WORD PFUP|PDOWN,20H
; .WORD PFRYTE|PLEFT,30H
; .WORD PFRYTE|PUP,20H
; .WORD PFRYTE|PDOWN,35H
; .WORD PFLEFT|PUP,20H
; .WORD PFLEFT|PDOWN,35H
; .WORD 0FFFFH
;
;SNAKELST
;;EXIT FROM RIGHT DOOR WITH SNAKES
; .WORD PRYTE,06FH
; .WORD PDOWN|PRYTE,2H
; .WORD PDOWN,30H
; .WORD PDOWN|PRYTE,2H
; .WORD PRYTE,0FAH
; .WORD 0,1H
; .WORD 0FFFFH
;
;TVMOV:
;;TELEVISION INTRO SCREEN PLAYER MOVEMENT/ANIMATION SCRIPT
; .WORD PUP,2
; .WORD PUP|PRYTE,3H
; .WORD PRYTE,044H
; .WORD PDOWN|PRYTE,2H
; .WORD PDOWN,30H
; .WORD PDOWN|PRYTE,2H
; .WORD PRYTE,014AH
; .WORD 0,1H
; .WORD 0FFFFH