-
Notifications
You must be signed in to change notification settings - Fork 3
/
MENUS.TXT
executable file
·610 lines (572 loc) · 6.86 KB
/
MENUS.TXT
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
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
* Menus
*
* Menu routines and associated data
*
* Programmed by Rick Adams
*
* (c) copyright 1987 Activision
*
* Title page menu
*
TPMENU
FCB 1,10
FDB Z@-*
FDB MZAP-*
RGBSEL
FCB 20,1 column, row
FDB A@-*
FDB MRGB-*
CMPSEL
FCB 27,1
FDB B@-*
FDB MCMP-*
FCB $FF
A@
FCC "@ RGB",0
B@
FCC "@ Composite",0
Z@
FCC " ",0
* Main menu
*
MNMENU
FCB 12,8 column, row
FDB A@-*
FDB MM1-*
FCB 12,10
FDB B@-*
FDB MAIN2-*
FCB 12,12
FDB C@-*
FDB MM3-*
FCB 12,14
FDB D@-*
FDB MM4-*
FCB 12,16
FDB E@-*
FDB MM5-*
FCB 12,18
FDB F@-*
FDB MAIN6-*
FCB $FF
A@
FCC "Play Solitaire",0
B@
FCC "Begin Again",0
C@
FCC "Select a Dragon",0
D@
FCC "Tournament Play",0
E@
FCC "Challenge Match",0
F@
FCC "Return to Game",0
* Game screen menu
*
GMMENU
FCB 4,0 column, row
FDB QMENU-* "Menu"
FDB GM1-*
FCB 10,0
FDB QUNDO-* "Undo"
FDB GM2-*
FCB 16,0
FDB QFIND-* "Find"
FDB GM3-*
FCB 22,0
FDB QCANCE-* "Cancel"
FDB GM4-*
FCB 30,0
FDB QPEEK-* "Peek"
FDB GM5-*
FCB $FF
QMENU
FCC "Menu",0
QUNDO
FCC "Undo",0
QFIND
FCC "Find",0
QCANCE
FCC "Cancel",0
QPEEK
FCC "Peek",0
* Dragon menu
*
DGMENU
FCB 12,5 pairs to kong
FDB A@-*
FDB DM1-*
FCB 12,7 fours galore
FDB B@-*
FDB DM2-*
FCB 12,9 four winds
FDB C@-*
FDB DM3-*
FCB 12,11 bam bam
FDB D@-*
FDB DM4-*
FCB 12,13 crak king
FDB E@-*
FDB DM5-*
FCB 12,15 dots across
FDB F@-*
FDB DM6-*
FCB 12,17 dragon rider
FDB G@-*
FDB DM7-*
FCB 12,19 dragon's song
FDB H@-*
FDB DM8-*
FCB 12,21 return to menu
FDB QRETUR-*
FDB DM9-*
FCB $FF
A@
FCC "Pairs to Kong",0
B@
FCC "Fours Galore",0
C@
FCC "Four Winds",0
D@
FCC "Bam Bam",0
E@
FCC "Crak King",0
F@
FCC "Dots Across",0
G@
FCC "Dragon Rider",0
H@
FCC "Dragon's Song",0
QRETUR
FCC "Return to Menu",0
* Peek menu
*
PKMENU
FCB 17,12 column, row
FDB QYES-*
FDB PM1-*
FCB 17,14
FDB QNO-*
FDB PM2-*
FCB $FF
QYES
FCC "Yes",0
QNO
FCC "No",0
* Challenge menu
*
CHMENU
FCB 11,9 column, row
FDB A@-*
FDB CH1-*
FCB 11,11
FDB B@-*
FDB CH2-*
FCB 11,13
FDB C@-*
FDB CH3-*
FCB 11,15
FDB D@-*
FDB CH4-*
FCB 11,17
FDB QRETUR-*
FDB CH5-*
FCB $FF
A@
FCC "10 seconds",0
B@
FCC "20 seconds",0
C@
FCC "30 seconds",0
D@
FCC "60 seconds",0
* Challenge match game screen menu
*
CGMENU
FCB 4,0 column, row
FDB QQUIT-* "Quit"
FDB CG1-*
FCB 24,0
FDB QCANCE-* "Cancel"
FDB CG2-*
FCB $FF
QQUIT
FCC "Quit",0
* Tournament menu
*
TOMENU
FCB 6,8 column, row
FDB A@-*
FDB TO1-*
FCB 6,10
FDB B@-*
FDB TO2-*
FCB 6,12
FDB QRETUR-*
FDB TO3-*
FCB $FF
A@
FCC "Begin 5 minute tournament",0
B@
FCC "Begin 10 minute tournament",0
* Tournament game screen menu
*
TGMENU
FCB 4,0 column, row
FDB QQUIT-* "Quit"
FDB TG1-*
FCB 10,0
FDB QUNDO-* "Undo"
FDB TG2-*
FCB 22,0
FDB QCANCE-* "Cancel"
FDB TG3-*
FCB $FF
* Tournament scoreboard menu
*
SCMENU
FCB 28,22 column, row
FDB QYES-*
FDB SC1-*
FCB 33,22
FDB QNO-*
FDB SC2-*
FCB $FF
* Peek game screen menu
*
PGMENU
FCB 4,0 column, row
FDB QQUIT-* "Quit"
FDB PG1-*
FCB 10,0
FDB QUNDO-* "Undo"
FDB PG2-*
FCB $FF
* Draw menu
*
* U -> menu table
*
DMENU
PSHS U
STU CURMNU
CLRA
CLRB
STD MNUPTR
DMENU0
LDD ,U++
BLT XDMENU
LBSR CPOS get position
LDD ,U
PSHS U
LEAU D,U
LBSR MSG draw the item
PULS U
LEAU 4,U
BRA DMENU0
XDMENU
PULS U,PC
*convert text col,row to voffset
*
* A is col, B is row
* returns with voffset in X
*
CPOS
PSHS A save column
LDX #SCREEN
PSHS B row
CPOSL
DEC ,S
BLT XCPOSL
LEAX 160*8,X
BRA CPOSL
XCPOSL
LEAS 1,S
PULS A get column back
LDB #4
MUL
LEAX D,X
RTS
*convert text col,row to voffset
*
* A is col, B is row
* returns with voffset in X
*
CPOS9
PSHS A save column
LDX #SCREEN
PSHS B row
C9OSL
DEC ,S
BLT X9POSL
LEAX 160*9,X
BRA C9OSL
X9POSL
LEAS 1,S
PULS A get column back
LDB #4
MUL
LEAX D,X
RTS
* Update menu
*
* U -> menu table
*
UMENU
LDA CURSXY+1
LDB #3
MUL
STD TEMPY
LDA CURSXY
LDB #5
MUL
STD TEMPX
UMENUL
LDD ,U column, row
LBLT XUMENU
* figure out x,y range for menu item
PSHS A save column
LDA #8 convert row to character pos
MUL
STD ITEMY1
ADDB #8
STD ITEMY2
PULS A get column back
LDB #8 convert column
MUL
STD ITEMX1
*derive len of message
LEAX 2,U
LDD 2,U
LEAX D,X
LDA #$FF
A@
INCA
TST ,X+
BNE A@
LDB #8
MUL
ADDD ITEMX1
STD ITEMX2
* is the cursor within the range?
LDD TEMPX
CMPD ITEMX1
LBLO UMENUX
CMPD ITEMX2
LBHI UMENUX
LDD TEMPY
CMPD ITEMY1
BLO UMENUX
CMPD ITEMY2
BHI UMENUX
* pointing to this item!
LDD MNUPTR
BEQ UMENU1
* used to point to something
PSHS U
CMPD ,S++
BNE UMENU0
RTS same thing, so forget it
* used to point to something else
* have to de-highlight old item,
* highlight new item
UMENU0
PSHS U
LDU MNUPTR
* de-highlight
LDD ,U++
LBSR CPOS
LDD ,U
LEAU D,U
LBSR CUROFF
LBSR MSG de-highlight
LBSR CURON
PULS U
STU MNUPTR
* highlight
LDD ,U++
LBSR CPOS
LDD ,U
LEAU D,U
INC HFLAG
LBSR CUROFF
LBSR MSG highlight
LBRA CURON
* didn't point to anything previously
* so just highlight this item
UMENU1
STU MNUPTR remember this item
* kludge to change color set
LEAU RGBSEL,PCR
CMPU MNUPTR
BNE A@
LEAU RGBSET,PCR
LBSR CLRSET
A@
LEAU CMPSEL,PCR
CMPU MNUPTR
BNE B@
LEAU CMPSET,PCR
LBSR CLRSET
B@
LDU MNUPTR
LDD ,U++
LBSR CPOS
LDD ,U
LEAU D,U
INC HFLAG
LBSR CUROFF
LBSR MSG highlight
LBRA CURON
UMENUX
* try next menu item
LEAU 6,U
LBRA UMENUL
* not pointing to anything
XUMENU
LDD MNUPTR
BEQ XXUMNU
* used to point to something
* have to de-highlight old item
TFR D,U
LDD ,U++
LBSR CPOS
LDD ,U
LEAU D,U
LBSR CUROFF
LBSR MSG de-highlight
LBSR CURON
CLRA
CLRB
STD MNUPTR forget old item
XXUMNU
RTS
* Execute menu item
XMENU
LDD MNUPTR
BEQ XMENUX
TFR D,U
LEAU 4,U
LDD ,U
LEAS 2,S
JMP D,U
XMENUX
RTS
* draw menu border
*
BORDER
INC BORDF
LDX #SCREEN+4*160+1
LDB #$00
* upper left corner detail
STB -160-1,X
STB -2*160-1,X
LDA #39
* top
PSHS A
A@
DEC ,S
BLT B@
LBSR HLINES
LDB #'#
LBSR PUT
BRA A@
B@
PULS A
* upper right corner detail
LDB #$00
STB -160,X
STB -2*160,X
* bottom
LDX #SCREEN+187*160+1
LDA #39
PSHS A
C@
DEC ,S
BLT D@
LBSR HLINES
LDB #'#
LBSR PUT
BRA C@
D@
PULS A
* lower right corner detail
LDB #$00
STB 8*160,X
STB 9*160,X
* left
LDX #SCREEN+4*160+1
LDA #24
PSHS A
E@
DEC ,S
BLT F@
BSR VLINES
LDB #'#
LBSR PUT
LEAX 8*160-4,X
BRA E@
F@
PULS A
* lower left corner detail
LDB #$00
STB -1,X
*right
LDX #SCREEN+4*160+1
LEAX 38*4,X
LDA #24
PSHS A
G@
DEC ,S
BLT H@
BSR VLINES
LDB #'#
LBSR PUT
LEAX 8*160-4,X
BRA G@
H@
CLR BORDF
PULS A,PC
VLINES
PSHS X
LDD #$0008
A@
STA -1,X
STA 4,X
LEAX 160,X
DECB
BNE A@
PULS X,PC
HLINES
LDD #$0000
STD -2*160,X
STD -2*160+2,X
STD -160,X
STD -160+2,X
STD 8*160,X
STD 8*160+2,X
STD 9*160,X
STD 9*160+2,X
RTS
* text menu
*
* U -> menu table
*
TMENU
STU CURMNU
LBSR BORDER
TMENUS
LDU CURMNU
LBSR DMENU
A@
LDD SEED1 randomize
ADDD #1
STD SEED1
LDB #1
LBSR CURSOR
LDU CURMNU
LBSR UMENU
LDB #1
LBSR BUTTON
BEQ A@
LBSR XMENU
BRA A@