-
Notifications
You must be signed in to change notification settings - Fork 8
/
Bank20_playcall.asm
2624 lines (2172 loc) · 161 KB
/
Bank20_playcall.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
.BASE $8800
_F{_PLAY_CALL_SCREEN_CONSTANTS
FLASHING_YARDLINE_SPR_Y = SPRITE_START + $08
FLASHING_YARDLINE_SPR_TILE = SPRITE_START + $09
FLASHING_YARDLINE_SPR_ATTR = SPRITE_START + $0A
FLASHING_YARDLINE_SPR_X = SPRITE_START + $0B
YARDLINE_SPR_Y_LOCATION = $D4
COM_OFFENSE_CLEAR_MENU_DELAY = $3C
COM_PLAY_SELECT_DELAY = $1E
OFFSET_TO_SPECIAL_TEAMS_MENU_OPTION = $06
TIMEOUT_MENU_AUTO_CLEAR_DELAY = $78
CANCEL_MENU_OPTION = $00
TIMEOUT_MENU_OPTION = $01
SELECT_TEXT_ROWS = $01
SELECT_TEXT_LENGTH = $06
READY_TEXT_ROWS = $01
READY_TEXT_LENGTH = $07
OFFENSE_MENU_LENGTH = $0E
OFFENSE_MENU_HEIGHT = $0C
DEFENSE_MENU_LENGTH = $0C
DEFENSE_MENU_HEIGHT = $08 ; A little extra
OFF_TIMEOUT_MENU_LENGTH = $0D
OFF_TIMEOUT_MENU_HEIGHT = $07
DEF_TIMEOUT_MENU_LENGTH = $0C
DEF_TIMEOUT_MENU_HEIGHT = $07
PLAY_CALL_STATUS_BAR_PPU_HEIGHT = $80
_F}_PLAY_CALL_SCREEN_CONSTANTS
BANK_JUMP_START_PLAY_SELECT:
JMP START_PLAY_SELECT ; START PLAY SELECT
BANK_JUMP_DRAW_PLAYBOOK:
JMP DRAW_PLAYBOOK ; DRAW PLAYBOOK ()
BANK_JUMP_DO_PLAY_CHANGE_IN_TEAM_DATA
JMP DO_PLAY_CHANGE_IN_TEAM_DATA ; DRAW SCROLLING PLAY WINDOW FOR TEAM DATA PLAY CHANGE()
BANK_JUMP_DRAW_INITIAL_PLAY_NAME_PLAY_CHANGE:
JMP DRAW_INITIAL_PLAY_NAME_PLAY_CHANGE ; DRAW NAME FOR INITIAL PLAY TO CHANGE ON TEAM DATA
BANK_JUMP_DRAW_CURRENT_PLAY_NAME_PLAY_CHANGE:
JMP DRAW_CURRENT_PLAY_NAME_PLAY_CHANGE ; MOVE TO NEXT PLAY IN SCROLLING WINDOW
JMP GET_OFFENSIVE_STYLES_AND_RUNNERS ; SKP MODE()
;*** can remove references later once
CHANGE_PLAYERS = $8009
_F{_INIT_PLAY_CALL_SCREEN
START_PLAY_SELECT:
SET_CLOCK_TO_PLAY_SELECT ; SLOWS DOWN CLOCK SPEED
@wait_irq_ppu_clear: ; MAKE SURE INTERRUPT REQUEST IS CLEAR LOOP
LDA CURR_IRQ_PPU_ADDR ; WAIT FOR PPU ADDR TO BE CLEARED
BEQ DRAW_PLAY_SELECT_SCREEN_START ;
RETURN_1_FRAME
JMP @wait_irq_ppu_clear ; LOOP BACK TO MAKE SURE INTERRUPT REQUEST IS CLEAR LOOP
DRAW_PLAY_SELECT_SCREEN_START: ; START OF PLAY SELECT DRAWING
JSR CLEAR_BOTH_SCREENS_EXCEPT_STATUS_BAR ; CLEAR PLAY GRAFX, NAMETABLE1, SPRITES (2080,2400 ADDRESS START
JSR CLEAR_TEAM_NAMES_AND_SELECT_READY_AREA ; CLEAR PPU MEMORY TEAM NAMES,SELECT/READY()
LDY #<PLAY_SELECT_SCREEN_IRQ_INFO ; something with IRQ SCREEN SPLIT
LDX #>PLAY_SELECT_SCREEN_IRQ_INFO ;
JSR LOAD_IRQ_SPLIT_DATA ; DRAW PLAY SELECT
LDA #PLAY_SELECT_SCREEN_ID ; LOAD PLAY CALL BACKGROUND EVENT
LDX #MENU_DRAW_SCRIPT_BANK ; BANK16
JSR DRAW_SCENE_RETURN_PREV_8000_BANK ; DRAW BACKGROUND()
LDA #REDRAW_CLOCK_SCORE_BANNER_ID ; LOAD TEAM AND TIME BANNER INDEX
JSR DO_BANNER_ONCE_PREVIOUS_COMPLETE ; WAIT TO LOAD BANNER SCENE UNTIL NONE PLAYING(A=BANNER)
@draw_p1_team_name:
LDY #<P1_TEAM_NAME_SELECT_READY_PPU_ADDR ; SET PLAYER 1 TEAM NAME PPU ADDRESS
LDX #>P1_TEAM_NAME_SELECT_READY_PPU_ADDR ;
LDA P1_TEAM ; LOAD P1 TEAM
CLC ;
ADC #OFFSET_TO_TEAM_MASCOT_POINTERS ;
JSR DRAW_TEAM_NAME_CITY_CONF_TEXT ; DRAW PLAYER 1 TEAM NAME()
@draw_p2_team_name:
LDY #<P2_TEAM_NAME_SELECT_READY_PPU_ADDR ; SET PLAYER 2 TEAM NAME PPU ADDRESS
LDX #>P2_TEAM_NAME_SELECT_READY_PPU_ADDR ;
LDA P2_TEAM ; LOAD P2 TEAM
CLC ;
ADC #OFFSET_TO_TEAM_MASCOT_POINTERS ;
JSR DRAW_TEAM_NAME_CITY_CONF_TEXT ; DRAW PLAYER 2 TEAM NAME()
RETURN_1_FRAME
JSR DRAW_PLAYBOOK ; DRAW PLAYBOOK()
temp_los_x = LOCAL_8
@set_yardline_sprite_on_mini_field:
LDA #SPRITE_OFFSCREEN ; SET FLASHING YARDLINE SPRITE(Y) to OFFSCREEN
STA FLASHING_YARDLINE_SPR_Y ;
LDA #$00 ; SET FLASHING YARDLINE TILE to ARROW
STA FLASHING_YARDLINE_SPR_TILE ;
LDA POSSESSION_STATUS ; LOAD POSSESSION STATUS SET FLASHING YARDLINE MIRRORING
AND #$80 ;
LSR ;
STA FLASHING_YARDLINE_SPR_ATTR ;
; SET FLASHING YARDLINE SPRITE(X) location
LDA LOS_X+1 ; CONVERT LOS FILED LOCATION TO PPU ADDR
STA temp_los_x ;
LDA LOS_X ;
LSR temp_los_x ;
ROR ;
LSR temp_los_x ;
ROR ;
LSR temp_los_x ;
ROR ;
SEC ;
SBC #$7E ;
BIT POSSESSION_STATUS ; LOAD POSSESSION STATUS
BPL @save_los_spr_x_loc ;
CLC ;
ADC #$05 ; MOVE FLASHING YARDLINE SPRITE(X) towars P2 side so it lines up right mirrored
@save_los_spr_x_loc:
STA FLASHING_YARDLINE_SPR_X ; SAVE FLASHING YARDLINE SPRITE(X) location
LDA SOFT_PPU_CTRL ; MAKE SURE BACKGROUND PATTERN TABLE ADDRESS is $0000
AND #%11011111 ;
STA SOFT_PPU_CTRL ;
LDA #PLAY_CALL_SPRITES_CHR_BANK ; SET FIRST PPU CHR BANK TO 15
STA SOFT_CHR_1000_BANK ;
RETURN_IN_NUM_FRAMES 2
@set_and_fade_in_palletes:
LDA #PLAY_CALL_SCREEN_BG_PAL_INDEX ; SET BACK GROUND PALLETE
LDX #PLAY_CALL_SCREEN_SPR_PAL_INDEX ; SET SPR PALLETE
JSR SET_AND_FADE_IN_BG_SPR_PAL ; PALETTE_FADE_IN()
@clear_play_call
LDA #$80 ; LOAD PLAY CALL NOT CHOSEN VALUE
STA P1_PLAY_CALL ; CLEAR P1 PLAY CALL
STA P2_PLAY_CALL ; CLEAR P2 PLAY CALL
LDA #PLAY_CALL_SCREEN_BANK ; SET TASK 5 A000 BANK TO BANK 19
STA READY_SELECT_YARDLINE_TASK + TASK_BANK_A000 ;
LDY #<(UPDATE_SELECT_READY_YARDLINE-1) ; LOAD SELECT/READY INPUT CHECK ADDRESS
LDA #>(UPDATE_SELECT_READY_YARDLINE-1) ;
LDX #READY_SELECT_YARDLINE_TASK ; LOAD TASK 5 INDEX
JSR CREATE_TASK ; CREATE TASK(Y,A= ADDRESS, X= TASK INDEX)
LDA POSSESSION_STATUS ; LOAD POSSESSION STATUS
BPL @p1_on_offense_create_task ; DOES P1 HAVE BALL? YES-> BRANCH to PLAYER 1 OFFENSE create task
@p2_on_offense_create_task:
LDA #PLAY_CALL_SCREEN_BANK ; SET TASK 2 A000 BANK
STA DEFENSE_PLAYCALL_TASK + TASK_BANK_A000 ;
LDY #<(P1_ON_D_PLAYCALL_START-1) ; LOAD P1 DEFENSE THREAD ADDRESS
LDA #>(P1_ON_D_PLAYCALL_START-1) ;
LDX #DEFENSE_PLAYCALL_TASK ; LOAD TASK 2 INDEX
JSR CREATE_TASK ; CREATE TASK(Y,A= ADDRESS, X= TASK INDEX)
JMP P2_ON_OFFENSE_PLAY_SELECT_START ; JUMP to PLAYER 2 OFFENSE START
@p1_on_offense_create_task: ; PLAYER 1 OFFENSE START
LDA #PLAY_CALL_SCREEN_BANK ; SET TASK 2 A000 BANK T
STA DEFENSE_PLAYCALL_TASK + TASK_BANK_A000 ;
LDY #<(P2_ON_DEFENSE_PLAYCALL_START-1) ; LOAD P2 DEFENSE THREAD ADDRESS
LDA #>(P2_ON_DEFENSE_PLAYCALL_START-1) ;
LDX #DEFENSE_PLAYCALL_TASK ; LOAD TASK 2 INDEX
JSR CREATE_TASK ; CREATE TASK(Y,A= ADDRESS, X= TASK INDEX)
_F}_INIT_PLAY_CALL_SCREEN
_F{_P1_ON_OFFENSE_PLAYCALL
P1_ON_OFFENSE_START:
LDA TEAM_CONTROL_TYPES ; LOAD PLAYER TYPES
AND #$E0 ; IS P1 COM?
BNE P1_COM_ON_OFFENSE_START ; YES-> BRANCH TO P1 COM OFFENSE START
@check_for_4th_down_bring_up_menu
LDA DOWN ; IS DOWN 4th DOWN?
CMP #FOURTH_DOWN ;
BCC P1_MAN_OFFENSE_START ; NO->BRANCH TO P1 MAN OFFENSE START
JMP P1_OFFENSIVE_MENU_START
P1_MAN_OFFENSE_START: ; P1 MAN OFFENSE START
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER IF OVER DO FADE OUT AND SCOREBOARD AND RETURN()
JSR GET_P1_CONTROLLER_INPUT_PLAY_SELECT ; GET P1 CONTROLLER INPUT()
BCC @no_direction_pressed ; A or B PRESSED WITH DIRECTION? NO-> P1 NO DIRECTION PRESSED
JMP P1_OFFENSE_SAVE_PLAY_CALL ; YES->JUMP to P1 OFFENSE STORE PLAY CALL
@no_direction_pressed: ; P1 NO DIRECTION PRESSED
BVS P1_MAN_OFFENSE_START ;
LDA JOY_PRESS_1 ; LOAD P1 JOYPAD PRESS
BPL P1_MAN_OFFENSE_START ; B button pressed? YES-> LOOP BACK TO P1 MAN OFFENSE START
JMP P1_OFFENSIVE_MENU_START ; "A" button pressed JUMP TO go to P1 OFFENSE MENU START
play_call_temp = LOCAL_3
P1_COM_ON_OFFENSE_START: ; P1 COM OFFENSE START
JSR P1_ON_OFF_SET_VALUE_FOR_CPU_PLAY_CALL_LOGIC
LDA play_call_temp ; SAVE PLAY VALUE
@check_for_P1_com_take_timeout:
STA CPU_P1_PLAY_CALL ;
LDA CPU_OFF_TIMEOUTS ; NEW NUMBER OF TIMEOUTS = OLD NUMBER OF TIMEOUTS?
CMP P1_TIMEOUTS ;
BEQ CHECK_P1_COM_OFF_PLAYCALL ; YES-> BRANCH TO P1 CHECK COM PLAY CALL
@do_p1_com_offense_menu
JSR DRAW_P1_OFFENSIVE_MENU ; DRAW P1 OFFENSIVE MENU()
LDA #TIMEOUT_MENU_OPTION ; LOAD TIME OUT OPTION
JSR DO_P1_COM_SELECT_MENU_OPTION ; P1 COM SELECTS MENU OPTION (A= CHOICE)
JSR DO_P1_TIMEOUT ; BRING UP P1 TIME OUT SUB MENU()
LDA #SPRITE_OFFSCREEN ; SET MENU ARROW (Y) TO OFFSCREEN
STA MENU_ARROW_SPR_Y ;
LDX #COM_OFFENSE_CLEAR_MENU_DELAY ; LOAD DELAY TIME
_WHILE NOT_EQUAL
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER, IF OVER DO FADE OUT AND SCOREBOARD AND RETURN()
DEX ; DECREASE TIMER
_END_WHILE
JSR RESTORE_SCREEN_COVERED_BY_P1_TIMEOUT ; CLEAR P1 TIME OUT SUB MENU PPU()
RETURN_IN_NUM_FRAMES 8
JSR RESTORE_SCREEN_COVERED_BY_P1_MENU ; RESTORE SCREEN COVERED BY MENU
RETURN_IN_NUM_FRAMES 8
CHECK_P1_COM_OFF_PLAYCALL: ; P1 CHECK COM PLAY CALL
LDA CPU_P1_PLAY_CALL ; LOAD COM PLAY CALL
CMP #PUNT_PLAY_CALL_ID ; IS PLAY FG or PUNT
BCC @do_p1_com_off_regular_play_call ; NO->
@do_P1_com_off_fg_punt_playcall:
JSR DRAW_P1_OFFENSIVE_MENU ; DRAW P1 OFFENSIVE MENU()
LDA CPU_P1_PLAY_CALL ; LOAD COM PLAY CALL
SEC ; SET INDEX FOR COM SPECIAL TEAMS SELECTION
SBC #OFFSET_TO_SPECIAL_TEAMS_MENU_OPTION ;
JSR DO_P1_COM_SELECT_MENU_OPTION ; P1 COM SELECTS MENU OPTION (A= CHOICE)
LDX #COM_PLAY_SELECT_DELAY ; LOAD SPECIAL TEAMS MENU TIMER VALUE
_WHILE NOT_EQUAL ; P1 COM SPECIAL TEAMS MENU WAIT LOOP
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER, IF OVER DO FADE OUT AND SCOREBOARD AND RETURN()
DEX ; IS SPECIAL TEAMS MENU TIMER DONE?
_END_WHILE
JSR END_OFF_AND_DRAW_TASK_AFTER_PPU_TRANS_DONE
LDA CPU_P1_PLAY_CALL ; LOAD COM PLAY CALL
JMP P1_OFFENSE_CHOOSES_SPECIAL_TEAMS_PLAY ; JUMP TO P1 OR COM PICKS FG/PUNT
@do_p1_com_off_regular_play_call: ; SET P1 COM REGULAR PLAY DELAY
LDA RANDOM_1 ; MAKE DELAY 30-37 FRAMES
AND #$07 ;
CLC ;
ADC #COM_PLAY_SELECT_DELAY ;
TAX ;
_WHILE NOT_EQUAL ; P1 COM PICKS PLAY LOOP
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER, IF OVER DO FADE OUT AND SCOREBOARD AND RETURN()
DEX ; IS COM REGULAR PLAY TIMER DONE?
_END_WHILE
LDA CPU_P1_PLAY_CALL ; LOAD COM PLAY CALL
JMP P1_OFFENSE_SAVE_PLAY_CALL ; JUMP TO P1 SAVE PLAY CALL
P1_OFFENSIVE_MENU_START: ; P1 OFFENSE MENU START
JSR DRAW_P1_OFFENSIVE_MENU ; DRAW P1 OFFESIVE MENU()
SET_P1_OFF_MENU_TO_FIRST_OPTION: ; P1 SET OFFENSE MENU ARROW TO FIRST SPOT
LDA #CANCEL_MENU_OPTION ; SET MENU INDEX TO FIRST OPTION
STA MENU_INDEX ;
LDY #<P1_OFFENSE_MENU_INFO ; LOAD OFFENSIVE MENU INFO ADDRESS
LDX #>P1_OFFENSE_MENU_INFO ;
LDA #P1_SIDE_ID ;
JSR SET_MENU_ARROW_OPTIONS ; INITIALIZE MENU OPTIONS(X,Y= ADDRESS, A= PLAYER JOY)
_WHILE VALUE_CLEAR ; P1 ON OFFENSE MENU LOOP
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER,IF OVER DO FADE OUT AND SCOREBOARD() and return
JSR CHECK_MENU_ARROW_UP_DOWN ; CHECK FOR CURSOR MOVED UP OR DOWN()
JSR UPDATE_MENU_ARROW_SPR_Y ; SET ARROW NEW Y COORDINATE()
BIT JOY_PRESS_1 ;
BMI @do_menu_choice ; WAS "A" pressed?
_END_WHILE
LDA #CANCEL_MENU_OPTION ; if "B" pressed SET MENU INDEX to CANCEL
STA MENU_INDEX ;
@do_menu_choice:
RTS_JUMP_TABLE[memVal_tableAddr] MENU_INDEX, P1_OFFENSE_MENU_COMMAND_TABLE
P1_OFFENSE_MENU_COMMAND_TABLE: ; COMMAND TABLE
.WORD P1_OFFENSE_MENU_CANCEL-1 ; CANCEL
.WORD P1_OFFENSE_MENU_TIMEOUT-1 ; TIMEOUT
.WORD P1_OFFENSE_MENU_PUNT-1 ; PUNT
.WORD P1_OFFENSE_MENU_FG-1 ; FG
.WORD P1_OFFENSE_MENU_CHANGE_PLAYERS-1 ; PLAYER CHANGE
P1_OFFENSE_MENU_CANCEL: ; P1 CANCEL
JSR RESTORE_SCREEN_COVERED_BY_P1_MENU ; RESTORE SCREEN COVERED BY MENU
JMP P1_MAN_OFFENSE_START ; return to play call loop
P1_OFFENSE_MENU_TIMEOUT: ; P1 TIMEOUT
LDA P1_TIMEOUTS ; LOAD P1 TIMEOUTS
BEQ SET_P1_OFF_MENU_TO_FIRST_OPTION ; NO timeouts left BRANCH TO P1 SET OFF MENU ARROW TO FIRST SPOT
LDA CLOCK_RUN_TYPE ; LOAD CLOCK STATUS
BPL SET_P1_OFF_MENU_TO_FIRST_OPTION ; IF CLOCK NOT RUNNING JUMP TO P1 SET OFF MENU ARROW TO FIRST SPOT
JSR DO_P1_TIMEOUT ; BRING UP P1 TIME OUT SUB MENU()
LDX #TIMEOUT_MENU_AUTO_CLEAR_DELAY ; LOAD MENU CLEAR DELAY
_WHILE NOT_EQUAL ;
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER...IF OVER DO FADE OUT AND SCOREBOARD AND RETURN
LDA JOY_PRESS_1 ; LOAD P1 BUTTON PRESS
AND #(A_BUTTON + B_BUTTON ) ; IS "A" or "B"?
BNE @clear_p1_off_timout_menu ; YES->pressed clear timeout sub menu and exit to offense menu
DEX ; else loop until delay is done
_END_WHILE
@clear_p1_off_timout_menu: ; CLEAR TIMEOUT SUB MENU and JUMP TO P1 SET OFF MENU ARROW TO FIRST SPOT
JSR RESTORE_SCREEN_COVERED_BY_P1_TIMEOUT ; CLEAR P1 TIME OUT SUB MENU PPU()
JMP SET_P1_OFF_MENU_TO_FIRST_OPTION ; JUMP to P1 SET OFFENSE MENU ARROW TO FIRST SPOT
P1_OFFENSE_MENU_PUNT: ;
LDA #PUNT_PLAY_CALL_ID ; LOAD PUNT PLAY CODE
JMP P1_OFFENSE_CHOOSES_SPECIAL_TEAMS_PLAY ; go to P1 OR COM PICKS FG/PUNT
P1_OFFENSE_MENU_FG:
LDA #FG_PLAY_CALL_ID ; LOAD FG PLAY CODE
JMP P1_OFFENSE_CHOOSES_SPECIAL_TEAMS_PLAY ; go to P1 OR COM PICKS FG/PUNT
P1_OFFENSE_MENU_CHANGE_PLAYERS: ; P1 CHANGE PLAYERS
JSR END_OFF_AND_DRAW_TASK_AFTER_PPU_TRANS_DONE
LDA P1_TEAM ; LOAD PLAYER 1 TEAM
STA CURRENT_TEAM ; SAVE in CURRENT TEAM
SUSPEND_TASK_DIRECT[task] UPDATE_CLOCK_TASK
LDA #$00 ; SET SUB CONTROL IS MAN
STA SUB_CONTROL_TYPE ;
LDA #MAIN_GAME_BANK_1 ; BANK17
LDY #<CHANGE_PLAYERS ; LOAD CHANGE PLAYERS ADDRESS
LDX #>CHANGE_PLAYERS ;
JSR SWAP_8000_BANK_AND_JUMP_RETURN ; bank_swap_8000_jump
LDX #UPDATE_CLOCK_TASK ; LOAD TASK 0
JSR RESUME_TASK ; RESUME TASK (X=TASK)
JSR SET_BG_SPR_FULLY_FADED_OUT ; PALETTE_FADE_OUT()
JMP BANK_JUMP_START_PLAY_SELECT ; JUMP TO MAIN LOOP TO REDRAW() *** jumps to a jump could fix
data_addr = LOCAL_1
P1_OFFENSE_SAVE_PLAY_CALL: ; P1 OFFENSE SAVE PLAY CALL
STA P1_PLAY_CALL ; SAVE P1 PLAY CALL
PLAY_SOUND_ID PLAY_SELECTED_SOUND
LDY #<P1_READY_SELECT_TEXT_PPU_ADDR ; LOAD PPU ADDRESS FOR P1 READY
LDX #>P1_READY_SELECT_TEXT_PPU_ADDR ;
LDA #<READY_TEXT_INFO ; LOAD READY DATA AND CONTROL INFO ADDRESS
STA data_addr ;
LDA #>READY_TEXT_INFO ;
STA data_addr+1 ;
JSR TRANSFER_TO_PPU_OR_PPUBUFF_WITH_COMMANDS ; UPDATE PPU(3E,3F= DATA ADDRESS X,Y= PPU ADDRESS)
SET_CLOCK_TO_STOPPED
_WHILE MINUS ; P1 PICKED PLAY WAIT FOR P2 PLAY
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER...IF OVER DO FADE OUT AND SCOREBOARD AND RETURN
LDA P2_PLAY_CALL ; LOAD P2 PLAY
_END_WHILE ; PLAY PICKED? NO-> LOOP BACK TO P1 PICKED PLAY WAIT FOR P2 PLAY
LDX #READY_SELECT_YARDLINE_TASK ; LOAD TASK 5 INDEX
JSR END_TASK_CHECK_TASK_NOTHING_IN_BUFFERS ; SET TASK TO TERMINATED(X=TASK)
RETURN_IN_NUM_FRAMES 60
JSR FADE_OUT_BG_SPR_PAL ; FADE PALLETE()
LDA #SPRITE_OFFSCREEN ; SET FLASHING YARDLINE SPRITE(Y) to offscreen
STA FLASHING_YARDLINE_SPR_Y ;
JMP CLEAR_TEAM_NAMES_AND_SELECT_READY_AREA ; CLEAR PPU MEMORY TEAM NAMES,SELECT/READY()
P1_OFFENSE_CHOOSES_SPECIAL_TEAMS_PLAY: ; P1 OR COM PICKS FG/PUNT
STA P1_PLAY_CALL ; SAVE P1 PLAY CALL
JSR END_OFF_AND_DRAW_TASK_AFTER_PPU_TRANS_DONE ; CHECK FOR PPU TRANSFER DONE THEN KILL TASK 2, TASK5 ()
LDY #<P1_READY_SELECT_TEXT_PPU_ADDR ; LOAD PPU ADDRESS FOR P1 READY
LDX #>P1_READY_SELECT_TEXT_PPU_ADDR ;
LDA #<READY_TEXT_INFO ; LOAD READY DATA AND CONTROL INFO ADDRESS
STA data_addr ;
LDA #>READY_TEXT_INFO ;
STA data_addr+1 ;
JSR TRANSFER_TO_PPU_OR_PPUBUFF_WITH_COMMANDS ; UPDATE PPU(3E,3F= DATA ADDRESS X,Y= PPU ADDRESS)
PLAY_SOUND_ID PLAY_SELECTED_SOUND
SET_CLOCK_TO_STOPPED
num_tiles = LOCAL_1
lines = LOCAL_2
@clear_p2_slect_ready_after_p1_picks_st ; CLEAR P2 READY PPU
LDY #<P2_READY_SELECT_TEXT_PPU_ADDR ; LOAD PPU ADDRESS FOR P2 READY
LDX #>P2_READY_SELECT_TEXT_PPU_ADDR ;
LDA #$01 ; LOAD # LINES
STA lines ;
LDA #READY_TEXT_LENGTH ; LOAD LENGTH
STA num_tiles ;
JSR FILL_SCREEN_BLANK_TILE_AREA ; CLEAR PPU(X,Y= ADDR, 3F= NUM lines, 3E= length)
RETURN_IN_NUM_FRAMES 60
JSR FADE_OUT_BG_SPR_PAL ; FADE PALLETE
LDA #SPRITE_OFFSCREEN ; SET FLASHING YARDLINE SPRITE(Y) to OFFSCREEN
STA FLASHING_YARDLINE_SPR_Y ;
JMP CLEAR_TEAM_NAMES_AND_SELECT_READY_AREA ; CLEAR PPU MEMORY TEAM NAMES,SELECT/READY()
_F}_P1_ON_OFFENSE_PLAYCALL
_F{_P1_ON_DEFENSE_PLAYCALL
P1_ON_D_PLAYCALL_START: ; PLAYER 1 DEFENSE START
LDX #PLAYCALL_DEFENSE_STACK_INDEX ; SET STACK LOCATION
TXS ;
LDA TEAM_CONTROL_TYPES ; IS PLAYER 1 COM?
AND #$E0 ;
BNE P1_COM_ON_DEFENSE_START ; YES-> BRANCH TO PLAYER 1 COM DEFENSE MENU
P1_MAN_DEFENSE_INPUT_CHECK: ; PLAYER 1 DEFENSE INPUT CHECK
RETURN_1_FRAME
JSR GET_P1_CONTROLLER_INPUT_PLAY_SELECT ; GET PLAYER 1 BUTTON INPUT()
BCC @no_direction_pressed ;
JMP P1_DEFENSE_SAVE_PLAY_CALL ; PLAY PICKED? YES-> JUMP TO P1 DEFENSE PLAY PICKED
@no_direction_pressed:
BVS P1_MAN_DEFENSE_INPUT_CHECK ; ONLY B PRESSED?-> LOOP BACK TO PLAYER 1 DEFENSE INPUT CHECK
LDA JOY_PRESS_1 ;
BPL P1_MAN_DEFENSE_INPUT_CHECK ; DIRECTION ONLY-> LOOP BACK TO PLAYER 1 DEFENSE INPUT CHECK
JMP DO_P1_DEFENSIVE_MENU ; ONLY A PRESSED-> JUMP TO BRING UP P1 DEFENSIVE MENU
temp_play_call = LOCAL_3
P1_COM_ON_DEFENSE_START: ; PLAYER 1 IS COM DEFENSE START
JSR P1_ON_DEF_SET_VALUE_FOR_CPU_PLAY_CALL_LOGIC ; P1 ON D LOAD VALUES(DOWN, YDLN, & DO COM PLAY LOGIC)
LDA temp_play_call ; LOAD COM PLAY CALL
STA CPU_P1_PLAY_CALL ; SAVE IN $8E
LDA CPU_OFF_TIMEOUTS ; NEW TIMEOUTS LEFT = OLD TIMEOUTS LEFT?
CMP P1_TIMEOUTS ;
BEQ @p1_com_picks_play ; YES-> BRANCH TO P1 COM D PICKS PLAY
@p1_com_defense_takes_timeout:
JSR DRAW_P1_DEFENSE_MENU ; DRAW P1 DEFENSE MENU()
LDA #TIMEOUT_MENU_OPTION ;
JSR DO_P1_COM_SELECT_MENU_OPTION ; P1 COM SELECTS MENU OPTION (A= CHOICE)
JSR DO_P1_DEF_TIMEOUT ; USE TIMEOUT ROUTINE()
LDA #SPRITE_OFFSCREEN ; SET MENU ARROW (Y) TO OFFSCREEN
STA MENU_ARROW_SPR_Y ;
RETURN_IN_NUM_FRAMES 120
JSR RESTORE_SCREEN_COVERED_BY_P1_TIMEOUT ; CLEAR P1 TIME OUT SUB MENU PPU()
RETURN_IN_NUM_FRAMES 8
JSR RESTORE_SCREEN_COVERED_BY_P1_MENU ; RESTORE SCREEN COVERED BY MENU
RETURN_IN_NUM_FRAMES 8
@p1_com_picks_play: ; P1 COM D PICKS PLAY
LDA RANDOM_1 ; MAKE TIME 30-37 FRAMES
AND #$07 ;
CLC ;
ADC #COM_PLAY_SELECT_DELAY ;
JSR DELAY_TASK ; SWITCH TASKS( A= # FRAMES BEFORE RETURNING
LDA CPU_P1_PLAY_CALL ; LOAD COM PLAY CALL
JMP P1_DEFENSE_SAVE_PLAY_CALL
DO_P1_DEFENSIVE_MENU: ; BRING UP P1 DEFENSIVE MENU
JSR DRAW_P1_DEFENSE_MENU ; DRAW P1 DEFENSE MENU()
P1_DEFENSE_SET_MENU_TO_FIRST_OPTION: ; P1 DEFENSE MENU SET ARROW TO FIRST OPTION
LDA #CANCEL_MENU_OPTION ; SET ARROW TO FIRST OPTION
STA MENU_INDEX ;
LDY #<P1_DEFENSE_MENU_INFO ; LOAD P1 DEFENSE OPTION MENU TABLE ADDRESS
LDX #>P1_DEFENSE_MENU_INFO ;
LDA #P1_SIDE_ID ; SET PLAYER JOY TO P1
JSR SET_MENU_ARROW_OPTIONS ; INITIALIZE MENU OPTIONS(X,Y= ADDRESS, A= PLAYER JOY)
_WHILE VALUE_CLEAR: ; P1 DEFENSE MENU INPUT LOOP
RETURN_1_FRAME
JSR CHECK_MENU_ARROW_UP_DOWN ; CHECK FOR ARROW MOVED UP OR DOWN()
JSR UPDATE_MENU_ARROW_SPR_Y ; SET ARROW NEW Y COORDINATE()
BIT JOY_PRESS_1 ;
BMI @do_p1_def_menu_choice ; A PRESSED? YES->BRANCH TO DO P1 DEFENSE MENU OPTION SELECTED
_END_WHILE ; B PRESSED? NO-> LOOP BACK TO P1 DEFENSE MENU INPUT LOOP
LDA #CANCEL_MENU_OPTION ; YES->SET OPTION TO CANCEL
STA MENU_INDEX
@do_p1_def_menu_choice: ; P1 DEFENSE MENU OPTION SELECTED
RTS_JUMP_TABLE[memVal_tableAddr] MENU_INDEX, P1_DEFENSE_MENU_COMMAND_TABLE
P1_DEFENSE_MENU_COMMAND_TABLE: ; P1 DEFENSIVE MENU OPTIONS TABLE
.WORD P1_DEFENSE_CANCEL-1 ; CANCEL
.WORD P1_DEFENSE_TIMEOUT-1 ; TIMEOUT
P1_DEFENSE_CANCEL: ; P1 DEFENSE CANCEL
JSR RESTORE_SCREEN_COVERED_BY_P1_MENU ; RESTORE SCREEN COVERED BY MENU
JMP P1_ON_D_PLAYCALL_START ; JUMP TO PLAYER 1 DEFENSE START
P1_DEFENSE_TIMEOUT: ; P1 DEF TIMEOUT
LDA P1_TIMEOUTS ; LOAD P1 TIMEOUTS
BEQ P1_DEFENSE_SET_MENU_TO_FIRST_OPTION ; ANY LEFT? NO-> LOOP BACK TO P1 DEFENSE SET ARROW TO FIRST OPTION
LDA CLOCK_RUN_TYPE ; LOAD CLOCK STATUS
BPL P1_DEFENSE_SET_MENU_TO_FIRST_OPTION ; IS IT STOPPED? YES-> LOOP BACK TO P1 DEFENSE SET ARROW TO FIRST OPTION
JSR DO_P1_DEF_TIMEOUT ; USE P1 TIMEOUT ROUTINE()
LDX #TIMEOUT_MENU_AUTO_CLEAR_DELAY ; LOAD SUBMENU DELAY
_WHILE NOT_EQUAL ; P1 CLEAR DEFENSIVE TIMEOUT WAIT
RETURN_1_FRAME
LDA JOY_PRESS_1 ; LOAD P1 BUTTON PRESS
AND #(A_BUTTON + B_BUTTON ) ; IS "A" or "B"?
BNE @clear_p1_defense_timeout_menu ; YES->
DEX ; DECREASE TIMER
_END_WHILE ; TIMER DONE? NO-> LOOP BACK TO P1 CLEAR DEFENSIVE TIMEOUT WAIT
@clear_p1_defense_timeout_menu: ; P1 CLEAR DEFENSIVE TIMEOUT SUBMENU
JSR RESTORE_SCREEN_COVERED_BY_P1_TIMEOUT ; CLEAR P1 TIME OUT SUB MENU PPU()
JMP P1_DEFENSE_SET_MENU_TO_FIRST_OPTION ; JUMP TO P1 DEFENSE MENU SET ARROW TO FIRST OPTION
LDA #CANCEL_MENU_OPTION ; *** CODE NOT NEEDED PERFORMED BY ROUTINE ABOVE
STA MENU_INDEX ;
JSR WAIT_UNTIL_PPU_NOT_BUSY_SUSPEND_OPP_INPUT_TASK
LDY #<$2164 ;
LDX #>$2164 ;
LDA #<$6103 ;
STA $3E ;
LDA #>$6103 ;
STA $3F ;
JSR TRANSFER_TO_PPU_OR_PPUBUFF_WITH_COMMANDS ; UPDATE PPU(3E,3F= DATA ADDRESS X,Y= PPU ADDRESS)
LDX #READY_SELECT_YARDLINE_TASK ; LOAD TASK 5 INDEX
JSR RESUME_TASK ; RESUME TASK(X=TASK)
JMP P1_DEFENSE_SET_MENU_TO_FIRST_OPTION
data_addr = LOCAL_1
P1_DEFENSE_SAVE_PLAY_CALL: ; P1 DEFENSE PLAY PICKED
STA P1_PLAY_CALL ; SAVE PLAY CALL
PLAY_SOUND_ID PLAY_SELECTED_SOUND
LDY #<P1_READY_SELECT_TEXT_PPU_ADDR ; LOAD PPU ADDRESS FOR P1 READY
LDX #>P1_READY_SELECT_TEXT_PPU_ADDR ;
LDA #<READY_TEXT_INFO ; LOAD READY DATA AND CONTROL INFO ADDRESS
STA data_addr ;
LDA #>READY_TEXT_INFO ;
STA data_addr +1 ;
JSR TRANSFER_TO_PPU_OR_PPUBUFF_WITH_COMMANDS ; UPDATE PPU (Y,X= PPU ADDR, 3E,3F DATA AND CONTROL ADDRESS)
JMP END_CURRENT_TASK ; END CURRENT TASK()
_F}_P1_ON_DEFENSE_PLAYCALL
_F{_P2_ON_OFFENSE_PLAYCALL
P2_ON_OFFENSE_PLAY_SELECT_START: ; PLAYER 2 OFFENSE START
LDA TEAM_CONTROL_TYPES ; LOAD PLAYER TYPES
AND #$0E ; IS P1 COM?
BNE P2_COM_ON_OFFENSE_START ; YES-> BRANCH TO P2 COM OFFENSE START
@check_for_4th_down_bring_up_menu
LDA DOWN ; IS DOWN 4th DOWN?
CMP #FOURTH_DOWN ;
BCC P2_MAN_OFFENSE_START ; NO->BRANCH TO P2 MAN OFFENSE START
JMP DO_P2_OFFENSE_MENU ;
P2_MAN_OFFENSE_START: ; P2 MAN OFFENSE START
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER IF OVER DO FADE OUT AND SCOREBOARD AND RETURN()
JSR GET_P2_CONTROLLER_INPUT_PLAY_SELECT ; GET P2 CONTROLLER INPUT()
BCC @no_direction_pressed ; A or B PRESSED WITH DIRECTION? NO->
JMP P2_OFFENSE_SAVE_PLAY_CALL ; YES->JUMP to P2 OFFENSE STORE PLAY CALL
@no_direction_pressed: ; P2 OFFENSE NO DIRECTION PRESSED
BVS P2_MAN_OFFENSE_START ; B PRESSED ONLY? LOOP BACK TO P2 MAN OFFENSE START
LDA JOY_PRESS_2 ; LOAD P2 JOYPAD PRESS
BPL P2_MAN_OFFENSE_START ; DIERECTION ONLY pressed? YES-> LOOP BACK TO P2 MAN OFFENSE START
JMP DO_P2_OFFENSE_MENU ; "A" button pressed JUMP TO go to P2 OFFENSE MENU START
play_call_temp = LOCAL_3
P2_COM_ON_OFFENSE_START: ; COM P2 OFFENSE
JSR P2_ON_OFF_SET_VALUE_FOR_CPU_PLAY_CALL_LOGIC ; LOAD VALUES(DOWN, YARDLINE, ETC FOR P2 COM LOGIC THEN DO COM PLAY LOGIC)
@check_for_P2_com_take_timeout:
LDA play_call_temp ; SAVE P2 COM P2 PLAY IN $8F
STA CPU_P2_PLAY_CALL ;
LDA CPU_OFF_TIMEOUTS ; NEW NUMBER OF TIMEOUTS = CURRENT P2 TIMEOUTS
CMP P2_TIMEOUTS ;
BEQ CHECK_P2_COM_PLAYCALL ; YES-> BRANCH TO P2 CHECK COM PLAY CALL
@do_p2_com_offense_menu
JSR DRAW_P2_OFFENSIVE_MENU ; DRAW P2 OFFENSIVE MENU()
LDA #TIMEOUT_MENU_OPTION ; LOAD TIME OUT OPTION
JSR DO_P2_COM_SELECT_MENU_OPTION ; P2 COM SELECTS MENU OPTION (A= CHOICE)
JSR DO_P2_OFF_TIMEOUT ; BRING UP P2 TIME OUT SUB MENU()
LDA #SPRITE_OFFSCREEN ; SET MENU ARROW (Y) TO OFFSCREEN
STA MENU_ARROW_SPR_Y ;
LDX #COM_OFFENSE_CLEAR_MENU_DELAY ; LOAD DELAY TIMER
_WHILE NOT_EQUAL ; DELAY LOOP START
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER IF OVER DO FADE OUT AND SCOREBOARD AND RETURN()
DEX ; DECREASE DELAY TIMER
_END_WHILE
JSR CLEAR_P2_TIME_OUT_SUB_MENU ; CLEAR P2 TIME OUT SUB MENU PPU()
RETURN_IN_NUM_FRAMES 8
JSR RESTORE_SCREEN_P2_MENU_COVERED ; CLEAR P2 MENU PPU()
RETURN_IN_NUM_FRAMES 8
CHECK_P2_COM_PLAYCALL: ; P2 CHECK COM PLAY CALL
LDA CPU_P2_PLAY_CALL ; LOAD COM P2 PLAY CALL
CMP #PUNT_PLAY_CALL_ID ; IS PLAY FG or PUNT
BCC @do_p2_com_off_regular_play_call ; NO-> BRACNH TO SET P2 COM REGULAR PLAY DELAY
@do_P2_com_off_fg_punt_playcall
JSR DRAW_P2_OFFENSIVE_MENU ; DRAW P2 OFFENSIVE MENU()
LDA CPU_P2_PLAY_CALL ; LOAD COM P2 PLAY CALL
SEC ; SET INDEX FOR COM SPECIAL TEAMS SELECTION
SBC #OFFSET_TO_SPECIAL_TEAMS_MENU_OPTION ;
JSR DO_P2_COM_SELECT_MENU_OPTION ; P2 COM SELECTS MENU OPTION (A= CHOICE)
LDX #COM_PLAY_SELECT_DELAY ; LOAD SPECIAL TEAMS MENU TIMER VALUE
_WHILE NOT_EQUAL ; P2 COM SPECIAL TEAMS MENU WAIT LOOP
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER IF OVER DO FADE OUT AND SCOREBOARD AND RETURN()
DEX ; IS SPECIAL TEAMS MENU TIMER DONE?
_END_WHILE ; NO->LOOP BACK TO P2 COM SPECIAL TEAMS MENU WAIT LOOP
JSR END_OFF_AND_DRAW_TASK_AFTER_PPU_TRANS_DONE ; CHECK FOR PPU TRANSFER DONE THEN KILL TASK 2, TASK5 ()
LDA CPU_P2_PLAY_CALL ; LOAD COM P2 PLAY CALL
JMP P2_OFFENSE_CHOOSES_SPECIAL_TEAMS_PLAY ; JUMP TO P2 OR COM PICKS FG/PUNT
@do_p2_com_off_regular_play_call ; SET P2 COM REGULAR PLAY DELAY
LDA RANDOM_2 ; MAKE COM REGULAR PLAY TIMER 30-37 FRAMES
AND #$07 ;
CLC ;
ADC #COM_PLAY_SELECT_DELAY ;
TAX ;
_WHILE NOT_EQUAL ; P2 COM PICKS PLAY LOOP
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER IF OVER DO FADE OUT AND SCOREBOARD AND RETURN()
DEX ; IS COM REGULAR PLAY TIMER DONE?
_END_WHILE ; NO->LOOP BACK TO P2 COM PICKS PLAY LOOP
LDA CPU_P2_PLAY_CALL ; LOAD COM P2 PLAY CALL
JMP P2_OFFENSE_SAVE_PLAY_CALL ; JUMP TO P2 SAVE PLAY CALL
DO_P2_OFFENSE_MENU: ; P2 OFFENSE MENU START
JSR DRAW_P2_OFFENSIVE_MENU ; DRAW P2 OFFENSIVE MENU()
SET_P2_OFFENSE_MENU_FIRST_OPTION: ; P2 SET OFF MENU ARROW TO FIRST SPOT
JSR SET_SPR_MENU_ARROW_LOC_AND_ATTR ; SET SPRITE MENU ARROW LOCATION AND ATTRIBUTE() ???
LDA #CANCEL_MENU_OPTION ; SET MENU INDEX TO FIRST OPTION
STA MENU_INDEX ;
LDY #<P2_OFFENSE_MENU_INFO ; LOAD P2 OFFENSIVE MENU INFO ADDRESS
LDX #>P2_OFFENSE_MENU_INFO ;
LDA #P2_SIDE_ID ; LOAD JOY =P2
JSR SET_MENU_ARROW_OPTIONS ; INITIALIZE MENU OPTIONS(X,Y= ADDRESS, A=PLAYER JOY)
JSR SET_SPR_MENU_ARROW_LOC_AND_ATTR_P2 ; SET MENU ARROW LOCATION AND ATTRIBUTE_2() ??
_WHILE VALUE_CLEAR ; P2 ON OFFENSE MENU LOOP
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER IF OVER DO FADE OUT AND SCOREBOARD AND RETURN()
JSR SET_SPR_MENU_ARROW_LOC_AND_ATTR ; SET MENU ARROW LOCATION AND ATTRIBUTE()
JSR CHECK_MENU_ARROW_UP_DOWN ; CHECK FOR ARROW MOVED UP OR DOWN()
JSR UPDATE_MENU_ARROW_SPR_Y ; SET ARROW NEW Y COORDINATE()
JSR SET_SPR_MENU_ARROW_LOC_AND_ATTR_P2 ; SET SPRITE MENU ARROW LOCATION AND ATTRIBUTE_2() ??
BIT JOY_PRESS_2 ; CHECK JOY2 PRESS
BMI @do_menu_choice ; WAS "A" pressed? YES-> BRANCH TO P2 OFFENSIVE MENU SELECT
_END_WHILE ; WAS "B" pressed NO->BRANCH TO P2 ON OFFENSE MENU LOOP
LDA #CANCEL_MENU_OPTION ; YES SET P2 MENU INDEX TO FIRST LOCATION
STA P2_MENU_INDEX ;
@do_menu_choice: ; P2 OFFENSIVE MENU SELECT
RTS_JUMP_TABLE[memVal_tableAddr] P2_MENU_INDEX, P2_OFFENSE_MENU_COMMAND_TABLE
P2_OFFENSE_MENU_COMMAND_TABLE:
.WORD P2_OFFENSE_MENU_CANCEL-1 ; CANCEL
.WORD P2_OFFENSE_MENU_TIMEOUT-1 ; TIMEOUT
.WORD P2_OFFENSE_MENU_PUNT-1 ; PUNT
.WORD P2_OFFENSE_MENU_FG-1 ; FG
.WORD P2_OFFENSE_MENU_CHANGE_PLAYERS-1 ; PLAYER CHANGE
P2_OFFENSE_MENU_CANCEL: ; P2 CANCEL
JSR RESTORE_SCREEN_P2_MENU_COVERED ; CLEAR P2 MENU PPU()
JMP P2_MAN_OFFENSE_START ; JUMP TO P2 MAN OFFENSE START
P2_OFFENSE_MENU_TIMEOUT: ; P2 TIMEOUT
LDA P2_TIMEOUTS ; LOAD P2 TIMEOUTS
BEQ SET_P2_OFFENSE_MENU_FIRST_OPTION ; NO timeouts left BRANCH TO P2 SET OFF MENU ARROW TO FIRST SPOT
LDA CLOCK_RUN_TYPE ; LOAD CLOCK STATUS
BPL SET_P2_OFFENSE_MENU_FIRST_OPTION ; IF CLOCK NOT RUNNING JUMP TO P1 SET OFF MENU ARROW TO FIRST SPOT
JSR DO_P2_OFF_TIMEOUT ; BRING UP P2 TIME OUT SUB MENU()
LDX #TIMEOUT_MENU_AUTO_CLEAR_DELAY ; LOAD MENU CLEAR DELAY
_WHILE NOT_EQUAL ; P2 TIMEOUT MENU WAIT TO CLEAR
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER IF OVER DO FADE OUT AND SCOREBOARD AND RETURN()
LDA JOY_PRESS_2 ; LOAD P2 BUTTON PRESS
AND #(A_BUTTON + B_BUTTON ) ; IS "A" or "B"?
BNE @clear_p2_off_timout_menu ; YES->BRANCH TO CLEAR TIMEOUT SUB MENU AND EXIT TO OFFENSE MENU
DEX ; DELAY TIME--
_END_WHILE ; DELAY DONE? NO-> LOOP BACK TOP2 TIMEOUT MENU WAIT TO CLEAR
@clear_p2_off_timout_menu: ; CLEAR TIMEOUT SUB MENU AND EXIT TO OFFENSE MENU
JSR CLEAR_P2_TIME_OUT_SUB_MENU ; CLEAR P2 TIME OUT SUB MENU PPU()
JMP SET_P2_OFFENSE_MENU_FIRST_OPTION ; P2 SET OFFENSE MENU ARROW TO FIRST SPOT
P2_OFFENSE_MENU_PUNT:
LDA #PUNT_PLAY_CALL_ID ; LOAD PUNT PLAY CODE
JMP P2_OFFENSE_CHOOSES_SPECIAL_TEAMS_PLAY ; JUMP to P2 OR COM PICKS FG/PUNT
P2_OFFENSE_MENU_FG:
LDA #FG_PLAY_CALL_ID ; LOAD FG PLAY CODE
JMP P2_OFFENSE_CHOOSES_SPECIAL_TEAMS_PLAY ; JUMP to P2 OR COM PICKS FG/PUNT
P2_OFFENSE_MENU_CHANGE_PLAYERS: ; P2 CHANGE PLAYERS
JSR END_OFF_AND_DRAW_TASK_AFTER_PPU_TRANS_DONE ; CHECK FOR PPU TRANSFER DONE THEN KILL TASK 2, TASK5 ()
LDA P2_TEAM ; LOAD PLAYER 2 TEAM
STA CURRENT_TEAM ; SAVE in CURRENT TEAM
SUSPEND_TASK_DIRECT[task] UPDATE_CLOCK_TASK
LDA #$00 ; SET COMING FROM PLAY SELECT
STA SUB_CONTROL_TYPE ;
LDA #MAIN_GAME_BANK_1 ; BANK17
LDY #<CHANGE_PLAYERS ; LOAD CHANGE PLAYERS ADDRESS
LDX #>CHANGE_PLAYERS ;
JSR SWAP_8000_BANK_AND_JUMP_RETURN ; BANK SWAP $8000 AND JUMP (A= BANK, Y,X= ADDRESS)
LDX #UPDATE_CLOCK_TASK ; LOAD TASK 0
JSR RESUME_TASK ; RESUME TASK (X=TASK)
JSR SET_BG_SPR_FULLY_FADED_OUT ; PALETTE_FADE_IN()
JMP BANK_JUMP_START_PLAY_SELECT ; JUMP TO MAIN LOOP TO REDRAW() *** could fix dont need jump to a jump
data_addr = LOCAL_1
P2_OFFENSE_SAVE_PLAY_CALL: ; P2 OFFENSE SAVE PLAY CALL
STA P2_PLAY_CALL ; SAVE P2 PLAY CALL
PLAY_SOUND_ID PLAY_SELECTED_SOUND
LDY #<P2_READY_SELECT_TEXT_PPU_ADDR ; LOAD PPU ADDRESS FOR P2 READY
LDX #>P2_READY_SELECT_TEXT_PPU_ADDR ;
LDA #<READY_TEXT_INFO ; LOAD READY DATA AND CONTROL INFO ADDRESS
STA data_addr ;
LDA #>READY_TEXT_INFO ;
STA data_addr +1 ;
JSR TRANSFER_TO_PPU_OR_PPUBUFF_WITH_COMMANDS ; UPDATE PPU(3E,3F= DATA ADDRESS X,Y= PPU ADDRESS)
SET_CLOCK_TO_STOPPED
_WHILE MINUS ; P2 PICKED PLAY WAIT FOR P1 PLAY
RETURN_1_FRAME
JSR DO_SCOREBOARD_IF_QTR_OVER ; CHECK FOR QTR OVER IF OVER DO FADE OUT AND SCOREBOARD AND RETURN()
LDA P1_PLAY_CALL ; LOAD P1 PLAY
_END_WHILE
LDX #READY_SELECT_YARDLINE_TASK ; LOAD TASK 5 INDEX
JSR END_TASK_CHECK_TASK_NOTHING_IN_BUFFERS ; SET TASK TO TERMINATED(X=TASK)
RETURN_IN_NUM_FRAMES 60
JSR FADE_OUT_BG_SPR_PAL ; FADE PALLETE()
LDA #SPRITE_OFFSCREEN ; SET FLASHING YARDLINE SPRITE(Y) to offscreen
STA FLASHING_YARDLINE_SPR_Y ;
JMP CLEAR_TEAM_NAMES_AND_SELECT_READY_AREA ; CLEAR PPU MEMORY TEAM NAMES,SELECT/READY()
P2_OFFENSE_CHOOSES_SPECIAL_TEAMS_PLAY: ; P2 OR COM PICKS FG/PUNT
STA P2_PLAY_CALL ; SAVE P2 PLAY CALL
JSR END_OFF_AND_DRAW_TASK_AFTER_PPU_TRANS_DONE ; CHECK FOR PPU TRANSFER DONE THEN KILL TASK 2, TASK5 ()
LDY #<P2_READY_SELECT_TEXT_PPU_ADDR ;
LDX #>P2_READY_SELECT_TEXT_PPU_ADDR ;
LDA #<READY_TEXT_INFO ; LOAD READY DATA AND CONTROL INFO ADDRESS
STA data_addr ;
LDA #>READY_TEXT_INFO ;
STA data_addr+1 ;
JSR TRANSFER_TO_PPU_OR_PPUBUFF_WITH_COMMANDS ; UPDATE PPU(3E,3F= DATA ADDRESS X,Y= PPU ADDRESS)
PLAY_SOUND_ID PLAY_SELECTED_SOUND
SET_CLOCK_TO_STOPPED
num_tiles = LOCAL_1
lines = LOCAL_2
@clear_p1_slect_ready_after_p2_picks_st
LDY #<P1_READY_SELECT_TEXT_PPU_ADDR ; LOAD PPU ADDRESS FOR P2 READY
LDX #>P1_READY_SELECT_TEXT_PPU_ADDR ;
LDA #$01 ; LOAD # LINES
STA lines ;
LDA #READY_TEXT_LENGTH ; LOAD LENGTH
STA num_tiles ;
JSR FILL_SCREEN_BLANK_TILE_AREA ; CLEAR PPU(X,Y= ADDR, 3F= NUM lines, 3E= length)
RETURN_IN_NUM_FRAMES 60
JSR FADE_OUT_BG_SPR_PAL ; FADE PALLETE()
LDA #SPRITE_OFFSCREEN ; SET FLASHING YARDLINE SPRITE(Y) to OFFSCREEN
STA FLASHING_YARDLINE_SPR_Y ;
JMP CLEAR_TEAM_NAMES_AND_SELECT_READY_AREA ; CLEAR PPU MEMORY TEAM NAMES,SELECT/READY()
_F}_P2_ON_OFFENSE_PLAYCALL
_F{_P2_ON_DEFENSE_PLAYCALL
P2_ON_DEFENSE_PLAYCALL_START: ; P2 DEFENSE START
LDX #PLAYCALL_DEFENSE_STACK_INDEX ; SET STACK LOCATION
TXS ;
LDA TEAM_CONTROL_TYPES ; LOAD PLAYER TYPES
AND #$0E ; IS PLAYER 2 COM?
BNE P2_COM_ON_DEFENSE_START ; YES-> BRANCH TO P2 COM DEFENSE START
P2_MAN_DEFENSE_INPUT_CHECK: ; P2 DEFENSE INPUT CHECK
RETURN_1_FRAME
JSR GET_P2_CONTROLLER_INPUT_PLAY_SELECT ; CHECK FOR P2 DIRECTION + BUTTON PRESS()
BCC @no_direction_pressed ; PLAY PICKED? NO-> BRANCH TO P2 DEFENSE PLAY NOT PICKED
JMP P2_DEFENSE_SAVE_PLAY_CALL ; YES-> JUMP TO P2 DEFENSE PLAY PICKED
@no_direction_pressed: ; P2 DEFENSE PLAY NOT PICKED
BVS P2_MAN_DEFENSE_INPUT_CHECK ; INVALID CHOICE? YES->LOOP BACK TO P2 DEFENSE INPUT CHECK
LDA JOY_PRESS_2 ; LOAD P2 PRESS
BPL P2_MAN_DEFENSE_INPUT_CHECK ; "B" PRESSED-> LOOP BACK TO P2 DEFENSE INPUT CHECK
JMP DO_P2_DEFENSIVE_MENU ; "A" PRESSED-> JUMP TO BRING UP P1 DEFENSIVE MENU
temp_play_call = LOCAL_3
P2_COM_ON_DEFENSE_START: ; P2 COM DEFENSE START
JSR P2_ON_DEF_SET_VALUE_FOR_CPU_PLAY_CALL_LOGIC ; P2 ON D LOAD VALUES(DOWN, YDLN, & DO COM PLAY LOGIC)
LDA temp_play_call ; LOAD COM PLAY CALL
STA CPU_P2_PLAY_CALL ; SAVE in P2 COM PLAY CALL
LDA CPU_OFF_TIMEOUTS ; NEW TIMEOUTS = P2 CURRENT TIMEOUTS?
CMP P2_TIMEOUTS ;
BEQ @p2_com_picks_play ; YES-> BRANCH TO P2 COM D PICKS PLAY
@p2_com_defense_takes_timeout:
JSR DRAW_P2_DEFENSE_MENU ; DRAW P2 DEFENSE MENU()
LDA #TIMEOUT_MENU_OPTION ; LOAD TIMEOUT OPTION INDEX
JSR DO_P2_COM_SELECT_MENU_OPTION ; P2 COM SELECTS MENU OPTION (A= CHOICE)
JSR DO_P2_DEF_TIMEOUT ; P2 DEF TIMEOUT ROUTINE()
LDA #SPRITE_OFFSCREEN ; SET MENU ARROW (Y) TO OFFSCREEN
STA MENU_ARROW_SPR_Y ;
RETURN_IN_NUM_FRAMES 120
JSR CLEAR_P2_TIME_OUT_SUB_MENU ; CLEAR P2 TIME OUT SUB MENU PPU()
RETURN_IN_NUM_FRAMES 8
JSR RESTORE_SCREEN_P2_MENU_COVERED ; CLEAR P2 MENU PPU()
RETURN_IN_NUM_FRAMES 8
@p2_com_picks_play: ; P2 COM D PICKS PLAY
LDA RANDOM_2 ; MAKE TIME 30-37 FRAMES
AND #$07 ;
CLC ;
ADC #COM_PLAY_SELECT_DELAY ;
JSR DELAY_TASK ; SWITCH TASKS( A= # FRAMES BEFORE RETURNING)
LDA CPU_P2_PLAY_CALL ; LOAD P2 COM PLAY CALL
JMP P2_DEFENSE_SAVE_PLAY_CALL ; JUMP TO P2 DEFENSE PLAY PICKED
DO_P2_DEFENSIVE_MENU: ; P2 DEFENSIVE MENU START
JSR DRAW_P2_DEFENSE_MENU ; DRAW P2 DEFENSE MENU()
P2_DEFENSE_SET_MENU_TO_FIRST_OPTION: ; P2 DEFENSE SET ARROW TO FIRST OPTION
JSR SET_SPR_MENU_ARROW_LOC_AND_ATTR ; SET MENU ARROW LOCATION AND ATTRIBUTE()
LDA #$00 ; SET ARROW TO FIRST OPTION
STA MENU_INDEX ;
LDY #<P2_DEFENSE_MENU_INFO ; LOAD P2 DEFENSE MENU ADDRESS
LDX #>P2_DEFENSE_MENU_INFO ;
LDA #P2_SIDE_ID ; LOAD P2 JOY
JSR SET_MENU_ARROW_OPTIONS ; INITIALIZE MENU OPTIONS(X,Y= ADDRESS, A=PLAYER JOY)
JSR SET_SPR_MENU_ARROW_LOC_AND_ATTR_P2 ;
_WHILE VALUE_CLEAR ; P2 DEFENSE MENU INPUT LOOP
RETURN_1_FRAME
JSR SET_SPR_MENU_ARROW_LOC_AND_ATTR ; SET MENU ARROW LOCATION AND ATTRIBUTE()
JSR CHECK_MENU_ARROW_UP_DOWN ; CHECK FOR ARROW MOVED UP OR DOWN()
JSR UPDATE_MENU_ARROW_SPR_Y ; SET ARROW NEW Y COORDINATE()
JSR SET_SPR_MENU_ARROW_LOC_AND_ATTR_P2 ; SET SPRITE MENU ARROW LOCATION AND ATTRIBUTE_2() ??
BIT JOY_PRESS_2 ; GET P2 JOY PRESS
BMI @do_p2_def_menu_choice ; A PRESSED? YES->BRANCH TO DO P2 DEFENSE MENU OPTION SELECTED
_END_WHILE ; B PRESSED? NO-> LOOP BACK TO P2 DEFENSE MENU INPUT LOOP
LDA #CANCEL_MENU_OPTION ; YES->SET P2 MENU INDEX TO CANCEL
STA P2_MENU_INDEX ;
@do_p2_def_menu_choice: ; P2 DEFENSE MENU OPTION SELECTED
RTS_JUMP_TABLE[memVal_tableAddr] P2_MENU_INDEX , P2_DEFENSE_MENU_COMMAND_TABLE
P2_DEFENSE_MENU_COMMAND_TABLE: ; P2 DEFENSIVE MENU OPTIONS POINTER TABLE
.WORD P2_DEFENSE_CANCEL-1 ; CANCEL
.WORD P2_DEFENSIVE_MENU_START-1 ; TIMEOUT
P2_DEFENSE_CANCEL:
JSR RESTORE_SCREEN_P2_MENU_COVERED ; CLEAR P2 MENU PPU()
JMP P2_ON_DEFENSE_PLAYCALL_START ; JUMP TO PLAYER 1 DEFENSE START
P2_DEFENSIVE_MENU_START:
LDA P2_TIMEOUTS ; LOAD P2 TIMEOUTS
BEQ P2_DEFENSE_SET_MENU_TO_FIRST_OPTION ; ANY LEFT? NO-> LOOP BACK TO P2 DEFENSE SET ARROW TO FIRST OPTION
LDA CLOCK_RUN_TYPE ; LOAD CLOCK STATUS
BPL P2_DEFENSE_SET_MENU_TO_FIRST_OPTION ; IS IT STOPPED? YES-> LOOP BACK TO P1 DEFENSE SET ARROW TO FIRST OPTION
JSR DO_P2_DEF_TIMEOUT ; USE P2 TIMEOUT ROUTINE()
LDX #TIMEOUT_MENU_AUTO_CLEAR_DELAY ; LOAD CLEAR SUBMENU DELAY
_WHILE NOT_EQUAL ; CLEAR P2 TIMEOUT SUBMENU WAIT
RETURN_1_FRAME
LDA JOY_PRESS_2 ; LOAD P1 BUTTON PRESS
AND #(A_BUTTON + B_BUTTON ) ; IS "A" or "B"?
BNE CLEAR_P2_DEFENSE_TIMEOUT_MENU ; YES-> JUMP TO CLEAR P2 TIMEOUT SUBMENU
DEX ; DECREASE timer
_END_WHILE ; Timer done? NO LOOP BACK TO CLEAR P2 TIMEOUT SUBMENU WAIT
sram_addr = LOCAL_1
CLEAR_P2_DEFENSE_TIMEOUT_MENU: ; CLEAR P2 TIMEOUT SUBMENU
JSR CLEAR_P2_TIME_OUT_SUB_MENU ; CLEAR P2 TIME OUT SUB MENU PPU()
JMP P2_DEFENSE_SET_MENU_TO_FIRST_OPTION ; JUMP TO P1 DEFENSE MENU SET ARROW TO FIRST OPTION
JSR WAIT_UNTIL_PPU_NOT_BUSY_SUSPEND_OPP_INPUT_TASK ; CODE NOT USED AS ITS PERFORMED BY 916B ROUTINE
LDY #<$2172 ;
LDX #>$2172 ;
LDA #<P2_TIMEOUT_MENU_SRAM ;
STA sram_addr ;
LDA #>P2_TIMEOUT_MENU_SRAM ;
STA sram_addr+1 ;
JSR TRANSFER_TO_PPU_OR_PPUBUFF_WITH_COMMANDS ;
LDX #READY_SELECT_YARDLINE_TASK ;
JSR RESUME_TASK ;
JMP P2_DEFENSE_SET_MENU_TO_FIRST_OPTION ;
data_addr = LOCAL_1
P2_DEFENSE_SAVE_PLAY_CALL: ; P2 DEFENSE PLAY PICKED
STA P2_PLAY_CALL ; SAVE P2 PLAY CALL
PLAY_SOUND_ID PLAY_SELECTED_SOUND
LDY #<P2_READY_SELECT_TEXT_PPU_ADDR ; LOAD PPU ADDRESS FOR P2 SELECT/READY
LDX #>P2_READY_SELECT_TEXT_PPU_ADDR ;
LDA #<READY_TEXT_INFO ; LOAD READY DATA AND CONTROL INFO ADDRESS
STA data_addr ;
LDA #>READY_TEXT_INFO ;
STA data_addr+1 ;
JSR TRANSFER_TO_PPU_OR_PPUBUFF_WITH_COMMANDS ; UPDATE PPU (Y,X= PPU ADDR, 3E,3F DATA AND CONTROL ADDRESS)
JMP END_CURRENT_TASK ; END CURRENT TASK()
_F}_P2_ON_DEFENSE_PLAYCALL
_F{_GET_CONTROLLER_INPUT_PLAYCALL
GET_P1_CONTROLLER_INPUT_PLAY_SELECT: ; CHECK FOR P1 DIRECTION + BUTTON PRESS()
LDA JOY_RAW_1 ; LOAD P1 JOY RAW
AND #$0F ; MASK OUT BUTTONS
BEQ @nothing_pressed ; NOTHING PRESSED-> JUMP TO P1 NO DIRECTION PRESSED OR NO BUTTON PRESS
TAX ; TRANSFER JOY VALUE TO X
LDA JOY_PAD_DIRECTION_BITMASK_TABLE,X ; LOAD CONVERTED VALUE FROM JOYPAD CONVERT TABLE
BMI @invalid_input ; IF DIRECTION NOT VALID JUMP TO P1 MULTI OR INVALID DIRECTIONS PRESSED
BIT JOY_PRESS_1 ; LOAD P1 JOY PRESS
BMI @set_play_selected ; A pressed? YES->BRANCH TO P1 BUTTON PLUS DIRECTION PRESSED
BVC @nothing_pressed ; B pressed? NO-> BRANCH TO P1 NO DIRECTION PRESSED OR NO BUTTON PRESS
ORA #OFFSET_TO_PASS_PLAY ; SET PLAY TO PASS BY ADDING 4
@set_play_selected: ; P1 BUTTON PLUS DIRECTION PRESSED
SEC ; SET PLAY PICKED
RTS ;
@nothing_pressed: ; P1 NO DIRECTION PRESSED OR NO BUTTON PRESS
CLC ; SET BUTTON OR DIRECTION NOT PRESSED
CLV ;
RTS ;
@invalid_input: ; MULTIPLE OR INVALID DIRECTIONS PRESSED
CLC ; SET INVALID
BIT $FFF9 ;
RTS ;
GET_P2_CONTROLLER_INPUT_PLAY_SELECT: ; CHECK FOR P2 DIRECTION + BUTTON PRESS()
LDA JOY_RAW_2 ; LOAD P1 JOY RAW
AND #$0F ; MASK OUT BUTTONS
BEQ @nothing_pressed ; NOTHING PRESSED-> JUMP TO P1 NO DIRECTION PRESSED
TAX ; TRANSFER JOY VALUE TO X
LDA JOY_PAD_DIRECTION_BITMASK_TABLE,X ; LOAD CONVERTED VALUE FROM JOYPAD CONVERT TABLE
BMI @nothing_pressed ; IF DIRECTION NOT VALID JUMP TO MULTIPLE OR INVALID DIRECTIONS PRESSED