-
Notifications
You must be signed in to change notification settings - Fork 0
/
diagvhs.s
5469 lines (4724 loc) · 103 KB
/
diagvhs.s
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
MAKE_DIAG equ FALSE
PACKTOTAL equ 0
CURRENT_NUMBER_OF_STARTING_DOTS equ 79-2-4-6
;;;;;;;;;;;;;; SINE DOTS ;;;;;;;;;;;;;;
;;;;;;;;;;;;;; SINE DOTS ;;;;;;;;;;;;;;
;;;;;;;;;;;;;; SINE DOTS ;;;;;;;;;;;;;;
bgcolor equ $ffff8240
nr_of_dots equ 100
nr_of_partitions equ 17
max_nr_of_vertices equ 6400 ; max in vbl with music is 643
;--------------
;DEMOPAL - sineflower colors for the 3 `places', front/middle/back
;--------------
front equ $741
middle equ $630
back equ $420
LOGS EQU 1024
EXPS EQU 4096
IFD DEMOSYSTEM
IFD STANDALONE
ELSE
STANDALONE equ 1
ENDC
ELSE
STANDALONE equ 0
ENDC
IFEQ STANDALONE
TRUE equ 0
FALSE equ 1
true equ 0
false equ 1
CHECK_VBL_OVERFLOW equ 0
SHOW_CPU equ 1
ENDC
incdir gfx
incdir lib
incdir msx
incdir res/smfx
section DATA
include macro.s
IFEQ STANDALONE
initAndRun standalone_init
standalone_init
; jsr prepMotNeo
; jsr genBlock
jsr init_effect
IFEQ MAKE_DIAG
jsr prepDiag
ENDC
jsr init_diagvhs
move.w #700,effect_vbl_counter
; jsr prepSinFlow
; jsr prepPot1
; jsr prepPotAtari
; jsr prepPot2
; jsr prepPot2b
jsr diagvhs_mainloop
rts
init_effect
move.w #$000,$ffff8240
move.l #memBase+65536,d0
sub.w d0,d0
move.l d0,screenpointer
move.l d0,screen1
add.l #$10000,d0
move.l d0,screenpointer2
move.l d0,screen2
add.l #$10000,d0
rts
ENDC
diagvhs_mainloop
.w2
tst.w $466.w
beq .w2
IFEQ CHECK_VBL_OVERFLOW
cmp.w #2,$466.w
blt .okido
move.b #0,$ffffc123
nop
move.w #$300,$ffff8240
.okido
ENDC
move.w #0,$466.w
subq.w #1,effect_vbl_counter
blt .next
jsr init_sineflower
jmp .w2
.next
rts
init_diagvhs
move.l screen2,d0
add.l #$10000,d0
move.l d0,logpointer
move.l d0,d1
add.l #2048,d1 ;2048 / 2048
move.l d1,x_block_aligned_pointer
add.l #1280,d1 ;1280 / 3328
move.l d1,y_block_aligned_pointer
add.l #800,d1 ;800 / 4128
move.l d1,tableSourcePointer
add.l #25600,d1 ;25600 / 29728
move.l d1,clearScreen1bplPointer
add.l #8542,d1 ;8542 / 38270
move.l d1,expunpack_pointer
add.l #8192,d1 ;8192 / 46462
move.l d1,logunpack_pointer
add.l #8192,d1 ;8192 / 54654
move.l d1,blockLocsPointer
add.l #2164,d1 ;2164 / 56818
move.l d1,blockLocsPointer2
add.l #2164,d1 ;2164 / 58982
move.l blockLocsPointer,a0
move.l #-1,(a0)
move.l blockLocsPointer2,a0
move.l #-1,(a0)
move.l d1,timer_b_code_list_pointer
add.l #4320,d1 ;4320 / 63302
add.l #$10000,d0
move.l d0,x_table_explode_pointer
add.l #1280,d0 ;1280 / 1280
move.l d0,savedTable_pointer
add.l #435200,d0 ;435200 / 436480
NR_SINE_LOOPS equ 4
move.l d0,sine_xgeneric_pointer
add.l #((NR_SINE_LOOPS*3)+1)*4096,d0 ;65536 / 502016
move.l d0,sine_ygeneric_pointer
add.l #((NR_SINE_LOOPS*3)+1)*4096,d0 ;65536 / 567552
move.l d0,mySpacePointer
add.l #21200,d0 ;21200 / 588752
move.l d0,blockPosPointer
add.l #5400,d0 ;5400 / 606952
move.l d0,blockPosXoffPointer
add.l #1128,d0 ;1128 / 608080
move.l d0,blockPosXPointer
add.l #1128,d0 ;1128 / 609208
move.l d0,motusColorPointer
add.l #8000,d0 ;8000 / 617208
move.l d0,rasterListPointerSaved ;12*200*7 16800
add.l #16800,d0
add.l #$1000,d0
move.l d0,explode_clear1aPointer
move.l d0,a0
move.w #-1,(a0)
add.l #402,d0
move.l d0,explode_clear1bPointer
move.l d0,a0
move.w #-1,(a0)
add.l #402,d0
move.l d0,explode_clear2aPointer
move.l d0,a0
move.w #-1,(a0)
add.l #402,d0
move.l d0,explode_clear2bPointer
move.l d0,a0
move.w #-1,(a0)
add.l #402,d0
move.l d0,smfx_blocks_pointer
add.l #1612,d0
move.l d0,atari_blocks_pointer
add.l #1204,d0
move.l d0,smfxDiagPointer
add.l #12800,d0 ;12800 / 601552
move.l d0,sinflowpointer
add.l #2400,d0
move.l d0,savescene1ptr
add.l #3888,d0
move.l d0,savescene2ptr
add.l #4416,d0
move.l d0,skillstijl1ptr
add.l #3480,d0
move.l d0,skillstijl2ptr
add.l #4512,d0
move.l d0,blockPtr
add.l #2342,d0
jsr generateTimerCode
jsr generateXTable
IFEQ PACKTOTAL
lea totalcrk,a0
move.l smfx_blocks_pointer,a1
jsr cranker ;7 vbl
move.l atari_blocks_pointer,explode_block_pointer
ELSE
lea smfxblockscrk,a0
move.l smfx_blocks_pointer,a1
jsr cranker
lea atariblockscrk,a0
move.l atari_blocks_pointer,a1
jsr cranker
move.l atari_blocks_pointer,explode_block_pointer
lea smfxdiagcrk,a0
move.l smfxDiagPointer,a1
jsr cranker
lea sinflowcrk,a0
move.l sinflowpointer,a1
jsr cranker
lea savescene1crk,a0
move.l savescene1ptr,a1
jsr cranker
lea savescene2crk,a0
move.l savescene2ptr,a1
jsr cranker
lea skillstijl1crk,a0
move.l skillstijl1ptr,a1
jsr cranker
lea skillstijl2crk,a0
move.l skillstijl2ptr,a1
jsr cranker
ENDC
jsr genBlock
move.w #$000,$ffff8240+9*2
move.w #$666,$ffff8240+15*2
move.w #$111,$ffff8240+8*2
jsr init_xblock_aligned ; x mask and offsets
jsr init_yblock_aligned ; y offsets
jsr generateVHSDrawTables ; needs a 1926*10 pointer
move.w #$2700,sr
move.l #diag_vbl,$70
move.w #$2300,sr
move.w #0,$466
.w tst.w $466.w
beq .w
move.w #0,$466
rts
;--------------
;DEMOPAL - we are back fade palette
;--------------
; starts at 0, ends at the end.
logoFade
dc.w $666,$000
dc.w $666,$000
dc.w $666,$000
dc.w $555,$000
dc.w $545,$000
dc.w $445,$000
dc.w $345,$001
dc.w $345,$001
dc.w $344,$001
dc.w $344,$001
dc.w $334,$001
dc.w $334,$001
dc.w $234,$001
dc.w $234,$001
dc.w $223,$101
dc.w $223,$101
dc.w $123,$101
dc.w $123,$101
dc.w $122,$101
dc.w $122,$111
dc.w $112,$111
dc.w $112,$111
dc.w $111,$111
.wvbl
addq.w #1,$466.w
addq.w #1,cummulativeCount
rte
diag_vbl
addq.w #1,$466.w
addq.w #1,cummulativeCount
addq.w #1,.myCount
clr.b $fffffa1b.w ;Timer B control (stop)
bset #0,$fffffa07.w ;Interrupt enable A (Timer B)
bset #0,$fffffa13.w ;Interrupt mask A (Timer B)
move.b #1,$fffffa21.w ;Timer B data (number of scanlines to next interrupt)
move.l #timer_b_open_curtain,$120.w
bclr #3,$fffffa17.w ;Automatic end of interrupt
move.b #8,$fffffa1b.w
pushall
IFNE STANDALONE
jsr musicPlayer+8
; move.l #dummy,$110.w
ENDC
move.l screenpointer2,$ffff8200
cmp.w #$777,moveBarsDone
beq .herpherp
; DO BARS STUFF
jsr doBarsColors ; set colors of bars
cmp.w #$111,$ffff8240+2*2
bne .kkkk2
move.w #front,$ffff8240+2*2
.kkkk2
jsr setLogoColor ; fade logo
jsr doStep1 ; (1) draw initial line
jsr doStep1 ; (1) draw initial line
jsr doStep1 ; (1) draw initial line
cmp.w #$4e75,doStep1 ; if already moved in
bne .skip
subq.w #1,.www ; waiter
tst.w .www
bge .skip
jsr doStepStuff ; (2) unfold the lines
jsr copySMFX ; (3) copy in smfx
; jsr moveBars ; (4) move the bars
.skip
.skipBarsShit
subq.w #1,.xxx
bge .skip2
tst.w cycleDots
bne .skipc
.herpherp
addq.w #3,current_nr_of_dots
cmp.w #100,current_nr_of_dots
ble .okdots
move.w #100,current_nr_of_dots
move.l #sineflower_vbl2,$70
move.w #$4e75,haxCols
.okdots
; move.b #0,$ffffc123
; jsr cycleDotColors
; jmp .ttttt
.skipc
move.w #2,colorOffset
move.l clearScreen1bplPointer,a0
move.w colorOffset,8(a0) ;
.ttttt
move.l clearScreen1bplPointer,a0
jsr (a0)
jsr drawDots
jsr incrementFlowerOffsets
.skip2
tst.w .www
bge .ksss
jsr moveBars ; (4) move the bars
move.l screenpointer2,a0
add.w #200*160,a0
move.l #0,-8(a0)
move.l #0,-4(a0)
move.l #0,-168(a0)
move.l #0,-164(a0)
.ksss
move.l #0,d0
move.l d0,d1
move.l d0,d2
move.l d0,d3
move.l d0,d4
move.l d0,d5
move.l d0,d6
move.l d0,d7
move.l d0,a0
move.l d0,a1
move.l screenpointer2,a6
lea 160(a6),a6
movem.l d0-a1,-(a6)
movem.l d0-a1,-(a6)
movem.l d0-a1,-(a6)
movem.l d0-a1,-(a6)
swapscreens
popall
rte
.www dc.w 1
.xxx dc.w 282
.myCount dc.w 0
cycleDots dc.w -1
setLogoColor
cmp.w #$4e75,removeSMFX
beq .doTestCode
subq.w #1,.fff
bge .ok
lea $ffff8240+9*2,a0
lea $ffff8240+15*2,a2
lea logoFade,a1
add.w .fadeOff,a1
move.w (a1)+,(a2)
move.w (a1)+,(a0)
add.w #4,.fadeOff
cmp.w #20*4,.fadeOff
ble .ok
move.w #20*4,.fadeOff
jsr removeSMFX
.ok
rts
.fff dc.w 210
.fadeOff dc.w 0
.doTestCode
subq.w #1,.www
bge .ok
; here the smfx is gone, we can do some other stuff, like copy the background in, for test
subq.w #1,.times
blt .ok
move.w #5,d0
sub.w .times,d0
muls #20*160,d0
move.l sinflowpointer,a0
move.l screenpointer,a1
move.l screenpointer2,a2
add.w #40*160+80,a1
add.w #40*160+80,a2
add.w d0,a1
add.w d0,a2
lsr.w #3,d0 ; we have 20 per line
add.w d0,a0
move.w #20-1,d7
.cp
.x set 0
REPT 10
move.w (a0)+,d0
or.w d0,.x+6(a1)
or.w d0,.x+6(a2)
.x set .x+8
ENDR
add.w #160,a1
add.w #160,a2
dbra d7,.cp
rts
.times dc.w 6
.www dc.w 30
sinflowpointer ds.l 1
doStepStuff
lea stepSequence,a0
add.w stepSquenceOff,a0
lea drawStepRoutList,a1
move.w (a0)+,d1
cmp.w #-1,d1
beq .quit
move.w (a0)+,d0
move.w (a0)+,d6
move.w (a0)+,d2
move.l a0,usp
move.l (a1,d2.w),a1
jsr (a1)
move.l usp,a0
lea drawStepRoutList,a1
move.w (a0)+,d1
cmp.w #-1,d1
beq .quit
move.w (a0)+,d0
move.w (a0)+,d6
move.w (a0)+,d2
move.l a0,usp
move.l (a1,d2.w),a1
jsr (a1)
add.w #8,stepSquenceOff
rts
.quit
move.w #$4e75,doStepStuff
rts
drawStepRoutList
REPT 10
dc.l 0
ENDR
dc.l drawStep2_10
dc.l drawStep2_11 ; 4
dc.l drawStep2_12 ; 2
dc.l drawStep2_13 ; 1+2
dc.l drawStep2_14 ; 1
dc.l drawStep2_15 ; 4+8
stepSquenceOff dc.w 0
; this code is responsible for moving multiple bars
moveBars
subq.w #1,.waiter
bge .end
move.w #0,moveBarsDone
lea myDataList,a6
.loop
subq.w #1,(a6)+
bge .skipThis
move.w #-1,moveBarsDone
;----------- do thing
move.l a6,usp
move.w (a6)+,.herp
move.w (a6)+,.oldherp
move.w (a6)+,.olderherp
move.w (a6)+,.barcolorrout
subq.w #1,(a6)+
bge .ok
; this is where the size increases
move.w #5,-2(a6)
add.w #4,(a6)
cmp.w #9*4,(a6)
ble .ok
move.w #9*4,(a6)
move.w #32000,-12(a6)
.ok
move.w (a6)+,.size
move.l screenpointer2,a0
move.w .olderherp,d0
sub.w #198,d0
add.w d0,d0
move.w d0,d1
add.w d0,d0
add.w d1,d0
tst.w (a6)+
blt .do8th
cmp.w #1,-2(a6)
beq .do14
cmp.w #3,-2(a6)
beq .do12
cmp.w #2,-2(a6)
beq .do13
.doNormal
lea tableSizes,a2
move.l (a2),a1
add.w d0,a1
move.w (a1)+,d1
move.w (a1)+,d0
move.w (a1)+,d6
jsr removeStep2
jmp .cont
.do14
lea tableSizes,a2
move.l (a2),a1
add.w d0,a1
move.w (a1)+,d1
move.w (a1)+,d0
move.w (a1)+,d6
jsr removeStep14
jmp .cont
.do13
lea tableSizes,a2
move.l (a2),a1
add.w d0,a1
move.w (a1)+,d1
move.w (a1)+,d0
move.w (a1)+,d6
jsr removeStep13
jmp .cont
.do12
lea tableSizes,a2
move.l (a2),a1
add.w d0,a1
move.w (a1)+,d1
move.w (a1)+,d0
move.w (a1)+,d6
jsr removeStep12
jmp .cont
.do8th
lea tableSizes+10*4,a2
move.l (a2),a1
add.w d0,a1
move.w (a1)+,d1
move.w (a1)+,d0
move.w (a1)+,d6
jsr removeStep
.cont
move.w .herp,d0
sub.w #198,d0
add.w d0,d0 ;*2
move.w d0,d1 ; save
add.w d0,d0 ;*4
add.w d1,d0 ;*6
lea tableSizes,a2
add.w .size,a2
move.l (a2),a1
add.w d0,a1
move.w (a1)+,d1
move.w (a1)+,d0
move.w (a1)+,d6
lea drawStepRoutList,a5
add.w .barcolorrout,a5
move.l (a5),a5
jsr (a5)
move.l usp,a5
move.w .oldherp,.olderherp
move.w .herp,.oldherp
move.w -16(a6),d0 ;
neg.w d0
add.w d0,d0
lea distanceTab,a0
move.w (a0,d0),d0
add.w d0,.herp
; add.w #2,.herp
move.w .herp,(a5)+
move.w .oldherp,(a5)+
move.w .olderherp,(a5)+
cmp.w #$777,(a6)
bne .loop
;----------- do thing
.skip
.done
; tst.w moveBarsDone
; bne .end
subq.w #1,.bugFrames
bge .end
subq.w #1,.barsDoneWaiter
bge .skipd
; move.b #0,$fffc123
move.w #$777,moveBarsDone
.skipd
move.w #0,colorOffset
move.l screenpointer2,a0
moveq #0,d0
move.l d0,d1
move.l d0,d2
move.l d0,d3
move.l d0,d4
move.l d0,d5
move.l d0,d6
move.l d0,d7
add.w #149*160,a0
; rts
.x set -8
REPT 16
movem.l d0-d1,.x(a0)
.x set .x+160
ENDR
.x set .x-8
REPT 16
movem.l d0-d3,.x(a0)
.x set .x+160
ENDR
.x set .x-8
REPT 16
movem.l d0-d5,.x(a0)
.x set .x+160
ENDR
.x set .x-8
REPT 16
movem.l d0-d7,.x(a0)
.x set .x+160
ENDR
.x set -8
move.l #1<<16+1,d0
move.l #1<<16,d1
not.l d0
.x set .x-15*160 ; 134
REPT 15
and.l d0,.x(a0) ;134
and.l d0,.x+4(a0)
and.l d0,.x+1*16*160-8(a0) ;150
and.l d0,.x+4+1*16*160-8(a0)
and.l d0,.x+2*16*160-16(a0) ;166
and.l d0,.x+4+2*16*160-16(a0)
and.l d0,.x+3*16*160-24(a0) ;182
and.l d0,.x+4+3*16*160-24(a0)
and.l d0,.x+4*16*160-32(a0) ;182
and.l d0,.x+4+4*16*160-32(a0)
add.l d0,d0
sub.l d1,d0
.x set .x+160
ENDR
.end
rts
.skipThis
add.w #14,a6
cmp.w #$777,(a6)
bne .loop
jmp .done
rts
.size dc.w 0
.sizeWaiter dc.w 0
.herp dc.w 0
.oldherp dc.w 0
.olderherp dc.w 0
.barcolorrout dc.w 0
.waiter dc.w 80
.bugFrames dc.w 100
.barsDoneWaiter dc.w 85
moveBarsDone dc.w 0
;format:
; 0; waiter
; 2; xposition
; 4; xposition2
; 6; xposition3
; 8; color/rout/bar
; 10; sizewaiter
; 12; currentSize
; 14; kind of rout
myDataList
dc.w 10,249,248,248,10*4,66-57,0,0
dc.w 10+21,239,238,238,11*4,68-57,0,0
dc.w 10+63,219,218,218,12*4,72-57,0,0 ;3
dc.w 10+42,229,228,228,13*4,70-57,0,2 ;2
dc.w 10+84,209,208,208,14*4,73-57,0,1 ;1
dc.w 10+105,199,198,198,15*4,74-57,0,-1 ;9
dc.w $777
barsList
dc.w $8240+6*2
dc.w $8240+4*2
dc.w $8240+2*2
dc.w $8240+3*2
dc.w $8240+1*2
dc.w $8240+12*2
;--------------
;DEMOPAL - bar fade colors
;--------------
; - corresponds to barsList above (color indices for the st registers)
; - each dc.w entry is the fadepalette for one bar
; - from left to fadeout (right)
;
barsFadeList
; dc.w $052,$163,$274,$163,$152,$151,$141,$131,$121,$111 ; green
; dc.w $105,$216,$327,$216,$116,$115,$114,$113,$112,$111 ; blue
; dc.w $401,$512,$623,$512,$511,$511,$411,$311,$211,$111 ; purple
; dc.w $602,$713,$724,$713,$612,$511,$411,$311,$211,$111 ; red
; dc.w $731,$742,$753,$742,$631,$521,$411,$311,$211,$111 ; orage
; dc.w $760,$771,$772,$771,$661,$551,$441,$331,$221,$111 ; yellow
dc.w $301,$412,$523,$634,$523,$512,$412,$311,$211,$111 ; purple-blue ; modmate palette ###
dc.w $401,$512,$623,$512,$511,$511,$411,$311,$211,$111 ; purple
dc.w $602,$713,$724,$713,$612,$511,$411,$311,$211,$111 ; red
dc.w $731,$742,$753,$742,$631,$521,$411,$311,$211,$111 ; orage
dc.w $740,$751,$762,$761,$631,$521,$411,$311,$211,$111 ; +++new+++
dc.w $760,$771,$772,$771,$661,$551,$441,$331,$221,$111 ; yellow
doBarsColors
lea barsList,a0
lea barsFadeList,a1
lea myDataList,a2
cmp.w #$4e75,removeSMFX
bne .np
move.w #0,d2
jmp .cc
.np
move.w #-1,d2
.cc
move.w #6-1,d7
.ll
move.w (a0)+,a6 ; get address
move.w 12(a2),d0 ; size
lsr.w d0
move.w (a1,d0.w),d1
move.w d1,(a6)
; cmp.w #$4e75,removeSMFX
tst.w d2
bne .skip
move.w d1,8*2(a6)
cmp.l #$ffff8240+12*2,a6
bne .skip
move.w d1,2*2(a6)
.skip
lea 16(a2),a2
lea 20(a1),a1
dbra d7,.ll
rts
distanceTab include "data/diag/locs2.s"
tableSizes
dc.l 0
dc.l 0
dc.l 0
dc.l 0
dc.l 0
dc.l 0
dc.l 0
dc.l 0
dc.l 0
dc.l 0
dc.l 0
generateVHSDrawTables
move.l mySpacePointer,a0
lea tableSizes,a6
move.l a0,(a6)+
move.l #%00000011111111110000000000000000,d0
jsr genVHSTab
move.l a0,(a6)+
move.l #%00000011111111100000000000000000,d0
jsr genVHSTab
move.l a0,(a6)+
move.l #%00000011111111000000000000000000,d0
jsr genVHSTab
move.l a0,(a6)+
move.l #%00000011111110000000000000000000,d0
jsr genVHSTab
move.l a0,(a6)+
move.l #%00000011111100000000000000000000,d0
jsr genVHSTab
move.l a0,(a6)+
move.l #%00000011111000000000000000000000,d0
jsr genVHSTab
move.l a0,(a6)+
move.l #%00000011110000000000000000000000,d0
jsr genVHSTab
move.l a0,(a6)+
move.l #%00000011100000000000000000000000,d0
jsr genVHSTab
move.l a0,(a6)+
move.l #%00000011000000000000000000000000,d0
jsr genVHSTab
move.l a0,(a6)+
move.l #%00000010000000000000000000000000,d0
jsr genVHSTab
move.l a0,(a6)+
move.l #%11111111111111111100000000000000,d0
jsr genVHSTab
rts
genVHSTab
moveq #0,d7
roxr.l d7
moveq #0,d1
move.w #104,d2
move.l d0,(a0)+
ror.l d0
move.w d2,(a0)+
move.w #144-16-4,d5
move.w #160,d4
move.w #20-1,d7
.l
move.w #16-1,d6
move.l d0,d1
.doLoop
move.l d1,(a0)+
move.w d2,(a0)+
subq.w #1,d5
bge .kk
move.l d1,d0
add.w d4,d2
jmp .kk2
.kk
ror.l d1
.kk2
dbra d6,.doLoop
tst.w d5
blt .skipadd
add.w #8,d2
.skipadd
dbra d7,.l
rts
;tables1
; dc.w 0,%0000001000000000,96 ;198 start ;6
;.off set 0
; REPT 20
; dc.w %0000000100000000,0,104+.off ;199
; dc.w %0000000010000000,0,104+.off ;200
; dc.w %0000000001000000,0,104+.off ;201
; dc.w %0000000000100000,0,104+.off ;202
; dc.w %0000000000010000,0,104+.off ;203
; dc.w %0000000000001000,0,104+.off ;204
; dc.w %0000000000000100,0,104+.off ;205
; dc.w %0000000000000010,0,104+.off ;206
; dc.w %0000000000000001,0,104+.off ;207
; dc.w 0,%1000000000000000,104+.off ;208
; dc.w 0,%0100000000000000,104+.off ;209
; dc.w 0,%0010000000000000,104+.off ;210
; dc.w 0,%0001000000000000,104+.off ;211
; dc.w 0,%0000100000000000,104+.off ;212
; dc.w 0,%0000010000000000,104+.off ;213
; dc.w 0,%0000001000000000,104+.off ;214 -- 16 20*16*6 = 1920 + 6 = 1926
;.off set .off+8
; ENDR
;
;tables2
; dc.w 0,%0000001100000000,96 ;198 start
;.off set 0
; REPT 20
; dc.w %0000000110000000,0,104+.off ;199
; dc.w %0000000011000000,0,104+.off ;200
; dc.w %0000000001100000,0,104+.off ;201
; dc.w %0000000000110000,0,104+.off ;202
; dc.w %0000000000011000,0,104+.off ;203
; dc.w %0000000000001100,0,104+.off ;204
; dc.w %0000000000000110,0,104+.off ;205
; dc.w %0000000000000011,0,104+.off ;206
; dc.w %0000000000000001,%1000000000000000,104+.off ;207
; dc.w 0,%1100000000000000,104+.off ;208
; dc.w 0,%0110000000000000,104+.off ;209
; dc.w 0,%0011000000000000,104+.off ;210
; dc.w 0,%0001100000000000,104+.off ;211
; dc.w 0,%0000110000000000,104+.off ;212
; dc.w 0,%0000011000000000,104+.off ;213
; dc.w 0,%0000001100000000,104+.off ;214 -- 16
;.off set .off+8
; ENDR
;
;tables3
; dc.w 0,%0000001110000000,96 ;198 start
;.off set 0
; REPT 20