-
Notifications
You must be signed in to change notification settings - Fork 4
/
ATT.SRC
executable file
·541 lines (540 loc) · 10.3 KB
/
ATT.SRC
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
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
*
* LINE DRAWING SUBROUTINE
* Kenneth F. Lantz c@ March 1982 William Electronics
*
NLIST
INCLUDE RAMDEF.SRC
INCLUDE EQU.SRC
INCLUDE MESSEQU.SRC
LIST
*
* COLOR PROCESSES WORK SPACE
*
ORG PRAM
PCOUNT RMB 2 COUNTER TILL ALL OF NEW COLOR RAM IS DUMPED
PDUMP RMB 1 COUNTER FOR HOW MANY BYTES ARE LEFT TO YSAVE
PCOLOR RMB 2 POINTER TO CURRENT COLOR PALET
PYSAVE RMB 2 POINTER FOR NEXT COLOR BYTE TO DUMP
*
ORG $BC00 in scratch memory
XLOC FDB 0 range 0-304 !these four parameters set upon
YLOC FDB 0 range 0-240 !entry, XLOC & YLOC are destroyed
ENDPTX FDB 0 ditto !
ENDPTY FDB 0 ditto !
CCOLOR FCB $11 set desired line color (left/right pixel respective)
FCB $11
FILDWN FCB 0 none zero value here causes pixels to be filled in
* in a downward direction until same color incountered
HCOUNT FCB 0
COUNT FDB 0
START FDB $5050
ERRCNT FDB 0
ABSDX FDB 0
ABSDY FDB 0
QUAD FDB 0
TAIL FDB $A0A0
SAVE FDB 0
RLMASK EQU $40
TEMPM FDB 0
CONTRL EQU $C900
OFFSET FDB $0000
FILL EQU $80
NOFILL EQU 0
CL1 EQU $11
CL2 EQU $22
CL3 EQU $33
CL4 EQU $44
XPOS EQU 4 OFFSET FROM ORGINAL START POSITION
***********************************
ORG $D000 in high memory due to screen access
MARQUE PKILL $00,$08 KILL H.S.T.D. PROCESSES
LDX VNULL CHEAPIE BLANK THE SCREEN
JSR VDCOLOR
PCNAP 2
JSR SCCLR CLEAR SCREEN
LDX #MARCOL MARQUE COLORS
JSR VDCOLOR
JSR OPWRT WRITE THE OPERATORS MESSAGE
LDD #MSCOPY*256+$55 WILLIAMS COPYRIGHT MESSAGE
LDX #$1CBD
JSR OUTPHR
LDY #$1211 BACKGROUND FILL OF COLOR NIBBLE 11
JSR VDCRE2 DISPLAY CREDITS
LDX #REPLAY
JSR RCMSA
TSTA ANY EXTRA MEN ALLOWED?
BEQ 20$ BR=NO, SO SKIP THIS MESSAGE
LDD #MSW17*256+$33 EXTRA MAN AT XX,000 POINTS
LDX #$1FAB
JSR OUTPHR
LDB #$CC
PSHS X
LDX #REPLAY GET REPLAY LEVEL
JSR RCMSA
PULS X
BITA #$F0
BNE 10$
ORA #$F0
10$ JSR OUTBCD DISPLAY THOUSANDS OF REPLAY POINTS
LDA #MSW18
JSR OUTPHR
20$ PCNAP 1 DELAYS, DELAYS, WHEN DO WE SHIP IT!
SECCR STRIP,$11 STRIPE GENERATOR
SECCR FLASH,$10 COLOR RAM FLASH
*
GO LDU #LIST
CLR OFFSET
LDA ,U+
STA OFFSET+1
TOP LDA ,U+
STA FILDWN
LDD ,U++
STD CCOLOR
DEMO CLRA
LDB ,U+
ADDD OFFSET done this way to avoid the carry on an 8bit to 16bit +
STD XLOC
CLRA
LDB ,U+
STD YLOC
CLRA
LDB ,U
BEQ 1$
ADDD OFFSET
STD ENDPTX
CLRA
LDB 1,U
STD ENDPTY
JSR LINE
BRA DEMO
*
1$ LEAU 1,U
LDB ,U+ a double zero ends a character
BEQ 2$
BRA TOP
2$ LDA ,U+
BEQ 9$ another zero ends it all
STA OFFSET+1
BRA TOP
*
9$ LDU PEXEC
LDA #111 111 * 10 = 1,110 = 18.5 SEC
STA PRAM,U
20$ PCNAP 10
DEC PRAM,U
BNE 20$
PKILL $00,$40 KILL ALL NON-ATTRACT MODE PROCESSES
LDY #RAMCOL+1
LDD #$FFFF
STD ,Y++
LDD #0
STD ,Y++
STD ,Y++
STD ,Y++
STD ,Y++
STD ,Y++
STD ,Y++
STA ,Y
JMP VSIM INSTRUCTIONAL PAGE (GAME SIMULATION)
*
* COLOR RAM FLASH GENERATOR
*
FLASH LDD #-1 INITILA COLOR CHANGE AFTER STRIPE ROUTINE
STD PCOUNT,U
LDD #MARCOL+8
STD PCOLOR,U
10$ PCNAP 2
LDX RAMCOL+15
LDD PCOUNT,U
BPL 11$
LDY PLINK,U
LDA PID,Y
CMPA #$11 STRIPE I.D.?
BEQ 20$
LDD #16 INITIAL DELAY
11$ BEQ 17$
ADDD #-1
STD PCOUNT,U
BNE 20$
LDY PCOLOR,U
LEAY 8,Y
CMPY #MAREND
BLO 15$
LDY #MARCOL+8
15$ STY PCOLOR,U
STY PYSAVE,U
LDA #8
STA PDUMP,U
17$ LDY PYSAVE,U IN MIDDLE OF RE-DUMPPING NEW COLOR
LDX ,Y+
STY PYSAVE,U
DEC PDUMP,U
BNE 20$
LDD #((((2*60+30)/16)+1)*8)+7 CHANGE COLORS EVERY 2 1/2 SECONDS
STD PCOUNT,U
20$ LDD RAMCOL+13
STD RAMCOL+14
LDD RAMCOL+11
STD RAMCOL+12
LDD RAMCOL+9
STD RAMCOL+10
TFR X,D
LDB RAMCOL+8
STD RAMCOL+8
BRA 10$
*
* STRIPE GENERATOR
*
XLENS EQU 16
YLENS EQU 16
STRIP CLR PRAM+8,U
LDX #$10-1
LDY #$10
LDA #8
10$ LEAX 1,X
BSR WRPIXH
CMPX #$8F*2+XLENS
BLO 10$
LEAX -XLENS,X
LEAY YLENS-1,Y
20$ LEAY 1,Y
BSR WRPIXV
CMPY #$F2
BLO 20$
LEAY -YLENS,Y
30$ LEAX -1,X
BSR WRPIXH
CMPX #$0033*2
BNE 35$
35$ CMPX #$0
BHI 30$
40$ LEAY -1,Y
BSR WRPIXV
CMPY #$10
BHI 40$
JMP VSUCIDE
*
WRPIXH INCA
ANDA #$0F
ORA #$08
STX PRAM,U
STY PRAM+2,U
STD PRAM+4,U
LDB #YLENS
10$ BSR WRANIB
LEAY 1,Y
INCA
ANDA #$0F
ORA #$08
DECB
BNE 10$
BRA WRPRTS
*
WRPIXV INCA
ANDA #$0F
ORA #$08
STX PRAM,U
STY PRAM+2,U
STD PRAM+4,U
LDB #XLENS
10$ BSR WRANIB
LEAX 1,X
INCA
ANDA #$0F
ORA #$08
DECB
BNE 10$
WRPRTS LDD ,S++
STD PRAM+6,U
DEC PRAM+8,U
BGT 10$
LDA #3
STA PRAM+8,U
PCNAP 1
10$ LDD PRAM+4,U
LDY PRAM+2,U
LDX PRAM+0,U
JMP [PRAM+6,U]
*
WRANIB PSHS D,X,Y
LDA #$0 READ SCREEN
STA DRRUC
STA RRUC
TFR X,D
LSRA
RORB
TFR B,A
LDB 5,S
TFR D,X
LDA #$0F
LDB ,S
BCS 10$
ASLB
ASLB
ASLB
ASLB
LDA #$F0
10$ ANDA ,X
BNE 20$
ORB ,X
STB ,X
20$ LDA #$01 READ ROM!
STA DRRUC
STA RRUC
PULS D,X,Y,PC
*
* INITIAL COLORS FOR THE MARQUE PAGE
*
MARCOL FCB $00,$00,$07,$3F,$05,@377,$E8,@350
FCB @000,@001,@003,@005,@007,@005,@003,@001
FCB @000,@010,@030,@050,@070,@050,@030,@010
FCB @000,@000,@100,@200,@300,@200,@100,@000
FCB @000,@011,@033,@055,@077,@055,@033,@011
FCB @000,@011,@122,@244,@377,@244,@122,@011
MAREND EQU *
*
*********************************************
*
FILLDN PSHS X This routine is entered with the current
LEAX 1,X location in X and color in A
1$ LDD SAVE
ANDA CCOLOR+1
PSHS A
LDA SAVE
ANDA ,X
BNE 2$
ANDB ,X
ORB ,S+
STB ,X
EXG D,X
INCB
EXG X,D
BNE 1$
PSHS A
2$ PULS A,X,PC
*************************
* pixel movers one pixel subroutines
*************************
LFTRT LDA #RLMASK
BITA QUAD
BNE 1$ go right
LDD XLOC
SUBD #1
BRA 2$
1$ LDD XLOC
ADDD #1
2$ STD XLOC
RTS
UPDN TST QUAD
BMI 1$ go down
LDD YLOC
SUBD #1
BRA 2$
1$ LDD YLOC
ADDD #1
2$ STD YLOC
RTS
******************************************
* line drawing subroutine
***********************first calculate the quadrant and total distance
LINE CLR QUAD
LDD XLOC
SUBD ENDPTX
ROR QUAD
BPL 1$
COMA
COMB
ADDD #1
1$ STD ABSDX
STD ERRCNT
LDD YLOC
SUBD ENDPTY
ROR QUAD bit7 set=down bit6 set=right
BMI 2$
COMA
COMB
ADDD #1
2$ SUBD #1
STD ABSDY
CLR HCOUNT
COMA
COMB
CLRA
ADDD ABSDX
BCC 3$
INC HCOUNT
3$ STD COUNT
BRA STP1
* drawing loop follows *
MOVX JSR LFTRT
STP1 LDD ERRCNT
ADDD ABSDY
COUNTS STD ERRCNT
PSHS CC
CLR DRRUC THIS 1ST, BECAUSE INTERUPTS CAN CHANGE THIS
CLR CONTRL
LDD XLOC
ASRA
RORB
TFR B,A
LDB YLOC+1
TFR D,X
LDB #$F0
BCC 3$
COMB
3$ TFR B,A
COMB
STD SAVE
ANDA CCOLOR
ANDB ,X
PSHS B
TFR A,B
ORB ,S+
CMPX #$9800
BHS RNGERR
STB ,X
TST FILDWN
BPL 6$
JSR FILLDN
6$ LDA #1
STA DRRUC THIS 1ST, BECAUSE INTERUPTS CAN CHANGE THIS
STA CONTRL
LDD COUNT
SUBD #1
BNE 1$
TST HCOUNT
BEQ DONE
DEC HCOUNT
1$ STD COUNT
PULS CC
BCS MOVX
MOVY JSR UPDN
LDD ERRCNT
ADDD ABSDX
BRA COUNTS
*
RNGERR LEAS 2,S pop one level and clean up the stack
DONE PULS CC,PC
*
**************************************************************************
*
***********************************************************
* O -OH- **************************************************
LIST FCB $40+XPOS
FCB NOFILL,CL1,CL1
FCB 2,80,3,100,8,116,12,122,20,127,30,127,38,122,42,117
FCB 48,100,48,80,0,1
FCB NOFILL,CL2,CL2
FCB 28,92,28,85,30,80,32,75,0,1
*
FCB NOFILL,CL1,CL1
FCB 32,75,35,86,35,94,0,1
*
FCB FILL,CL1,CL3
FCB 14,86,14,95,17,104,22,112,27,112,33,104,36,94,0,1
*
FCB FILL,CL2,CL4,28,92,29,98,33,104,0,1
*
FCB FILL,CL1,CL4
FCB 14,95,14,86,17,76,21,68,23,66,26,66,28,68,32,74,0,1
*
FCB FILL,CL1,CL3
FCB 3,100,2,80,8,66,14,58,22,54,30,54,37,58
FCB 44,66,48,80,0,1
FCB FILL,CL2,CL4,32,53,43,58,0,0
***** -J- *************************
FCB 1+XPOS,NOFILL,CL1,CL1,9,109,12,110,22,122,32,127,41,126,47,123,5
2,121,0,1
FCB NOFILL,CL2,CL2,46,124,70,117,0,1
*
FCB FILL,CL1,CL4
FCB 69,116,65,100,64,80,0,1
*
FCB FILL,CL1,CL4
FCB 52,121,58,112,58,80,60,72,65,59,0,1
FCB FILL,CL2,CL4,65,59,71,65,0,1
*
FCB NOFILL,CL2,CL2
FCB 30,76,44,76,0,1
*
FCB FILL,CL1,CL4
FCB 30,75,44,70,0,1
*
FCB FILL,CL1,CL3
FCB 30,75,30,70,65,59,0,1
*
FCB FILL,CL1,CL3
FCB 44,70,44,104,42,108,36,111,31,110
FCB 27,106,24,100,23,95,22,93,21,95,9,109,0,1
*
FCB FILL,CL2,CL4
FCB 22,93,36,91,38,92,40,99,44,100,0,0
******************************************************
* U -YOU- ****************************************
FCB $6A+XPOS,NOFILL,CL2,CL3,1,118,13,107,0,1
FCB FILL,CL1,CL4,1,117,7,100,0,1
FCB NOFILL,CL1,CL4,10,88,10,98,12,106,0,1
FCB NOFILL,CL1,CL4,13,107,19,117,26,124,34,126,44,126
FCB 51,124,54,122,0,1
FCB NOFILL,CL2,CL3,54,122,56,127,0,1
FCB NOFILL,CL1,CL3,57,118,56,128,63,126,68,126,76,128,0,1
FCB FILL,CL1,CL4,53,121,57,118,0,1
FCB FILL,CL1,CL3,74,126,71,114,70,84,0,1
FCB FILL,CL1,CL3,26,80,26,88,28,96,31,102,36,105,42,106,48,104
FCB 53,100,56,90,57,77,58,66,0,1
FCB NOFILL,CL1,CL1,8,52,12,62,0,1,NOFILL,CL2,CL2,12,63,20,62,0,1
FCB NOFILL,CL1,CL1,78,50,72,64,70,84,0,1
FCB FILL,CL2,CL4,39,44,42,88,44,92,46,88,46,60,54,44,0,1
FCB FILL,CL1,CL4,54,44,56,54,57,66,57,77,0,1
FCB FILL,CL1,CL3,54,44,60,45,78,49,0,1
FCB FILL,CL1,CL4,26,80,28,70,34,54,39,44,0,1
FCB FILL,CL1,CL3,10,88,12,79,16,68,20,62,31,48,0,1
FCB FILL,CL1,CL4,13,62,20,54,31,48,0,1
FCB FILL,CL1,CL3,9,51,17,47,26,45,39,43,0,1
FCB FILL,CL2,CL4,0,58,16,68
FCB 0,0
* -S- CEA *
FCB 166+XPOS,NOFILL,CL1,CL3,56,118,48,124,40,127,25,123,18,122,0,1
FCB NOFILL,CL2,CL4,18,122,12,114,0,1
FCB FILL,CL1,CL3,19,121,20,113,20,102,0,1
FCB FILL,CL1,CL4,20,102,18,90,0,1
FCB FILL,CL2,CL4,12,85,19,90,0,1
FCB FILL,CL1,CL3,18,90,34,106,41,108,44,104,44,99,0,1
FCB FILL,CL1,CL4,43,98,40,94,20,82,16,78,15,70,0,1
FCB NOFILL,CL2,CL4,56,118,68,123,0,1 *
FCB FILL,CL1,CL4,55,118,59,109,0,1
FCB FILL,CL1,CL3,58,108,56,99,50,88,32,76,30,70,0,1
FCB NOFILL,CL2,CL4,36,78,56,82,0,1
FCB FILL,CL1,CL4,55,81,48,72,37,66,32,66,30,70,0,1
FCB FILL,CL1,CL3,55,81,55,63,44,57,36,54,28,53,23,56,16,64,16,78,0,1
FCB FILL,CL2,CL4,13,63,21,58
FCB 0,0
* -T- TEA *
FCB 218+XPOS,NOFILL,CL1,CL3,15,122,21,126,32,127,52,125,60,102,0,1
FCB NOFILL,CL1,CL3,30,96,40,78,0,1
FCB NOFILL,CL1,CL3,48,68,65,55,0,1
FCB NOFILL,CL2,CL4,40,78,60,76,0,1
FCB NOFILL,CL1,CL3,60,76,64,72,0,1
FCB FILL,CL1,CL4,41,77,45,75,60,75,0,1
FCB FILL,CL1,CL4,15,121,10,111,0,1
FCB FILL,CL1,CL3,11,110,11,104,14,96,21,81,32,72,0,1
FCB FILL,CL1,CL3,59,103,52,112,40,116,32,112,30,106,30,96,0,1
FCB FILL,CL2,CL4,59,102,47,99,42,102,36,106,30,106,0,1
FCB FILL,CL2,CL4,1,90,11,79,0,1
FCB FILL,CL1,CL4,11,79,26,74,31,73,0,1
FCB NOFILL,CL2,CL4,4,80,7,81,0,1
FCB FILL,CL2,CL4,4,65,9,62,0,1
FCB FILL,CL1,CL3,9,80,9,62,26,64,37,66,50,58,64,55,0,1
FCB FILL,CL1,CL3,48,68,63,72
FCB 0,0
FCB 0,0
*
* AND THE EVER POPULAR COPYRIGHT MESSAGE
*
FCC 'JOUST (C)1982 WILLIAMS ELECTRONICS INC.'
*
LENGTH EQU * $D000 TO HERE
IFGT *-$D7FF
FCB $1111 OVERFLOWED $D000,$D7FF AREA
ENDIF
END SYSV