-
Notifications
You must be signed in to change notification settings - Fork 4
/
ATTR.ASM
executable file
·3939 lines (3220 loc) · 66.4 KB
/
ATTR.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
****************************************************************
*
* Software: ?
* Initiated: ?
*
* Modified: Shawn Liptak 8/6/91 - Hiscore display and entry (Total carnage)
* Shawn Liptak 11/9/91 - Title screen
* Shawn Liptak 2/7/92 - Stripped for basketball
* Jason Skiles 12/9/93 - Stripped for WWF
*
* COPYRIGHT (C) 1992 WILLIAMS ELECTRONICS GAMES, INC.
*
*.Last mod - 12/9/93 12:35
****************************************************************
.file "attract.asm"
.title "attract mode"
.width 132
.option b,d,l,t
.mnolist
.include "mproc.equ"
.include "display.equ"
.include "sys.equ"
.include "gsp.equ"
.include "macros.h"
.include "game.equ"
.include "audit.equ"
.include "link.equ"
.include "sound.h"
.include "imgtbl.glo"
.include "crowdimg.glo"
.include "fontsimg.glo"
.include "miscimg.glo"
.include "bgndtbl.glo"
.include "ropeimg.glo"
.include "logo.tbl"
.include "logo.glo"
.include "dip.equ"
******************************************************************************
* EXTERNAL REFERENCES
.ref ADJ_PAGE,BAKMODS,BEATEN_TAB_ENTRIES,BGND_UD1
.ref BLOW_0_TO_1,CLOSE_PROGRESS_SCREEN,CRD_SCRN2
.ref DELETE_ANY_OFF_TOP,DUMRETS,GAMSTATE,HALT,GET_ADJ
.ref IRQSKYE,MOVE_ALL_OBJS_UP,RC_BYTEI,RD7FONT
.ref RESET_FROM_PIXEL_WIPE,RNDRNG0,RNDRNGS,RemapIO
.ref SET_UP_PIXEL_WIPE,SOUNDSUP,SPECIAL_WIPEOUT,STOP_ALL_OBJS
.ref STRCNRMO_2,WHICH_SCREEN,WIPEOUT
.ref copy_string,current_round
.ref dec_to_asc,dpageflip,draw_each_beaten_table_entry,fade_down
.ref fade_up,get_all_buttons_cur2,index1,match_cnt
.ref mess_cursx,mess_cursy,mess_line_spacing,nosounds
.ref p1rounds,p2rounds,page_addr,pal_clean,pal_getf,print_beaten
.ref print_hscores,print_string2,print_string_C2
.ref print_winstreaks,setup_message,start_match
.ref starting_num,table_cmos_check,total_matches,triple_sound
.ref wrestler_mugs2,set_volume,INIT_LADDER_TABLE
.ref wsf14_ascii,wsf10_ascii,print_string
.ref message_ascii,mess_cursx2
.ref osgemd_ascii,LADDER,CURRENT_LADDER,NUM_OPPS
.ref hscore_colcyc2,ogmd10_ascii,CLOSE_SCREEN_LINE
.ref OPEN_SCREEN_LINE,HORZTRN1,HORZTRN2,TOP_LEFT
.ref BOT_RIGHT,LINES,not_blank,doing_dcs_reset,QSNDRST
.REF MUSIC_HAP,JUDDER_SHADOW
.REF DRKTRPLTP
.ref STRCNRMO_1
.ref _clk_rd
.ref _auto_update_save
.ref _GetTime
.ref print_message
.ref concat_string
.ref concat_rom_string
.ref print_string_C
.ref print_string_C2
.ref copy_rom_string
.ref wgsf24_ascii
.ref wsf14_ascii
.ref WSF_R_P
.ref _tseconds
.ref _tminutes
.ref _thours
.ref _tday
.ref _tdate
.ref _tmonth
.ref _tyear
.ref WHERE_WRESTLMANIA_SPARKLES,SPRINKLE_GLINTS
.ref RANDOM_SPARKLE
.ref READ_DIP
.globl hstd_mod
.ref print_inter,belt_type
.ref draw_each_inter_table_entry
.ref INTER_TAB_ENTRIES
.REF print_tag
.REF RNDPER
.REF MAYBE_TOUGH_ENOUGH
.ref osgmd8_ascii,SGMD8WHT
.ref story_bgnd
.ref hscore_colcyc,hscore_colcyc2
******************************************************************************
;symbols defined externally
;ram
BSSX hisclong ,16 ;!0=Show hiscore table longer
BSSX SHOW_CRD_FLAG,16 ;Show credits in amode gameplay
.bss cycram ,8*2*16 ;Palette cycle mem
.bss cycram2 ,7*2*16 ;^
; .bss team_cnts ,32 ;left team cnt, +16=rgt team cnt
; .bss stick ,32 ;stick ram for team selection
; .bss loop, 16 ;
.bss TEMP,16
.BSS AMODE_LOOPS,16
.BSS DCS_PAL,16
.BSS DCS_BIT_TABLE,(32*7)*(31*44)
.BSS LOGOMOD_START,(40H*20)+32
.BSS LOGOMOD_END,0
.bss bios_type,16
.bss nb_save,16
.text
********************************
* Attract mode (Process)
SUBR attract_mode
calla display_blank
calla WIPEOUT ;CLEAN SYSTEM OUT
;let the sound board reset finish up.
SLEEPK 8
clr a3
calla SNDSND
movi INAMODE,a14 ;set GAMSTATE
move a14,@GAMSTATE
clr a0 ;clear matches since attmode cntr
move a0,@total_matches,W
MOVE A0,@AMODE_LOOPS
MOVE A0,@MUSIC_HAP
movk 1,a0
move a0,@dpageflip ;page flipping on
calla display_unblank
JSRP dan_test
; ;temp!
;#foo JSRP DO_HINTS
; jruc #foo
#loop
* Please, stop messing with this ! If you want it changed, ask me ! - Jake
JSRP show_hstd
;TEST PURPOSES ONLY
; .ref show_wrestler_end_story
; .ref which_player
; .ref PSTATUS
;
; clr a14
; move a14,@PSTATUS
;
; move a14,@which_player
; JSRP show_wrestler_end_story
;
; movk 1,a14
; move a14,@which_player
; JSRP show_wrestler_end_story
;
; movk 2,a14
; move a14,@which_player
; JSRP show_wrestler_end_story
;
; movk 3,a14
; move a14,@which_player
; JSRP show_wrestler_end_story
;
; movk 4,a14
; move a14,@which_player
; JSRP show_wrestler_end_story
;
; movk 5,a14
; move a14,@which_player
; JSRP show_wrestler_end_story
;
; movk 6,a14
; move a14,@which_player
; JSRP show_wrestler_end_story
;
; movk 8,a14
; move a14,@which_player
; JSRP show_wrestler_end_story
;
;END TEST
JSRP DCS_LOGO
; JSRP show_sports_logo
JSRP show_gameplay
JSRP creditscreen
JSRP show_title
JSRP show_gameplay
JSRP creditscreen
JSRP DO_HINTS
JSRP show_gen_tips
JSRP show_bios
movk 1,a14
move a14,@bios_type
move @next_bio,a14
move a14,@nb_save
dec a14
andi 7,a14
move a14,@next_bio
movi story_bgnd,a0
JSRP show_bios_tips
clr a14
move a14,@bios_type
move @nb_save,a14
move a14,@nb_save
JSRP show_operatormsg
calla RemapIO ;Remap the I/O
MOVE @AMODE_LOOPS,A0
INC A0
MOVE A0,@AMODE_LOOPS
btst 0,a0
jrnz #loop
JSRP creditscreen
; JSRP show_hstd
JSRP show_time_date
MOVE @AMODE_LOOPS,A0
andk 7,a0
jrnz #loop
JSRP show_copyright
JSRP aama_message
clr a0
move a0,@AMODE_LOOPS
move a0,@SOUNDSUP ;turn all sounds on
jruc #loop
aama_message
calla display_blank
calla WIPEOUT ;CLEAN SYSTEM OUT
clr a0
move a0,@HALT
move a0,@dtype ;2d mode
move a0,@IRQSKYE
clr a0 ;movk 1,a0 ;page flipping on
move a0,@dpageflip
SLEEPK 2
movi SCRNEND,a0 ;[256,405]
move a0,@SCRNLR,L
clr a0
move a0,@WORLDTLX,L
move a0,@WORLDTLY,L
; movi hstd_mod,a0
; move a0,@BAKMODS,L
; calla BGND_UD1 ;create objects for background
;
; SLEEPK 2
; calla display_unblank
movi blue_grad_pal,a0
JSRP do_the_grad_thang
clr a0
movi [>1111,0000],a6 ;pal 0, color 17
movi #ln1,a8
movi [54+60-20,200],a9
movk 1,a10
movi RD7FONT,a11
JSRP STRCNRMO_2
clr a0
movi [>1111,0000],a6 ;pal 0, color 17
movi #ln2,a8
movi [54+60,>b1],a9
JSRP STRCNRMO_2
clr a0
movi [>0606,0000],a6 ;pal 0, color 17
movi #ln2b,a8
movi [54+60,>104],a9
JSRP STRCNRMO_2
clr a0
movi [>1111,0000],a6 ;pal 0, color 17
movi #ln3,a8
movi [54+71,200],a9
JSRP STRCNRMO_2
clr a0
movi [>1111,0000],a6 ;pal 0, color 17
movi #ln4,a8
movi [54+82,200],a9
JSRP STRCNRMO_2
clr a0
movi [>1111,0000],a6 ;pal 0, color 17
movi #ln5,a8
movi [54+93,200],a9
JSRP STRCNRMO_2
clr a10
movk 8,a11
CREATE FADE_PID,fade_up
movk 1,a0
move a0,@DISPLAYON
SLEEPK 2
calla display_unblank
;Explanation - We MUST allow the fade process created above
;to finish because if someone wacks out below, the fade
;process is still running and JakeO's code to do his wipe
;across the screen stuff for the high score table starts running.
;His code uses the FADERAM area for those screen wipes and if a fader
;is running, the data in those areas gets changed by the fader process.
;Unfortunately, some of the data he is using is used as pointers in a
;memory to memory copy loop and if those values get changed the memory to
;memory copy goes haywire and starts scribbling all over the place causing
;a lockup. NOTE - The errant writes CAN and do occur into the CMOS area.
;There are 4 ways to solve the problem.
;
; 1. Guarentee that the fader is allowed to run to completion.
;
; 2. Kill off the fader after wacking out.
;
; 3. Use a different area of memory for the screen wipes.
;
; 4. Shoot Jake.
;
;Not wanting to go to jail I chose option 3 cause we got plenty of memory.
;
SLEEPK 20
movi 4*TSEC,a10
JSRP wait_on_butn
; clr a10
; movk 16,a11
; CREATE FADE_PID,fade_down
;
; SLEEP TSEC
;
; calla display_blank
RETP
; movi CLSNEUT|TYPTEXT|SUBTXT,a0
; calla obj_del1c
; calla display_on
; calla view_page_0
; movi >40*6,a10
; JSRP fadein_jsrp
; jruc amode_fade_retp
; RETP
#ln1 .string "AAMA PARENTAL ADVISORY",0
#ln2 .string "LIFE-LIKE VIOLENCE",0
#ln2b .string "- MILD",0
#ln3 .string "CONTAINS SELECTED SCENES INVOLVING",0
#ln4 .string "HUMAN-LIKE CHARACTERS ENGAGED IN",0
#ln5 .string "COMBATIVE ACTIVITY.",0
.byte 0
.even
do_the_grad_thang
calla pal_getf
SLEEPK 2
clr a3
movi >00000101,a1
movi 31,a10
loop movi >00020190,a2
movi >2000000,a4
movi >800c,a5
calla QDMAN ;dman
addi >01010000,a1
addi >00020000,a3
dsj a10,loop
addi >00840000,a3
movi 32,a10
loop2 movi >00020190,a2
movi >2000000,a4
movi >800c,a5
calla QDMAN ;dman
subi >01010000,a1
addi >00020000,a3
dsj a10,loop2
SLEEPK 4
RETP
**************************************************************************
* *
* dman - manual dma, all regs must be setup upon calling *
* a1 = [constant color,palette] *
* a2 = size [h,w] *
* a3 = destination [y,x] *
* a4 = starting address *
* a5 = [offset,control] *
* *
**************************************************************************
dman
*manual dma (setup your own regs)
*inputs:
*a1: constant color:palette
*a2: vsize:hsize
*a3: destination y:x
*a4: sag
*a5: offset:control
qdman:
MMTM sp,a2,a4,a13
jruc qdma1
**************************************************************************
* *
* dma queue support routines *
* *
**************************************************************************
*
* qdma puts image on dma q
* inputs:
* a1: constant color:palette
* a3: destination y:x
* a5: offset:control
* a14: address of image header
* gets: a2=h/w; a4=sag
*
;qdma
; mmtm sp,a2,a4,a13
; move *a14,a2,l ;get vsize:hsize
; move *a14(isag),a4,l ;get sag
qdma1
; movk 1,a13
; move a13,@qdmaflg,w ;q being modified
.ref DMAQCUR,DMAQ
move @DMAQCUR,a13,L
cmpi DMAQ,a13
jrls qdmax ;q overload, can it
mmtm a13,a1,a2,a3,a4,a5
move a13,@DMAQCUR,L
; clr a13
; move a13,@qdmaflg,w
qdmax MMFM sp,a2,a4,a13
rets
;*************************************************************************
blue_grad_pal
.word 32
.word 31
.word 30
.word 29
.word 28
.word 27
.word 26
.word 25
.word 24
.word 23
.word 22
.word 21
.word 20
.word 19
.word 18
.word 17
.word 16
.word 15
.word 14
.word 13
.word 12
.word 11
.word 10
.word 9
.word 8
.word 7
.word 6
.word 5
.word 4
.word 3
.word 2
.word 1
.word 0
************ clear screen routine *********************
;clr_scrn
; clr a0
; mmtm sp,a1,a2,a3
; move @displayon,a3,w
; clr a1
; move a1,@displayon,w
;; callr dmaqwait ;wait on dma
; clr a1
; move a1,@cmapsel,w ;select color map 0
; movi screen,a1,l
; movi ((scrne-2000h)-screen)/32,a2,l
;clrlp move a0,*a1+,l
; dsjs a2,clrlp
; move a3,@displayon,w
; mmfm sp,a1,a2,a3
; rets
#****************************************************************
* show_gameplay
SUBRP show_gameplay
movk 1,a0
move a0,@current_round
move a0,@match_cnt
move a0,@p1rounds
move a0,@p2rounds
movk 7,a0
calla RNDRNG0
cmpi 7,a0
jrnz #bug
inc a0
#bug move a0,@index1
;initialize NUM_OPPS and CURRENT_LADDER
;choose at random a battle between #2 and #6 on the ladder
clr a14
move a14,@belt_type
calla INIT_LADDER_TABLE
movk 5,a0
calla RNDRNG0
addk 1,a0
X32 a0
addi LADDER,a0
move a0,@CURRENT_LADDER,L
move *a0,a14,L
srl 24,a14
move a14,@NUM_OPPS
CALLR TURN_SOUNDS_OFF_IF_NEED
JSRP CLOSE_PROGRESS_SCREEN
calla SPECIAL_WIPEOUT
;Eventually, we should show just quick clips of cool gameplay.
movk 1,a0
move a0,@SHOW_CRD_FLAG
CALLR TURN_SOUNDS_OFF_IF_NEED
CREATE AMODE_GAMEPLAY_PID,start_match
CALLA MAYBE_TOUGH_ENOUGH
SLEEP 3*60
movi 10*TSEC,a10
JSRP wait_on_butn
;Freeze action in interesting spots...
;knockout processes
movk 1,a0
move a0,@HALT
;Stop wrestler procs
;Stop sweat
;Allow shadows to still shake
CREATE0 DO_SET_IMAGES
movi ACTIVE,a3,L
#lp move *a3,a3,L ;Get next
jrz #x ;End?
move *a3(PWAKE),a0,L
.ref DO_SET_IMAGES
cmpi DO_SET_IMAGES,a0
jrz #lp
move *a3(PTIME),a14 ;Add sleep
addi 3*60,a14
move a14,*a3(PTIME)
jruc #lp
#x
SLEEP 60
;fade down
clr a10
movk 16,a11
CREATE FADE_PID,fade_down
SLEEPK 32
calla display_blank
clr a0
move a0,@SHOW_CRD_FLAG
CALLA nosounds
RETP
TURN_SOUNDS_OFF_IF_NEED
ADJUST ADJMUSIC
JRNZ TURN_OFF_SOUNDS
MOVE @AMODE_LOOPS,A0
CMPI 2,A0
JRLT SOUNDS_SHOULD_BE_ON
TURN_OFF_SOUNDS
MOVK 2,A0
MOVE A0,@SOUNDSUP
SOUNDS_SHOULD_BE_ON
RETS
#****************************************************************
* Show an operator message if one has been entered
STRUCTPD
WORD som_string
SUBR show_operatormsg
calla ADJ_PAGE
movk CMESS_LINES,a2 ;>Check for a message
movi CUSTOM_MESSAGE,a7
#cmlp
calla RC_BYTEI
jrnz #msg
addi CMESS_LINE_SIZE,a7
dsj a2,#cmlp
jruc #x
#msg
JSRP GENERIC_DISPLAY
movk CMESS_LINES,a2 ;>Check for a message
movi CUSTOM_MESSAGE,a7
movi [50,200],a9
#prtlp
PUSHP a2,a7
calla ADJ_PAGE
move a13,a2
addi som_string,a2
#getlp calla RC_BYTEI
movb a0,*a2
addk 8,a2
move a0,a0
jrnz #getlp
movi GOLD,a0
calla pal_getf
move a0,a6
move a13,a8
addi som_string,a8
clr a0
movk 1,a10
movi osgfont_t,a11
PUSHP a9
JSRP STRCNRMO_1
PULLP a9
movi OBJLST,a14
#olp move *a14,a14,L ;A14=*Next
jrz #oend
move *a14(ODATA_p),a0,L
jrnz #olp
movi [>320,>320],a1
move a1,*a14(ODATA_p),L
jruc #olp
#oend
; PUSHP a6
; SLEEPK 30
; PULLP a6
PULLP a2,a7
#nxt
addi [45,0],a9
addi CMESS_LINE_SIZE,a7
dsj a2,#prtlp
SLEEP 2*60
movi 6*TSEC,a10
JSRP wait_on_butn
JSRP scrn_scaleout
calla WIPEOUT
#x RETP
#*****************************************************************************
.def osgfont_t
osgfont_t
.long OSGEMD_EXP,OSGEMD_APO,OSGEMD_NUM,OSGEMD_DOL ;!"#$
.long OSGEMD_SPC,OSGEMD_AND,OSGEMD_APO,OSGEMD_OBR ;%&'(
.long OSGEMD_CBR,OSGEMD_SPC,OSGEMD_SPC,OSGEMD_SPC ;)*+,
.long OSGEMD_DAS,OSGEMD_DOT,OSGEMD_SLS ;-./
.long OSGEMD_0,OSGEMD_1,OSGEMD_2,OSGEMD_3,OSGEMD_4
.long OSGEMD_5,OSGEMD_6,OSGEMD_7,OSGEMD_8,OSGEMD_9
.long OSGEMD_COL,OSGEMD_SPC,OSGEMD_SPC,OSGEMD_SPC ;:;<=
.long OSGEMD_SPC,OSGEMD_QUE,OSGEMD_SPC ;>?@
.long OSGEMD_A,OSGEMD_B,OSGEMD_C,OSGEMD_D
.long OSGEMD_E,OSGEMD_F,OSGEMD_G,OSGEMD_H
.long OSGEMD_I,OSGEMD_J,OSGEMD_K,OSGEMD_L
.long OSGEMD_M,OSGEMD_N,OSGEMD_O,OSGEMD_P
.long OSGEMD_Q,OSGEMD_R,OSGEMD_S,OSGEMD_T
.long OSGEMD_U,OSGEMD_V,OSGEMD_W,OSGEMD_X
.long OSGEMD_Y,OSGEMD_Z
.long OSGEMD_SPC,OSGEMD_SPC,OSGEMD_SPC,OSGEMD_END ;[\]^
.long OSGEMD_BAK,OSGEMD_SPC,OSGEMD_SPC ;_`
#*****************************************************************************
* Show credits screen
*
SUBRP creditscreen
calla pal_clean
movk 1,a10
JSRP CRD_SCRN2
movi AMODE_PID,a0
move a0,*a13(PROCID)
;fade down
; clr a10
; movk 16,a11
; CREATE0 fade_down
;
; SLEEP TSEC
RETP
#*****************************************************************************
* Show time and date
*
SUBRP show_time_date
calla READ_DIP
btst DPTDON_B,a0
jrz #std_exit
move @_clk_rd,a8,L ;Save current auto update state
move a8,@_auto_update_save,L
clr a8 ;Enable auto update
move a8,@_clk_rd,L
JSRP _GetTime
SLEEPK 30
JSRP GENERIC_DISPLAY
movi #date_time_prompt,a2
calla print_message
movi #day_of_week_setup,a2
calla setup_message
move @_tday,a4
cmpi 1,a4
jrlt #bad_day
cmpi 8,a4
jrlt #do_day
#bad_day
movk 1,a4
#do_day
subk 1,a4
sll 5,a4
addi #day_of_week_table,a4
move *a4,a4,L
calla print_string_C2
move @_tmonth,a4
cmpi 1,a4
jrlt #bad_month
cmpi 13,a4
jrlt #do_month
#bad_month
movk 1,a4
#do_month
subk 1,a4
sll 5,a4
addi #month_table,a4
move *a4,a4,L
calla copy_rom_string
move @_tdate,a0
cmpi 1,a0
jrlt #bad_date
cmpi 32,a0
jrlt #do_date
#bad_date
movk 1,a0
#do_date
movi 31,a1
calla dec_to_asc
calla concat_string
movi #d_sep,a4
calla concat_rom_string
move @_tyear,a0
jrn #bad_year
cmpi 99,a0
jrlt #do_year
#bad_year
clr a0
#do_year
cmpi 9,a0
jrgt #year_gt_9
movi #zero_year,a4
PUSHP a0
calla concat_rom_string
PULLP a0
#year_gt_9
movi 99,a1
calla dec_to_asc
calla concat_string
movi #date_setup,a2
calla setup_message
calla print_string_C
move @_thours,a0
jrn #bad_hour
cmpi 24,a0
jrlt #do_hour
#bad_hour
clr a0
#do_hour
movi 12,a1
modu a1,a0
jrnz #not_mid_or_noon
movk 12,a0
#not_mid_or_noon
movi 13,a1
calla dec_to_asc
calla copy_string
movi #t_sep,a4
calla concat_rom_string
move @_tminutes,a0
jrn #bad_minute
cmpi 60,a0
jrlt #do_minute
#bad_minute
clr a0
#do_minute
cmpi 9,a0
jrgt #min_gt_9
movi #zero_year,a4
PUSHP a0
calla concat_rom_string
PULLP a0
#min_gt_9
movi 60,a1
calla dec_to_asc
calla concat_string
movi #time_setup,a2
calla setup_message
calla print_string_C
movi #its_time_to_message,a2
calla print_message
movi #wrestlemania_message,a2
calla print_message
SLEEPK 25 ; Min time to display
movi TSEC*5,a2
#wait_loop
PUSHP a2
SLEEPK 1
PULLP a2
calla get_all_buttons_cur2
jrnz #time_date_done
dsjs a2,#wait_loop
#time_date_done
; move @_auto_update_save,a8,L ;Restore Auto Update state
clr a8
not a8
move a8,@_clk_rd,L
#std_exit
RETP
#date_time_prompt
JAM_STR ogmd10_ascii,10,0,200,40,SGMD8GLD,print_string_C2
.string "THE DATE AND TIME IS...",0
.even
#its_time_to_message
JAM_STR ogmd10_ascii,10,0,200,150,SGMD8GLD,print_string_C2
.string "THAT MEANS IT'S TIME TO PLAY...",0
.even
#wrestlemania_message
JAM_STR wgsf24_ascii,10,0,200,180,WGFS_W_P,print_string_C2
.string "WRESTLEMANIA",0
.even
#day_of_week_setup
JAM_STR wsf14_ascii,10,0,200,72,WSF_R_P,print_string_C2
.even
#date_setup
JAM_STR wsf14_ascii,10,0,200,92,WSF_R_P,print_string_C2
.even
#time_setup
JAM_STR wsf14_ascii,10,0,200,112,WSF_R_P,print_string_C2
.even
#d_sep
.string ", 19",0
.even
#t_sep
.string ":",0
.even
#zero_year