forked from historicalsource/smashtv
-
Notifications
You must be signed in to change notification settings - Fork 1
/
ADJUST.ASM
2890 lines (2601 loc) · 110 KB
/
ADJUST.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
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
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
.FILE "ADJUST.ASM"
.TITLE "ROBO GAME ADJUSTMENTS"
.WIDTH 132
.OPTION B,D,L,T
.MNOLIST
;
; SOFTWARE:
;
; COPYRIGHT (C) 1989 WILLIAMS ELECTRONICS GAMES, INC.
;
;
; GET THE SYSTEM STUFF
.INCLUDE "MPROC.EQU" ;MPROC EQUATES
.INCLUDE "DISP.EQU" ;DISPLAY PROC. EQUATES
.include "sys.inc" ;z unit system equates
.include "macros.hdr" ;macros definitions
.INCLUDE "IMGTBL.GLO"
.INCLUDE "ROBO.EQU"
.INCLUDE "LINK.EQU" ;LINKY EQUATES
.INCLUDE "MENU.EQU" ;MENU EQUATES
.TEXT
;
* IN THIS MODULE
*
.DEF GO_ADJ
.DEF DO_ADJH
.DEF BCDBIN
.DEF BINBCD
*
* IN HSTD.ASM
*
.REF CMOS_VAL
.REF P_FORK
.REF INIT_HSR
*
* IN TEST.ASM
*
.REF B_MENU,CYAN_BOX
.REF L_MESS,TOP_BOX
.REF LM_FINIS
.REF LM_SETUP
.REF AREUSURE
.REF ST_STICK
.REF GETSTICK
.REF SUR_MESS
.REF SURE_BOX
.REF GET_FAC
.REF MENU_TOP
.REF DOBORDER
.REF BLNKHELP
.REF H_SLAVE
; .REF CK_DOOR
.REF COL_INST
.REF STD_BORD
.REF LD_CTAB
*
* IN MENU.ASM
*
.REF ANY_BUT
.REF MESS_MM
.REF GET_CSPT
*
* IN AUDIT.ASM
*
.REF GET_ADJ,HTOHXASC
.REF PUT_ADJ
.REF F_ADC_S
.REF CS_ENTS ;NUMBER OF HIGHEST IN COIN TABLE
.REF STRCAT
.REF NO_CREDS
*
* OTHERS
.REF RD15FONT,RD7FONT,STRCNRM,BLNKAREA,HEXTOASC
.REF STRRNRM,STRLNRM,CLR_SCRN
*
.TEXT
*
* Adjustment menu requested.....make sure CMOS is ok!
*
GO_ADJ:
MOVI MEN_ADJ,A8
GEN_ADJUST:
MOVE A8,-*A12,L ;PUSH MENU ON STACK
CALLA CMOS_VAL ;CHECK OUT THE REGION
JRZ SET_OK ;ITS OK.....CONTINUE....
JSRP GET_FAC ;BRING TO FACTORY SETTINGS OR QUIT.
JSRP ANY_BUT
CALLA CMOS_VAL ;CAN'T GO IF WE'RE NOT OK NOW
JRNZ GO_ADQ ;ITS NOT VALID....NO ADJUSTING!
SET_OK:
MOVK 1,A0
MOVE A0,-*A12,W ;LIKE GEN_MENU...KEEP NUMBER ON STACK
*
ADJ_LOOP:
CALLA CLR_SCRN ;CLEAR THE SCREEN!
MOVI ADJ_ADV,A8
JSRP L_MESS ;PRINT THE NEW INSTRUCTIONS
MOVE *A12(WORD_SIZE),A8,L ;GET THE MENU
JSRP MENU_TOP ;PRINT OUT THE TOP.
MOVI ROBO_YELLOW,A9
CALLA COL_INST ;PUT UP A DIFFERENT INSTR. BOX
MOVE *A12,A9,W ;GET INDEX TO USE.
JSRP B_MENU ;FETCH THE ENTRY TO ADJUST.
*
* EACH ADJUSTMENT HAS A STRUCTURE ASSOCIATED WITH IT.
* A9 RETURNS A STRUCTURE FOR THE ITEM SELECTED.
*
MOVE A9,A9 ;0 IS RETURN TO MAIN MENU
JRZ GO_ADJX
*
* A8 HAS THE MENU NUMBER.....UNLIKE GEN_MENU...DON'T STEP!
*
MOVE A8,*A12,W ;PUT IT SAFELY ON OUR STACK.
MOVE *A9(AD_ROUT),A0,L ;GET THE ROUTINE TO CALL FOR ACTIVATION
MOVI ADJ_LOOP,A7
MOVE A7,-*A12,L ;PUSH RETURN ADDRESS
JUMP A0 ;"CALL THE ROUTINE (PASSING STRUCT IN A9)
GO_ADJX:
ADDI WORD_SIZE,A12 ;"POP" THE POSITION INDICATOR
GO_ADQ:
ADDI LONG_SIZE,A12 ;POP MENU
RETP ;OK...RETURN!
**************************************************************************
* *
* PRICE_ADJ *
* *
* THIS IS EXECUTED WHEN THE "CUSTOM PRICING" ENTRY IS *
* SELECTED FOR ADJUSTMENT FROM THE ADJUSTMENT MENU. *
* *
* IT CREATES A WHOLE NEW ADJUSTMENT MENU CONTIAING: *
* *
* *
* LEFT SLOT UNITS *
* CENTER SLOT UNITS *
* RIGHT SLOT UNITS *
* UNITS / CREDIT *
* UNITS / BONUS *
* MINIMUM UNITS *
* CREDITS TO START *
* CREDITS TO CONTINUE *
* SHOW CREDIT FRACTIONS *
* COINS PER DOLLAR *
* FREE PLAY *
* MAXIMUM CREDITS *
* COIN PAGE HELP *
* *
**************************************************************************
PRICE_ADJ:
MOVI MEN_CUST,A8 ;HANDLE JUST LIKE MAIN ADJ. MENU
JAUC GEN_ADJUST
**************************************************************************
* *
* GEN_ADJ *
* *
* THIS IS THE ROUTINE THAT IS EXECUTED TO DO *
* THE ADJUSTING ONCE A BUTTON IS CLICKED ON *
* AN ADJUSTMENT. *
* *
* A9 -> ADJUSTMENT STRUCTURE! *
* *
**************************************************************************
GEN_ADJ:
MOVE A9,*A13(PDATA),L ;SAVE THE STRUCTURE POINTER
MOVE A9,A8 ;GET TO GENERAL POINTING REGISTER
JSRP DO_IN_WHITE ;GO FROM LF TO WHITE RIGHT AWAY.
; JSRP ADJ_DOOR ;CAN'T DO IT UNLESS DOOR IS OPEN.
MOVE A0,A0
JRNZ ADJ_CAN ;CANCELLED
*
CALLR CLR_MAIN ;CLEAR OUT THE MAIN MENU REGION
CALLR ADJ_INST ;PUT INSTRUCTIONS AT BOTTOM.
JSRP ST_STICK ;LOCKOUT STUCK SWITCHES
SLEEP 2 ;STOP RACE ON INSTRUCTIONS
ADJ_CHNG:
SLEEP 1 ;NOW LOOP ON STICK...EXIT
MOVI 31000H,A5 ;TYPOMATIC....BOT HALF SAYS DON'T TIME OUT
* ;TOP HALF IS TICKS PER HIT
JSRP GETSTICK ;ASK THE STICK HANDLER.......
MOVE *A13(PDATA),A8,L ;GET OUR POINTER
MOVE A0,A1 ;KEEP GETSTICK VALUE
JRZ ADJ_CHNG ;ITS ZERO....NO MORE WORK NEEDED
MOVE *A8(AD_CMOS),A0,W ;GET ADJ NUMBER
MOVE A0,A2 ;COPY FOR LATER
CALLR GET_EADJ ;READ IT OUT (FIXING ZERO IF NEC)
MOVE A0,A3 ;SAVE "OLD" VALUE
*
* A0 = ADJUSTMENT VALUE
* A1 = GET_STICK VALUE
* A2 = ADJUSTMENT NUMBER
* A3 = ADJUSTMENT VALUE READ!
* A8 = ADJUSTMENT STRUCTURE POINTER
*
CMPI 3,A1 ;BUTTON......BACK TO ADJ MENU!
JRZ ADJ_BUTT ;YEP....WE'RE OUT OF HERE.
CMPI 2,A1
JRZ ADJ_DOWN ;ITS DOWN....
*
* REQUEST TO GO UP....
*
CALLR INC_ADJ ;INCREMENT IT
JRUC ADJ_JOIN
ADJ_DOWN:
CALLR DEC_ADJ ;DECREMENT IT
ADJ_JOIN:
MOVE A2,A0 ;ADJUSTMENT NUMBER
CALLR GET_EADJ ;READ IT OUT (FIXING ZERO IF NEC)
CMP A0,A3 ;DID IT NOT CHANGE?
JRZ ADJ_CHNG ;NOPE....NO ACTION!
*
* IT CHANGED....WE NEED TO BEEP AND RE-PLOT LOWER
* PORTION TO REFLECT NEW SETTING.
*
SOUND1 ADJ_BEEP ;MAKE A BEEP.
JSRP DO_IN_WHITE ;AND UPDATE THE ADJUSTMENT
JRUC ADJ_CHNG ;AND LOOP!
DO_IN_WHITE:
CALLR CLR_CUR ;CLEAR OUT CURRENT SETTING
MOVI ROBO_WHITE,A11 ;THEY'RE STARING....NO HEADACHES
JAUC AD_CRVAL ;PRINT THE NEW VALUE
ADJ_BUTT:
SOUND1 ADJ_CASH
ADJ_CAN:
RETP
**************************************************************************
* *
* DEC_ADJ *
* *
* THIS IS CALLED TO MOVE TO THE PREVIOUS VALUE. *
* A0 = VALUE READ FROM CMOS *
* A2 = ADJUSTMENT NUMBER (TO WRITE IT BACK) *
* A8 = ADJUSTMENT STRUCTURE POINTER. *
* *
* INC_ADJ IS USED TO STEP TO THE NEXT VALUE *
* *
**************************************************************************
DEC_ADJ:
MMTM SP,A0,A1,A2,A3
MOVE A0,A3 ;COPY ORIGINAL VALUE
MOVE *A8(AD_DELTA),A1,L ;GET UNITS BETWEEN VALUES
CALLR MAKE_BIN_IF_NEC ;CHANGE RADIX FOR MATH IF NECESSARY
SUB A1,A0 ;REMOVE THIS FROM READ VALUE
JRUC FINISH_CHANGE ;GO TO COMMON ROUTINE TO WRAP IT UP
INC_ADJ:
MMTM SP,A0,A1,A2,A3
MOVE A0,A3 ;COPY ORIGINAL VALUE
MOVE *A8(AD_DELTA),A1,L ;GET UNITS BETWEEN VALUES
CALLR MAKE_BIN_IF_NEC
ADD A1,A0 ;REMOVE THIS FROM READ VALUE
FINISH_CHANGE:
CALLR BCD_IF_NEC ;BACK TO BCD AFTER THE MATH
CALLR PUT_IN_RANGE ;ADJUST TO ACCOUNT FOR WRAP AND LIMITS
MOVE *A8(AD_ZEQU),A1,L ;This number becomes zero
CMP A0,A1 ;is this the number?
JRNZ FC_NZ ;NOPE...STORE IT!
CLR A0 ;USE ZERO IN PLACE OF THIS NUMBER!
FC_NZ:
MOVE A0,A1 ;WRITING REG
MOVE A2,A0 ;ADJUSTMENT NUMBER
CALLA PUT_ADJ ;WRITE IT BACK
*
* SEE IF WE'RE DOING MASTER COINAGE.
*
CMP A1,A3 ;DID THE NUMBER CHANGE?
JRZ NOT_COIN ;NOPE...DON'T LOAD IT UP!
*
* AT THIS POINT WE KNOW THAT THE VALUE BEING ADJUSTED CHANGED.
*
CALLR DIRTY_IF_NEC ;IF ITS A COIN VALUE TAKE NOTE!
CMPI ADJPRICE,A0 ;IS IT?
JRNZ NOT_COIN ;NOT COIN
CALLA LD_CTAB ;BATCH WRITE THE VALUES IN!
CALLA NO_CREDS ;REMOVE CREDITS AND FRACTIONS WHEN
* ;MODE CHANGES
NOT_COIN:
CALLA F_ADC_S ;MAKE CHECKSUM VALID!
MMFM SP,A0,A1,A2,A3
RETS
**************************************************************************
* *
* DIRTY_IF_NEC *
* *
* THIS IS CALLED BY ALL ADJUSTMENTS WHEN THEY ACTUALLY *
* CHANGE THEIR VALUE. FOR THE COINAGE ADJUSTMENTS, *
* IF ANY OF THE 1ST 6 VALUES ARE TOUCHED WE NEED TO MAKE *
* *
* ADJ1ST6 = ZERO. *
* *
* IF ANY OF THE 1ST 8 VALUES ARE TOUCHED WE NEED TO MAKE *
* *
* ADJVIRGIN = ZERO. *
* *
* THE AD_FLAGS FIELD IN THE ADJUSTMENT STRUCTURE HAVE BITS *
* INDICATING WHICH (IF ANY) SHOULD BE DIRTYED. *
* *
**************************************************************************
DIRTY_IF_NEC:
MMTM SP,A0,A1,A2
MOVE *A8(AD_FLAGS),A2,W ;FETCH THE FLAGS
BTST VIRG_BIT,A2 ;DOES CHANGING THIS SAY SET VIRG BIT.
JRZ NOT_1ST_8 ;NOPE
MOVI ADJVIRGIN,A0
CLR A1
CALLA PUT_ADJ
NOT_1ST_8:
BTST SIX_BIT,A2 ;1ST 6?
JRZ NOT_1ST_6
MOVI ADJ1ST6,A0
CLR A1
CALLA PUT_ADJ
NOT_1ST_6:
BTST HSR_BIT,A2 ;HIGH SCORE RESET NUM?
JRZ NOT_HSR ;NOPE
CALLA INIT_HSR ;IT WAS CHANGED....STUFF THE VALUE!
NOT_HSR:
MMFM SP,A0,A1,A2
RETS
**************************************************************************
* *
* MAKE_BIN_IF_NEC *
* *
* THIS IS CALLED AFTER THE A0 HAS THE ADJUSTMENT AND *
* A1 HAS THE AMOUNT TO ADD OR SUBTRACT. IF WE'RE *
* DOING BCD MATH THEN CONVERT BOTH A0 AND A1. *
* *
**************************************************************************
MAKE_BIN_IF_NEC:
MMTM SP,A2
MOVE *A8(AD_FLAGS),A2,W ;GET THE FLAGS
BTST BCD_BIT,A2 ;BCD?
JRZ MBINX ;NOPE
CALLA BCDBIN ;CONVERT A0 TO BINARY
MOVE A0,A2 ;SAVE
MOVE A1,A0 ;NOW A1
CALLA BCDBIN
MOVE A0,A1
MOVE A2,A0 ;NOW PUT A0 BACK
MBINX:
MMFM SP,A2
RETS
**************************************************************************
* *
* BCD_IF_NEC *
* *
* A0 HAS A RESULT OF THE ADJUSTMENT.....IN BINARY. *
* CONVERT BACK TO BCD IF THAT'S THE MODE. *
* *
**************************************************************************
BCD_IF_NEC:
MMTM SP,A2
MOVE *A8(AD_FLAGS),A2,W ;GET THE FLAGS
BTST BCD_BIT,A2 ;BCD?
JRZ BINX ;NOPE
CALLA BINBCD ;BACK TO BCD
BINX:
MMFM SP,A2
RETS
ADJ_CASH
.WORD 0F7A5H-10H,8,08080H,0 ;CASH REGISTER SOUND
ADJ_LBEEP
ADJ_BEEP .WORD 0F3F7H-10H,020H,080AFH,0 ;BEEP TONE
**************************************************************************
* *
* CLR_CUR *
* *
* THIS IS CALLED TO CLEAR OUT THE AREA WHERE THE *
* "CURRENT SETTING" IS BEING DISPLAYED. *
* *
**************************************************************************
CLR_CUR:
MMTM SP,A3,A4
MOVI AM_HX,A3 ;THIS IS LEFT MARGIN OF HELP AREA
MOVI CUR_LRX,A4 ;RIGHT X
SUB A3,A4 ;A4 HAS X DISTANCE
ADDI ADJ_ULY*10000H,A3 ;UPPER LEFT Y
ADDI (256-ADJ_ULY)*10000H,A4 ;Y GOES TO BOTTOM OF SCREEN
CALLA BLNKAREA ;ITS BLANK NOW!
MMFM SP,A3,A4
RETS
**************************************************************************
* *
* CLR_MAIN *
* *
* THIS IS CALLED TO CLEAR OUT THE ADJUSTMENT MENU AND *
* THE CYAN INSTRUCTIONS FOR THIS MENU. *
* *
**************************************************************************
CLR_MAIN:
MMTM SP,A3,A4
MOVI TIT_ULX,A3 ;LEFT EDGE
MOVI AM_HX,A4 ;UP TO THIS EDGE
SUB A3,A4 ;X'S ARE SET.
ADDI INST_ULY*10000H,A3 ;TOP Y
ADDI (400-INST_ULY)*10000H,A4 ;Y DISTANCE
CALLA BLNKAREA
MMFM SP,A3,A4
RETS
**************************************************************************
* *
* ADJ_DOOR *
* *
* PRINT MESSAGE THAT DOOR MUST BE OPENED TO CONTINUE. *
* HOLD CONTROL TILL BUTTON IS PRESSED (CANCELLING) *
* OR DOOR IS OPEN. *
* *
* RETURN A0 = 0 MEANS DOOR GOT OPENED. *
* A0 .NE 0 FOR BUTTON PRESSED. *
* *
**************************************************************************
;ADJ_DOOR:
; CALLA CK_DOOR ;IS THE DOOR OPEN? NZ=OPEN
; JRNZ DORET ;YEP.......RETURN A0=0
;
; CALLA CLR_MAIN ;CLEAR THE SCREEN
; MOVI CUR_ULY,A10 ;PLOT TO SQUARE UP WITH "CURRENT SETTING"
; CALLA ADINBOX ;PUT A NICE BOX AROUND IT.
; MOVI MESS_OPEN_OR_CANCEL,A8
; JSRP L_MESS ;GIVE INSTRUCTIONS
; JSRP ST_STICK ;GET "STARTING STATE"
;WD1:
; SLEEP 1 ;NAP A BIT
; CALLA CK_DOOR
; JRNZ DORET ;ITS OPEN...RETURN OK
; MOVI 40010H,A5 ;TYPOMATIC PARMS
; JSRP GETSTICK ;CHECK BUTTONS
; CMPI 3,A0 ;BUTTON?
; JRNZ WD1 ;NOT YET
; SOUND1 ADJ_LBEEP ;MAKE A BEEP.
; MOVI 3,A0 ;RETURN A0 .NE. 0
*
* RETURN A0=3
*
; RETP
* RETURN A0=0 (CONTINUE)
*
;DORET:
; CLR A0
; RETP
*
**************************************************************************
* *
* ADJ_INST *
* *
* THIS IS CALLED TO PUT AN INSTRUCTION BOX OUT *
* WHILE ADJUSTMENT IS TAKING PLACE. *
* *
**************************************************************************
ADJ_INST:
MOVE *A13(PDATA),A8,L ;PASS THE ADJUSTMENT POINTER
MOVI ADJ_INST_P,A7
CALLA P_FORK ;START IT UP!
RETS
**************************************************************************
* *
* ADJ_INST_P *
* *
* THIS IS CALLED TO PUT INSTRUCTIONS FOR ADJUSTMENT *
* MODIFICAITION UP AND FLASH THE ARROW (IF ITS NOT *
* TOO ANNOYING) *
* *
**************************************************************************
ADJ_INST_P:
JSRP ADJUSTING ;PUT UP "ADJUSTING DIFFICULTY" MESSAGE
MOVE A10,A3 ;STASH # OF ARROWS WHERE IT WILL BE SAFE
CALLR ADINBOX ;PUT THE BOX OUT
MOVI INST_TO_ADJ,A8
JSRP L_MESS ;PRINT OUT INSTRUCTIONS
MOVI ADJ_ARROW,A8
JSRP L_MESS
JAUC SUCIDE
**************************************************************************
* *
* ADINBOX *
* *
* THIS PUTS A BOX AROUND THE ADJUSTMENT INSTRUCTIONS. *
* *
**************************************************************************
*
INBOX_HEIGHT EQU 7BH
ADINBOX:
MMTM SP,A10
MOVI CUR_ULY-2,A10
SLL 16,A10
MOVI TIT_ULX,A4 ;UPPER RIGHT X
MOVY A10,A4 ;UPPER RIGHT
MOVI AM_RX,A5
MOVY A10,A5 ;START WITH BASE Y
ADDI INBOX_HEIGHT*10000H,A5
CALLR WH_BORD
MMFM SP,A10
RETS
**************************************************************************
* *
* ADJUSTING *
* *
* THIS IS CALLED WHEN WE ENTER THE "ADJUSTING" PHASE *
* IT PUTS A BOX IN THE LEFT AREA TO SAY WHAT WE ARE ADJUSTING. *
* *
**************************************************************************
ADJUSTING:
MOVE A8,A2 ;PUT ADJUSTMENT BLOCK PTR WHERE ITS SAFE
MOVI (CUR_ULY-31H)*10000H,A4 ;FOR DO_BORDER
ADDI TIT_ULX,A4 ;A4 IS REASONABLY EASY
MOVI ((CUR_ULY-2)+MB_YWID)*10000H,A5 ;OVERLAP THE ONE BELOW IT
ADDI AM_RX,A5 ;THIS IS RIGHT EDGE
CALLR WH_BORD ;DO A WHITE BORDER
MOVI MES_ADNAME,A8 ;PUT THE ADJUSTMENT NAME UP
CALLA LM_SETUP
MOVE *A2(AD_MAIN),A8,L ;GET THE MAIN MENU MESSAGE
JSRP LM_FINIS
MOVI MES_ADJUSTING,A8
JSRP L_MESS
RETP
**************************************************************************
* *
* PARAM_VAL *
* *
* This is called to summarize the values of the *
* important adjustments on the parameter page. *
* *
**************************************************************************
*
* WE WILL PRING OUT 3 LINES IN A BOX.
*
* 1) Pricing:
* 2) Free Play: yes/no
* 3) Maximum Credits:
*
PDY EQU HELP_DY+(HELP_DY/2)
PMARG EQU 6
PARAM_VAL:
MOVI 8,A1 ;Setup a box for our 3 lines
CALLR ADJ_BOX ;(a10 is set as y for the 3 lines)
ADDI 6,A10 ;PUSH TO CENTER 5 LINES IN BOX
CALLR GET_COIN_TITLE ;COIN MODE
MOVI MESS_GP,A8
JSRP SMALL_LEFT_RIGHT ;PRINT THE LINES
ADDI PDY,A10 ;PUSH TO NEXT LINE
MOVI M_NO,A2 ;ASSUME "NO"
MOVI ADJFREPL,A0
CALLA GET_ADJ ;GET THE FREE PLAY ADJUSTMENT
JRZ NOT_FREE
MOVI M_YES,A2
NOT_FREE:
MOVI MESS_FP,A8
JSRP SMALL_LEFT_RIGHT ;PRINT THE LINES
ADDI PDY,A10 ;PUSH TO NEXT LINE
MOVI ADJMAXC,A0
MOVI MESS_MAX,A8
JSRP ADJ_LEFT_RIGHT ;A0 = ADJUST A8 = MESSAGE
*
* CREDITS TO START AND CONTINUE NEEDS TO HANDLE PLURAL ETC.
*
ADDI PDY,A10 ;PUSH TO NEXT LINE
MOVI ADJCSTRT,A0 ;GET CREDITS REQUIRED TO START
MOVI M_CTS_PL,A8
JSRP ADJ_LEFT_RIGHT ;A0 = ADJUST A8 = MESSAGE
*
* NOW THE CREDITS TO CONTINUE
*
ADDI PDY,A10 ;PUSH TO NEXT LINE
MOVI ADJCCONT,A0 ;GET CREDITS REQUIRED TO CONTINU
MOVI M_CTC_PL,A8
JSRP ADJ_LEFT_RIGHT ;A0 = ADJUST A8 = MESSAGE
RETP
**************************************************************************
* *
* ADJ_LEFT_RIGHT *
* *
* A8 HAS MESSAGE *
* A0 HAS ADJUSTMENT *
* A10 HAS HEIGHT. *
* *
* LEFT JUSTIFY A8 MESSAGE *
* RIGHT JUSTIFY A0 ADJUSTMENT (AFTER READING IT) *
* *
**************************************************************************
ADJ_LEFT_RIGHT:
MOVE A8,A3 ;STASH MESSAGE
CALLA GET_ADJ
MOVE A0,A8
CALLA HEXTOASC ;A8 POINTS TO NUMBER STRING
MOVE A8,A2
MOVE A3,A8 ;GET MESSAGE IN A8
JRUC SMALL_LEFT_RIGHT
**************************************************************************
* *
* SMALL_LEFT_RIGHT *
* *
* THIS IS CALLED TO PRINT A LEFT AND RIGHT JUSTIFIED *
* PAIR OF STRINGS IN THE "CURRENT SETTING BOX" *
* *
* A2 = RIGHT JUSTIFIED STRING *
* A8 = LEFT JUSTIFIED STRING TO PRINT *
* A10 = Y VALUE *
* *
**************************************************************************
SMALL_LEFT_RIGHT:
MMTM A12,A11,A6,A10,A9,A3
MOVI ROBO_WHITE,A6 ;SOLID WHITE FOR THESE MULTI-LINERS
MOVI RD7FONT,A11 ;USE BABY FONT
MOVI AM_HX+PMARG,A9 ;LEFT X IS INSIDE LEFT LINE
MOVE A10,A3 ;SAVE Y IN A3
SLL 16,A3
MOVY A3,A9 ;POINTER SET!
MOVI SPACING07,A10
CLR A0
JSRP STRLNRM ;DO IT!
MOVE A2,A8 ;GET RIGHT JUSTIFIED STRING
MOVI TIT_LRX-PMARG,A9 ;INSIDE RIGHT MARGIN
MOVY A3,A9 ;AT OUR Y
JSRP STRRNRM ;PRINT IT!
MMFM A12,A11,A6,A10,A9,A3
RETP
**************************************************************************
* *
* COIN_SET *
* *
* THIS IS THE ROUTINE THAT IS CALLED TO DISPLAY THE CURRENT *
* COINAGE SETTINGS. *
* *
* A8 HAS POINTER TO ADJUSTMENT BLOCK *
* A11 HAS THE COLOR TO USE *
* *
**************************************************************************
COIN_SET:
CALLR TAMPEREDP ;HAS THE 1ST 6 COIN VALUE BEEN TAMPERED WITH?
JRZ SBO ;YEP....SMALL BOX ONLY!
MOVI 8,A1 ;BIG BOX FOR OUTSIDE
CALLR ADJ_BOX
SBO:
MOVI 1,A1 ;DRAW A BOX TO HOLD 1 LINE
CALLR ADJ_BOX ;DRAW THE BOX....PASS BACK 1ST PLOT LINE
*
* THE ABOVE 2 CALLS SHOULD CREATE A BOX LIKE:
*
* ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
* º U.S.A. 1 º
* ºÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
* º 1 COIN / 1 CREDIT º
* º º
* º º
* º 25c $1.00 25c º
* ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
*
* A10 HAS THE PLACE TO PLOT THE TITLE LINE.
*
MOVE A10,A4 ;KEEP THE Y HANDY.
*
CALLR GET_COIN_TITLE ;GET TITLE FOR BIG BOX IN A2.
*
* A2 HAS STRING
* A11 IS COLOR
* A10 IS Y TO PRINT
*
COIN_TIT:
JSRP DO_BIG_LINE ;PRINT THIS LINE!
MOVI ROBO_WHITE,A11 ;DON'T GLOW INSIDE BOX IF THAT'S THE MODE
CALLR TAMPEREDP ;HAS THE 1ST 6 COIN VALUE BEEN TAMPERED WITH?
JRZ NO_INFO ;YEP....JUST GIVE THE STARTS AND CONTINUES
CALLA GET_CSPT ;A6 POINTS AT THE CSELECT BLOCK
MOVE *A6(CS_LIST),A2,L ;FETCH POINTER TO MESSAGE LIST
JRZ NO_HEADERS ;NO LIST!
MOVI COIN_HEAD_Y,A10 ;AT THIS HEIGHT
NEXT_HEADER:
MOVE *A2+,A8,L
JRZ NO_HEADERS ;HEADERS ARE OUT...CONTINUE
JSRP PRINT_SMALL_LINE ;PRINT THE LINE
ADDI 12,A10 ;PUSH TO NEXT LINE
JRUC NEXT_HEADER
NO_HEADERS:
MOVI MESS_CTS,A10 ;SET Y FOR COIN SLOT LINE.
MOVI M_SLOTVAL,A8
JSRP PRINT_SMALL_LINE ;HEADER FOR COIN SLOT VALUE
ADDI 12,A10 ;PUSH Y UP FOR A GAP *
CALLA GET_CSPT ;A6 POINTS AT THE CSELECT BLOCK
MOVE *A6(CS_SLOTS),A8,L ;PRINT COIN SLOT INFO
JSRP PRINT_SMALL_LINE ;PRINT THE LINE
NO_INFO:
RETP ;DONE FOR NOW
**************************************************************************
* *
* GET_COIN_TITLE *
* *
* THIS IS CALLED TO FETCH THE CHARACTER STRING MESSAGE *
* FOR THE CURRENT COIN MODE. IF ITS STANDARD, THEN *
* IT IS FETCHED BASED ON THE COIN SELECT TABLE. *
* *
* IF THE 1ST 6 PARAMETERS HAVE BEEN MODIFIED, THEN *
* IT RETURNS THE STRING "NON-STANDARD". *
* *
**************************************************************************
GET_COIN_TITLE:
MMTM SP,A6 ;PRESERVE FOR COIN SELECT TABLE
CALLA GET_CSPT ;A6 POINTS AT THE CSELECT BLOCK
MOVI MESS_TAMPERED,A2
MOVI ADJ1ST6,A0 ;NON-STANADARD TITLE IF 1ST 6 MODIFIED
CALLA GET_ADJ ;WELL?
JRZ GCTX ;PUT OUT THE TITLE LINE AS TAMPERED!
MOVE *A6(CS_TITLE),A2,L ;GET THE CSELECT TITLE FOR ITS VALUES
GCTX:
MMFM SP,A6 ;PRESERVE FOR COIN SELECT TABLE
RETS
**************************************************************************
* *
* TAMPEREDP *
* *
* HAVE THE COIN PARAMETERS BEEN TAMPERED WITH. *
* THIS IS NON-ZERO IF ANY OF THE 1ST 6 COIN *
* PARAMETERS HAVE BEEN ADJUSTED. *
* *
**************************************************************************
TAMPEREDP:
MMTM SP,A0
MOVI ADJ1ST6,A0 ;JUST CHECK THE 1ST 6
CALLA GET_ADJ ;HAS IT BEEN TAMPERED WITH (0 MEANS YES)
MMFM SP,A0
RETS
**************************************************************************
* *
* PRINT_SMALL_LINE *
* *
* THIS IS CALLED TO PRINT A LINE IN THE "CURRENT SETTING" *
* BOX FOR THE COINAGE. *
* *
* A8 = STRING TO PRINT *
* A11 = COLOR *
* A10 = Y VALUE *
* *
* PRINT IN THE 7 POINT FONT WITH X CENTERED FOR THE *
* HELP SYSTEM. *
* *
**************************************************************************
PRINT_SMALL_LINE:
MMTM A12,A11,A6,A10,A9
MOVE A11,A6 ;COLOR SET
MOVI RD7FONT,A11 ;USE BABY FONT
MOVI AM_HX,A9,W ;GET LEFT X
CALLR LEFT_TO_CENTER ;CONVERT IT
MOVE A10,A0
SLL 16,A0
MOVY A0,A9 ;POINTER SET!
MOVI SPACING07,A10
CLR A0
JSRP STRCNRM ;DO IT!
MMFM A12,A11,A6,A10,A9
RETP
*
* DO_ADJH
*
* THIS IS CALLED TO PLOT THE RIGHT HALF OF THE SCREEN
* FOR EACH ADJUSTMENT AS THE USER SELECTS THEM ON
* THE ADJUSTMENT MENU.
*
* THE FORMAT IS AS FOLLOWS:
*
* ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
* º A D J U S T M E N T M E N U º
* º ROBO REVISION 1.4 º
* ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
* ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
* º SELECT BLAH BLAH BLAH º º GAME DIFFICULTY º
* ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
* ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ» ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
* º º º THIS CONTROLS THE OVERALL º
* º GAME PRICING º º DIFFICULTY OF GAME PLAY. º
* º=======GAME DIFFICULTY=======º º º
* º LIVES PER PLAY º º RANGE OF SETTINGS: 1-9 º
* º POWER-UPS PER PLAY º º º
* º EXTRA MAN EVERY º º EASIEST SETTING: 1 º
* º LAST EXTRA MAN º º HARDEST SETTING: 9 º
* º ATTRACT-MODE SOUND º º FACTORY SETTING: 3 º
* º AUTO HIGH SCORE RESET º ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
* º VIOLENCE LEVEL º
* º RETURN TO MAIN MENU º
* º º
* º º ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
* º º º º
* º º º 9 - EXTRA HARD º
* º º º º
* ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
*
*
* ON ENTRY....A1 POINTS AT THE 3 WORDS FOR CURRENT
* MENU ENTRY.
*
DO_ADJH:
*
* FIRST WE BLANK OUT THE AREA...WE NEED TO DO THIS FROM
* THE MENU PROCESS SINCE THE RIGHT EDGE IS DETERMINED BY
* MENU PDATA STUFF. IT WILL RETURN IN A9 THE MARGIN WE
* SHOULD WORK FROM.
*
CALLA BLNKHELP ;BLANK OUT THE AREA WE'RE PLOTTING!
MOVE A1,A8 ;PASS THE STRUCTURE POINTER TO NEW PROCESS!
MOVI AD_SLAVE,A7
CALLA P_FORK ;THIS CREATES IT!
RETS ;NOW RETURN TO MENU HANDLER!
**************************************************************************
* *
* AD_SLAVE *
* *
* THIS IS FORKED TO PLOT THE RIGHT SIDE...IT HAS *
* ITS OWN PDATA AREA FOR INFO STORAGE. *
* *
* A8 = POINTER TO THE MENU SELECTION 3 LONG-WORD ENTRY *
* A9 = LEFT X MARGIN FOR OUR WORK. *
* *
**************************************************************************
ADS_STRUCT EQU PDATA ;LONG-POINTER TO ADJUSTMENT STRUCTURE
ADS_LX EQU ADS_STRUCT+LONG_SIZE ;WORD-LEFT X TO WORK FROM
ADS_CX EQU ADS_LX+WORD_SIZE ;WORD-CENTER X FOR WORK
AD_SLAVE:
MOVE *A8(MENU_ROUTINE),A11,L ;NOW WE HAVE OUR SPECIAL STRUCTURE!
MOVE A11,*A13(ADS_STRUCT),L ;STASH IT...WE'LL NEED IT
MOVE A9,*A13(ADS_LX),W ;ALSO THE X.....
MOVE A9,A4 ;COPY LEFT FOR BORDER ROUT
CALLR LEFT_TO_CENTER
MOVE A9,*A13(ADS_CX),W ;STASH THE CENTER
*
* A4 = UPPER LEFT Y,X
* A5 = LOWER RIGHT Y,X
* A0 = Y,X WIDTH OF BORDER
* A9 = COLOR OF BORDER.
*
ADDI INST_ULY*10000H,A4 ;ADD IN THE Y
MOVI (INST_LRY*10000H)+TIT_LRX,A5 ;THIS IS OTHER EDGE.
MOVI ROBO_PURPLE,A9
CALLA STD_BORD ;ADJUSTMENT BORDER IS UP.
*
MOVI ADJT_SETUP,A8
CALLA LM_SETUP ;SETUP TO PRINT TITLE
MOVE *A13(ADS_CX),A2,W ;GET THE X
MOVX A2,A9 ;SUBSTITUTE OUR X IN.
MOVE *A13(ADS_STRUCT),A2,L ;GET STRUCTURE POINTER
MOVE *A2(AD_TITLE),A8,L ;GET MESSAGE POINTER
JSRP LM_FINIS ;BOX AND TITLE ARE UP.
MOVE *A2(AD_HELP),A8,L ;HELP STRUCTURE
MOVE *A13(ADS_LX),A9,W ;LEFT X FOR HELP BOX
MOVI INST_LRY+BOX_YGAP,A10 ;THIS IS HELP BOX POSITION
ADDI 10000H,A10 ;FLAG THAT THIS IS TOP..NOT CENTER!
MOVI H_SLAVE,A7 ;FORK OFF SO IT CAN USE PDATA!
CALLA P_FORK ;START UP ANOTHER W/ SAME ID
*
* NOW WE NEED TO SHOW THE CURRENT SETTING ON THE LOWER HALF OF
* THE SCREEN.
*
MOVE *A13(ADS_STRUCT),A8,L ;GET THE ADJUSTMENT STRUCTURE
MOVI ROBO_LF,A11 ;INDICATE STANDARD COLOR.
JSRP AD_CRVAL ;PRINT SCREEN SHOWING THE CURRENT VALUE
JAUC SUCIDE ;OUR JOB IS DONE!...EXIT
**************************************************************************
* *
* LEFT_TO_CENTER *
* *
* THIS IS CALLED TO FIND THE CENTER POINT FOR A BOX BASED ON *
* THE LEFT PASSED IN A9. CENTER X RETURNED IN A9. *
* *
**************************************************************************
LEFT_TO_CENTER:
ADDI TIT_LRX,A9 ;FIND BOX CENTER