-
Notifications
You must be signed in to change notification settings - Fork 1
/
TAKEEMIN_MAIN.s
1244 lines (1018 loc) · 30.9 KB
/
TAKEEMIN_MAIN.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
;*** TONY MANERO EFFECT!!
;*** MiniStartup by Photon ***
INCDIR "NAS:AMIGA/CODE/take_em_in_amiga/"
SECTION "Code",CODE
INCLUDE "Blitter-Register-List.S"
INCLUDE "PhotonsMiniWrapper1.04!.S"
INCLUDE "cli_output.s"
INCLUDE "PT12_OPTIONS.i"
INCLUDE "P6112-Play-stripped.i"
;********** Constants **********
w=640 ; screen width, height, depth
h=512
bpls=4 ; handy values:
bpl=w/16*2 ; byte-width of 1 bitplane line (80)
bwid=bpls*bpl ; byte-width of 1 pixel line (all bpls)
;*************
MODSTART_POS=0 ; start music at position # !! MUST BE EVEN FOR 16BIT
SCROLLFACTOR=8
;*************
;CLR.W $100 ; DEBUG | w 0 100 2
;********** Demo ********** ; Demo-specific non-startup code below.
Demo: ; a4=VBR, a6=Custom Registers Base addr
;*--- init ---*
MOVE.L #VBint,$6C(A4)
MOVE.W #%1110000000100000,INTENA
;** SOMETHING INSIDE HERE IS NEEDED TO MAKE MOD PLAY! **
;move.w #%1110000000000000,INTENA ; Master and lev6 ; NO COPPER-IRQ!
MOVE.W #%1000011111100000,DMACON
;*--- clear screens ---*
;lea SCREEN1,a1
;bsr.w ClearScreen
;lea SCREEN2,a1
;bsr.w ClearScreen
;bsr WaitBlitter
;*--- start copper ---*
LEA KONEYBG,A0
MOVEQ #bpl,D0
LEA COPPER1\.BplPtrs+2,A1
MOVEQ #bpls-1,D1
BSR.W PokePtrs
MOVEQ #bpl,D0
LEA COPPER2\.BplPtrs+2,A1
MOVEQ #bpls-1,D1
BSR.W PokePtrs
; #### Point LOGO sprites
LEA COPPER1\.SpritePointers,A1 ; Puntatori in copperlist
BSR.W __POKE_SPRITE_POINTERS
LEA COPPER2\.SpritePointers,A1 ; Puntatori in copperlist
BSR.W __POKE_SPRITE_POINTERS
; #### Point LOGO sprites
; #### Call P61_Init ####
MOVEM.L D0-A6,-(SP)
LEA MODULE,A0
SUB.L A1,A1
SUB.L A2,A2
MOVE.W #MODSTART_POS,P61_InitPos ; TRACK START OFFSET
JSR P61_Init
MOVEM.L (SP)+,D0-A6
; #### Call P61_Init ####
; #### POINT COPPERLISTS
BSR.W __POINT_COPPERLISTS
MOVE.W #$0515,$DFF190 ; POKE "K" WITH CPU
; #### POINT COPPERLISTS
;******************** main loop *********************
MainLoop:
move.w #$12c,d0 ;No buffering, so wait until raster
bsr.w WaitRaster ;is below the Display Window.
;*--- swap buffers ---*
movem.l DrawBuffer(PC),a2-a3
exg a2,a3
movem.l a2-a3,DrawBuffer ;draw into a2, show a3
;*--- show one... ---*
move.l a3,a0
move.l #bpl*h,d0
lea COPPER1\.BplPtrs+2,a1
moveq #bpls-1,d1
bsr.w PokePtrs
move.l a3,a0
ADD.L #bpl,A0 ; Oppure aggiungi la lunghezza di una linea
move.l #bpl*h,d0
lea COPPER2\.BplPtrs+2,a1
moveq #bpls-1,d1
bsr.w PokePtrs
;*--- ...draw into the other(a2) ---*
move.l a2,a1
;bsr ClearScreen
bsr WaitBlitter
; do stuff here :)
BSR.W __POPULATE_TXT_BUFFER
BSR.W __SCROLL_SPRITE_COLUMN
; ## SONG POS RESETS ##
MOVE.W P61_Pos,D6
MOVE.W P61_DUMMY_POS,D5
CMP.W D5,D6
BEQ.S .dontReset
ADDQ.W #1,P61_DUMMY_POS
ADDQ.W #1,P61_LAST_POS
.dontReset:
; ## SONG POS RESETS ##
SONG_BLOCKS_EVENTS:
; ## FOR TIMED EVENTS ON BLOCKS ##
MOVE.W P61_LAST_POS,D5
LEA TIMELINE,A3
LSL.W #2,D5 ; CALCULATES OFFSET (OPTIMIZED)
MOVE.L (A3,D5),A4 ; THANKS HEDGEHOG!!
JSR (A4) ; EXECUTE SUBROUTINE BLOCK#
ENDING_CODE:
;*--- main loop end ---*
BTST #6,$BFE001
BEQ.W .quit ; then loop
;BNE.S .DontShowRasterTime
;MOVE.W #$FF0,$180(A6) ; show rastertime left down to $12c
;.DontShowRasterTime:
BTST #2,$DFF016 ; POTINP - RMB pressed?
BNE.W MainLoop ; then loop
.quit:
;*--- exit ---*
BSR.W __SONG_POS_2_ASCII
; --- Call P61_End ---
MOVEM.L D0-A6,-(SP)
JSR P61_End
MOVEM.L (SP)+,D0-A6
RTS
;********** Demo Routines **********
PokePtrs: ; Generic, poke ptrs into copper list
.bpll:
move.l a0,d2
swap d2
move.w d2,(a1) ; high word of address
move.w a0,4(a1) ; low word of address
addq.w #8,a1 ; skip two copper instructions
add.l d0,a0 ; next ptr
dbf d1,.bpll
rts
ClearScreen: ; a1=screen destination address to clear
bsr WaitBlitter
clr.w $66(a6) ; destination modulo
move.l #$01000000,$40(a6) ; set operation type in BLTCON0/1
move.l a1,$54(a6) ; destination address
move.l #h*bpls*64+bpl/2,$58(a6) ;blitter operation size
rts
VBint: ; Blank template VERTB interrupt
movem.l d0/a6,-(sp) ; Save used registers
lea $dff000,a6
btst #5,$1f(a6) ; check if it's our vertb int.
beq.s .notvb
;*--- do stuff here ---*
moveq #$20,d0 ; poll irq bit
move.w d0,$9c(a6)
move.w d0,$9c(a6)
.notvb:
movem.l (sp)+,d0/a6 ; restore
rte
RTS
__SCROLL_SPRITE_COLUMN:
MOVEM.L D0-A6,-(SP) ; SAVE TO STACK
BTST.B #6,DMACONR ; for compatibility
; ## MAIN BLIT ####
.mainBlit:
BSR WaitBlitter
MOVE.W #$FFFF,BLTAFWM ; BLTAFWM lo spiegheremo dopo
MOVE.W #$FFFF,BLTALWM ; BLTALWM lo spiegheremo dopo
MOVE.W #%0000000000000000,BLTCON1 ; BLTCON1 BIT 12 DESC MODE
MOVE.W #0,BLTAMOD ; BLTAMOD =0 perche` il rettangolo
MOVE.W #0,BLTDMOD ; BLTDMOD 40-4=36 il rettangolo
.goBlitter:
MOVE.W #%0001100111110000,BLTCON0 ; BLTCON0 (usa A+D); con shift di un pixel
LEA SPRT_SCROLL_1\.visible,A4
MOVE.L A4,BLTAPTH ; BLTAPT (fisso alla figura sorgente)
LEA SPRT_SCROLL_2\.visible,A5
SUB.L #4,A5
MOVE.L A5,BLTDPTH ; CLONE TO SHADOW
MOVE.W #266*3*64+1,BLTSIZE ; BLTSIZE (via al blitter !)
BSR WaitBlitter
MOVE.W #%0000100111110000,BLTCON0 ; BLTCON0 (usa A+D); con shift di un pixel
;LEA SPRT_SCROLL_1\.visible,A4
MOVE.L A4,BLTAPTH ; BLTAPT (fisso alla figura sorgente)
SUB.L #4,A4
MOVE.L A4,BLTDPTH
;MOVE.W #(272+14<<6)+%00010101,BLTSIZE ; BLTSIZE (via al blitter !)
MOVE.W #266*3*64+1,BLTSIZE ; BLTSIZE (via al blitter !)
; ## MAIN BLIT ####
MOVEM.L (SP)+,D0-A6 ; FETCH FROM STACK
RTS
__POPULATE_TXT_BUFFER:
MOVEM.L D0-A6,-(SP) ; SAVE TO STACK
MOVE.W FRAMESINDEX,D7
CMP.W #SCROLLFACTOR,D7
BNE.W .SKIP
LEA SPRT_SCROLL_1\.hidden,A4
LEA FONT,A5
LEA TEXT,A6
ADD.W TEXTINDEX,A6
CMP.L #_TEXT-1,A6 ; Siamo arrivati all'ultima word della TAB?
BNE.S .PROCEED
MOVE.W #0,TEXTINDEX ; Riparti a puntare dalla prima word
LEA TEXT,A6 ; FIX FOR GLITCH (I KNOW IT'S FUN... :)
.PROCEED:
MOVE.B (A6),D2 ; Prossimo carattere in d2
SUB.B #$20,D2 ; TOGLI 32 AL VALORE ASCII DEL CARATTERE, IN
MULU.W #8,D2 ; MOLTIPLICA PER 8 IL NUMERO PRECEDENTE,
ADD.W D2,A5
MOVEQ #0,D6 ; RESET D6
MOVE.B #8-1,D6
.LOOP:
ADD.W #2,A4 ; POSITIONING
MOVE.B (A5)+,(A4)+ ; COPY NORMAL BITS
MOVE.B #%00000000,(A4)+ ; WRAPS MORE NICELY?
DBRA D6,.LOOP
ADD.W #2,A4 ; POSITIONING
MOVE.B #%00000000,(A4) ; WRAPS MORE NICELY?
.SKIP:
SUB.W #1,D7
CMP.W #0,D7
BEQ.W .RESET
MOVE.W D7,FRAMESINDEX
MOVEM.L (SP)+,D0-A6 ; FETCH FROM STACK
RTS
.RESET:
ADD.W #1,TEXTINDEX
MOVE.W #SCROLLFACTOR,FRAMESINDEX
MOVEM.L (SP)+,D0-A6 ; FETCH FROM STACK
RTS
__POKE_SPRITE_POINTERS:
MOVE.L #SPRT_K,D0 ; sprite 0
MOVE.W D0,6(A1)
SWAP D0
MOVE.W D0,2(A1)
ADDQ.W #8,A1
MOVE.L #SPRT_O,D0 ; sprite 1
MOVE.W D0,6(A1)
SWAP D0
MOVE.W D0,2(A1)
ADDQ.W #8,A1
MOVE.L #SPRT_N,D0 ; sprite 2
MOVE.W D0,6(A1)
SWAP D0
MOVE.W D0,2(A1)
ADDQ.W #8,A1
MOVE.L #SPRT_E,D0 ; sprite 3
MOVE.W D0,6(A1)
SWAP D0
MOVE.W D0,2(A1)
ADDQ.W #8,A1
MOVE.L #SPRT_Y,D0 ; sprite 4
MOVE.W D0,6(A1)
SWAP D0
MOVE.W D0,2(A1)
ADDQ.W #8,A1
MOVE.L #SPRT_SCROLL_1,D0 ; sprite 5
MOVE.W D0,6(A1)
SWAP D0
MOVE.W D0,2(A1)
ADDQ.W #8,A1
MOVE.L #SPRT_SCROLL_2,D0 ; sprite 6 SHADOW
MOVE.W D0,6(A1)
SWAP D0
MOVE.W D0,2(A1)
RTS
__POINT_COPPERLISTS:
MOVE.L #COPPER2,D0
LEA COPPER1\.CopJumpL,A0
MOVE.W D0,(A0)
LEA COPPER1\.CopJumpH,A0
SWAP D0
MOVE.W D0,(A0)
MOVE.L #COPPER1,D0
LEA COPPER2\.CopJumpL,A0
MOVE.W D0,(A0)
LEA COPPER2\.CopJumpH,A0
SWAP D0
MOVE.W D0,(A0)
SWAP D0
MOVE.W #$8000,$DFF02A ; FROM EAB
MOVE.L D0,COP1LC ; COP1LCH
RTS
__REVERSE_BASS_DIR:
MOVE.W BASS_DIRECTION,D7
CMP.W #1,D7
BEQ.S .skip
SWAP D0 ; TAKES REVERSE VALUE
.skip:
RTS
__SHUFFLE_TILES:
; ## CHANGE TILE EVERY BEAT ##
MOVE.W TILE_INDEX,D6
CMP.B #15,D5
BNE.S .dontUpdate
ADD.W #1,D6
;AND.W #7,D6 ; EVERY 7 RESET
CMPI.W #7,D6
BNE.S .dontReset
CLR D6
.dontReset:
MOVE.W D6,TILE_INDEX
.dontUpdate:
ADDQ.W #2,A1
ADDQ.W #2,A2
LSL.W #2,D6 ; CALCULATES OFFSET (OPTIMIZED)
ADD.W D6,A1
ADD.W D6,A2
RTS
__HW_DISPLACE:
MOVEM.L D0-D7/A0-A6,-(SP) ; SAVE TO STACK
CLR.L D2
MOVE.W $DFF006,D4 ; for bug?
.waitVisibleRaster:
MOVE.W $DFF006,D4
AND.W #$FF00,D4 ; read vertical beam
CMP.W #$3700,D4 ; 2C
BNE.S .waitVisibleRaster
.waitNextRaster:
MOVE.W $DFF006,D2
AND.W #$FF00,D2 ; read vertical beam
CMP.W D4,D2
BEQ.S .waitNextRaster
MOVE.W D2,D4
MOVE.B AUDIOCHLEVEL3,D5 ; $dff00a $dff00b for mouse pos
;MOVE.B $BFD800,D5
MOVE.W P61_rowpos,D1
EOR.B D1,D5
BCLR.L #$04,D5 ; ONLY UPPER PLANES
BCLR.L #$05,D5 ; ONLY UPPER PLANES
BCLR.L #$06,D5 ; ONLY UPPER PLANES
BCLR.L #$07,D5 ; ONLY UPPER PLANES
MOVE.W D5,BPLCON1 ; 19DEA68E GLITCHA
MOVE.W $DFF004,D0 ; Read vert most sig. bits
BTST #0,D0
BEQ.S .waitNextRaster
CMP.W #$0A00,D2 ; DONT DISPLACE TXT
BGE.S .dontSkip ; DONT DISPLACE TXT
MOVE.W #0,BPLCON1 ; RESET REGISTER
.dontSkip:
CMP.W #$2F00,D2 ; 12.032
BNE.S .waitNextRaster
MOVE.W #0,BPLCON1 ; RESET REGISTER
MOVEM.L (SP)+,D0-A6 ; FETCH FROM STACK
RTS
__SONG_POS_2_ASCII:
; ## TRANSFORM SONGPOS INTO ASCII TXT ##
;CLR.W $100 ; DEBUG | w 0 100 2
MOVE.W P61_LAST_POS,D5
ADDQ.W #1,D5 ; DONT SHOW 0 TO USER
CLR.L D6
MOVE.W D5,D6
DIVU.W #$A,D6
SWAP D6
MOVE.W D6,D5
SWAP D6
OR.B #48,D6 ; POINT TO CHAR 0
LSL.W #8,D6
OR.B #48,D5 ; POINT TO CHAR 0
OR.W D6,D5
MOVE.W D5,TXT_POS
RTS
; ## TRANSFORM SONGPOS INTO ASCII TXT ##
__SET_PT_VISUALS:
; ## MOD VISUALIZERS ##########
ifne visuctrs
;MOVEM.L D0-A6,-(SP)
; BASS
LEA P61_visuctr0(PC),A0 ; which channel? 0-3
MOVEQ #18,D0 ; maxvalue
SUB.W (A0),D0 ; -#frames/irqs since instrument trigger
BPL.S .ok0 ; below minvalue?
MOVEQ #0,D0 ; then set to minvalue
;MOVE.W BASS_DIRECTION,D7 ; ACTUAL DIRECTION OF BASS
;NOT D7 ; REVERSE DIR
;MOVE.W D7,BASS_DIRECTION ; PUT IT IN GLOBALZ
.ok0:
MOVE.B D0,AUDIOCHLEVEL0
BCLR.L #0,D0 ; MAKES INDEX EVEN
MOVE.W #18,D7 ; FIND THE "OPPOSITE"
SUB.W D0,D7 ; VALUE OF TAB
SWAP D0 ; NORMAL VALUE ON UPPER
MOVE.W D7,D0 ; (NOT MATH OPPOSITE)
_ok0:
; KICK
LEA P61_visuctr1(PC),A0 ; which channel? 0-3
MOVEQ #14,D1 ; maxvalue
SUB.W (A0),D1 ; -#frames/irqs since instrument trigger
BPL.S .ok1 ; below minvalue?
MOVEQ #0,D1 ; then set to minvalue
.ok1:
MOVE.B D1,AUDIOCHLEVEL1
BCLR.L #0,D1 ; MAKES INDEX EVEN
_ok1:
; HATZ
LEA P61_visuctr2(PC),A0 ; which channel? 0-3
MOVEQ #18,D2 ; maxvalue
SUB.W (A0),D2 ; -#frames/irqs since instrument trigger
BPL.S .ok2 ; below minvalue?
MOVEQ #0,D2 ; then set to minvalue
.ok2:
MOVE.B D2,AUDIOCHLEVEL2
BCLR.L #0,D2 ; MAKES INDEX EVEN
_ok2:
; DRUMZ
LEA P61_visuctr3(PC),A0 ; which channel? 0-3
MOVEQ #18,D3 ; maxvalue
SUB.W (A0),D3 ; -#frames/irqs since instrument trigger
BPL.S .ok3 ; below minvalue?
MOVEQ #0,D3 ; then set to minvalue
.ok3:
MOVE.B D3,AUDIOCHLEVEL3
BCLR.L #0,D3 ; MAKES INDEX EVEN
_ok3:
LEA COPPER1\.ColPokes,A1 ; OPTIMIZATIONS
LEA COPPER2\.ColPokes,A2 ; OPTIMIZATIONS
LEA COL_TAB_PURPLE,A3 ; OPTIMIZATIONS
LEA COL_TAB_WHITE,A4 ; OPTIMIZATIONS
LEA COL_TAB_BLACK,A5 ; OPTIMIZATIONS
LEA COL_TAB_GREY,A0 ; OPTIMIZATIONS
;MOVEM.L (SP)+,D0-A6
endc
RTS
; MOD VISUALIZERS *****
__BLK_X:
; 0: BEGIN
BSR.W __SET_PT_VISUALS
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A5,D1.W),14(A1) ; FX 1
MOVE.W (A5,D1.W),14(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),18(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),18(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D3.W),22(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D3.W),22(A1) ; 4(A2) FOR GLITCH!!
RTS
__BLK_0:
; 0: BEGIN
BSR.W __SET_PT_VISUALS
SWAP D0
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
; ## LOGO POSITIONIN ##
;MOVE.W P61_rowpos,D5
;CMPI.W #61,D5
;BGE.S .ok_K
;MOVE.B SPRT_K_POS,D7
;CMPI.B #$44,D7
;BEQ.S .ok_K
;ADD.B #1,SPRT_K_POS
.ok_K:
MOVE.W P61_rowpos,D5
CMPI.W #57,D5
BGE.S .ok_O
MOVE.B SPRT_O_POS,D7
CMPI.B #$4D,D7
BEQ.S .ok_O
ADD.B #1,SPRT_O_POS
ADD.B #1,SPRT_N_POS
ADD.B #1,SPRT_E_POS
ADD.B #1,SPRT_Y_POS
.ok_O:
MOVE.W P61_rowpos,D5
CMPI.W #51,D5
BGE.S .ok_N
MOVE.B SPRT_N_POS,D7
CMPI.B #$56,D7
BEQ.S .ok_N
ADD.B #1,SPRT_N_POS
ADD.B #1,SPRT_E_POS
ADD.B #1,SPRT_Y_POS
.ok_N:
MOVE.W P61_rowpos,D5
CMPI.W #45,D5
BGE.S .ok_E
MOVE.B SPRT_E_POS,D7
CMPI.B #$5F,D7
BEQ.S .ok_E
ADD.B #1,SPRT_E_POS
ADD.B #1,SPRT_Y_POS
.ok_E:
MOVE.W P61_rowpos,D5
CMPI.W #39,D5
BGE.S .ok_Y
MOVE.B SPRT_Y_POS,D7
CMPI.B #$68,D7
BEQ.S .ok_Y
ADD.B #1,SPRT_Y_POS
.ok_Y:
;MOVE.W (A5,D1.W),22(A1) ; FX 1
;MOVE.W (A5,D1.W),22(A2) ; 4(A2) FOR GLITCH!!
RTS
__BLK_1:
; 0: BEGIN
BSR.W __SET_PT_VISUALS
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A0,D1.W),26(A1) ; FX 1
MOVE.W (A0,D1.W),26(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D1.W),22(A1) ; FX 1
MOVE.W (A5,D1.W),22(A2) ; 4(A2) FOR GLITCH!!
RTS
__BLK_2:
; 0: BEGIN
BSR.W __SET_PT_VISUALS
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A0,D1.W),26(A1) ; FX 1
MOVE.W (A0,D1.W),26(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D1.W),22(A1) ; FX 1
MOVE.W (A0,D1.W),22(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),14(A1) ; FX 1
MOVE.W (A5,D2.W),14(A2) ; 4(A2) FOR GLITCH!!
RTS
__BLK_3:
; 0: BEGIN
BSR.W __SET_PT_VISUALS
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A0,D1.W),26(A1) ; FX 1
MOVE.W (A0,D1.W),26(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),14(A1) ; FX 1
MOVE.W (A5,D2.W),14(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D3.W),10(A1) ; FX 1
MOVE.W (A5,D3.W),10(A2) ; 4(A2) FOR GLITCH!!
RTS
__BLK_4:
; 0: BEGIN
BSR.W __SET_PT_VISUALS
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A5,D1.W),26(A1) ; FX 1
MOVE.W (A0,D1.W),26(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),6(A1) ; FX 1
MOVE.W (A4,D2.W),6(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D3.W),22(A1) ; FX 1
MOVE.W (A5,D3.W),22(A2) ; 4(A2) FOR GLITCH!!
RTS
__BLK_5:
; 0: BEGIN
BSR.W __SET_PT_VISUALS
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A5,D1.W),22(A1) ; FX 1
MOVE.W (A5,D1.W),22(A2) ; 4(A2) FOR GLITCH!!
ADDQ.W #8,A0 ; CHANGE COLOR
MOVE.W (A0,D3.W),18(A1) ; FX 1
MOVE.W (A0,D3.W),18(A2) ; 4(A2) FOR GLITCH!!
RTS
__BLK_5_2:
; 0: BEGIN
BSR.W __SET_PT_VISUALS
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A5,D2.W),2(A1) ; FX 1
MOVE.W (A5,D2.W),2(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D1.W),22(A1) ; FX 1
MOVE.W (A5,D1.W),22(A2) ; 4(A2) FOR GLITCH!!
ADDQ.W #8,A0 ; CHANGE COLOR
MOVE.W (A0,D3.W),18(A1) ; FX 1
MOVE.W (A0,D3.W),18(A2) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
MOVE.B AUDIOCHLEVEL3,D5
MOVE.W P61_rowpos,D7
CMPI.W #15,D7
BGE.S .noFx
MOVE.B AUDIOCHLEVEL2,D5
BSR.W __SHUFFLE_TILES
MOVE.W (A0,D2.W),(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),(A2) ; 4(A2) FOR GLITCH!!
.noFx:
RTS
__BLK_6:
; 29: KASSONE!
BSR.W __SET_PT_VISUALS
SWAP D0
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A5,D2.W),2(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),2(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D1.W),6(A1) ; FX 1
MOVE.W (A4,D1.W),6(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),10(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),10(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D1.W),14(A1) ; FX 1
MOVE.W (A5,D1.W),14(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),18(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),18(A2) ; 4(A2) FOR GLITCH!!
ADDQ.W #8,A0 ; CHANGE COLOR
MOVE.W (A0,D3.W),22(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D3.W),22(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D0.W),26(A1) ; FX 1
MOVE.W (A4,D0.W),26(A2) ; 4(A2) FOR GLITCH!!
RTS
__BLK_7:
; 29: KASSONE!
BSR.W __SET_PT_VISUALS
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A5,D1.W),2(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D1.W),2(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),6(A1) ; FX 1
MOVE.W (A4,D3.W),6(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D3.W),10(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D3.W),10(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D1.W),14(A1) ; FX 1
MOVE.W (A4,D1.W),14(A2) ; 4(A2) FOR GLITCH!!
ADDQ.W #8,A0 ; CHANGE COLOR
MOVE.W (A0,D2.W),18(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),18(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D3.W),22(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D3.W),22(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),26(A1) ; FX 1
MOVE.W (A4,D2.W),26(A2) ; 4(A2) FOR GLITCH!!
RTS
__BLK_8:
; 0: BEGIN
BSR.W __SET_PT_VISUALS
;MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A0,D1.W),26(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D1.W),26(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D3.W),6(A1) ; FX 1
MOVE.W (A5,D3.W),6(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D1.W),14(A1) ; FX 1
MOVE.W (A4,D1.W),14(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D3.W),18(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D3.W),18(A2) ; 4(A2) FOR GLITCH!!
ADDQ.W #8,A0 ; CHANGE COLOR
MOVE.W (A0,D2.W),22(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),22(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D3.W),10(A1) ; FX 1
MOVE.W (A4,D3.W),10(A2) ; 4(A2) FOR GLITCH!!
;MOVE.W (A3,D0.W),2(A1) ; 4(A2) FOR GLITCH!!
;MOVE.W (A3,D0.W),2(A2) ; 4(A2) FOR GLITCH!!
RTS
__BLK_9:
; 0: BEGIN
BSR.W __SET_PT_VISUALS
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A5,D3.W),2(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),2(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D1.W),26(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D1.W),26(A2) ; 4(A2) FOR GLITCH!!
ADDQ.W #8,A0 ; CHANGE COLOR
MOVE.W (A0,D3.W),10(A1) ; FX 1
MOVE.W (A0,D3.W),10(A2) ; 4(A2) FOR GLITCH!!
MOVE.W P61_rowpos,D5
CMPI.W #15,D5
BGE.S .noFx
MOVE.W (A4,D1.W),6(A1) ; FX 1
MOVE.W (A4,D2.W),6(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D1.W),14(A1) ; FX 1
MOVE.W (A5,D2.W),14(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),18(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D1.W),18(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),22(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),22(A1) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
MOVE.B AUDIOCHLEVEL2,D5
BSR.W __SHUFFLE_TILES
MOVE.W (A4,D2.W),(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),(A2) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
.noFx:
RTS
__BLK_A:
; 29: KASSONE!
BSR.W __SET_PT_VISUALS
MOVE.W (A5,D1.W),2(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D1.W),2(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),6(A1) ; FX 1
MOVE.W (A0,D3.W),6(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),10(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),10(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),14(A1) ; FX 1
MOVE.W (A0,D2.W),14(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D3.W),18(A1) ; FX 1
MOVE.W (A5,D3.W),18(A2) ; 4(A2) FOR GLITCH!!
ADDQ.W #8,A0 ; CHANGE COLOR
MOVE.W (A0,D0.W),22(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D0.W),22(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D3.W),26(A1) ; FX 1
MOVE.W (A0,D3.W),26(A2) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
MOVE.B AUDIOCHLEVEL3,D5
BSR.W __SHUFFLE_TILES
MOVE.W (A3,D3.W),(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A3,D3.W),(A2) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
ADDQ.W #8,A3 ; CHANGE COLOR
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
RTS
__BLK_B:
; 29: KASSONE!
BSR.W __SET_PT_VISUALS
MOVE.W (A5,D1.W),2(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D1.W),2(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),6(A1) ; FX 1
MOVE.W (A0,D3.W),6(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),10(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),10(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),14(A1) ; FX 1
MOVE.W (A0,D2.W),14(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D3.W),18(A1) ; FX 1
MOVE.W (A5,D3.W),18(A2) ; 4(A2) FOR GLITCH!!
ADDQ.W #8,A0 ; CHANGE COLOR
MOVE.W (A0,D0.W),22(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D0.W),22(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D3.W),26(A1) ; FX 1
MOVE.W (A0,D3.W),26(A2) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
MOVE.B AUDIOCHLEVEL3,D5
MOVE.W P61_rowpos,D7
CMPI.W #15,D7
BGE.S .noFx
MOVE.B AUDIOCHLEVEL2,D5
MOVE.W D2,D3
ADDQ.W #8,A3 ; CHANGE COLOR
.noFx:
BSR.W __SHUFFLE_TILES
MOVE.W (A3,D3.W),(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A3,D3.W),(A2) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
RTS
__BLK_C:
; 33 20: SAle
BSR.W __SET_PT_VISUALS
MOVE.W (A5,D1.W),2(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),2(A2) ; 4(A2) FOR GLITCH!!
MOVE.W P61_rowpos,D7
CMPI.W #57,D7
BLO.S .noFx
MOVE.W (A4,D3.W),$DFF190 ; POKE "K" WITH CPU
BSR.W __HW_DISPLACE ; FOR CRASH
.noFx:
; ## CHANGE TILE EVERY BEAT ##
MOVE.B AUDIOCHLEVEL2,D5
BSR.W __SHUFFLE_TILES
MOVE.W (A4,D2.W),(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),(A2) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
RTS
__BLK_D:
; 33 20: SAle
BSR.W __SET_PT_VISUALS
;MOVE.W (A4,D3.W),$DFF190 ; POKE "K" WITH CPU
;MOVE.W (A0,D1.W),2(A1) ; 4(A2) FOR GLITCH!!
;MOVE.W (A0,D2.W),2(A2) ; 4(A2) FOR GLITCH!!
;MOVE.W (A0,D1.W),6(A1) ; 4(A2) FOR GLITCH!!
;MOVE.W (A0,D1.W),6(A2) ; 4(A2) FOR GLITCH!!
;MOVE.W (A5,D2.W),10(A1) ; 4(A2) FOR GLITCH!!
;MOVE.W (A5,D2.W),10(A2) ; 4(A2) FOR GLITCH!!
;MOVE.W (A5,D3.W),26(A1) ; 4(A2) FOR GLITCH!!
;MOVE.W (A5,D3.W),26(A2) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
MOVE.B AUDIOCHLEVEL2,D5
BSR.W __SHUFFLE_TILES
MOVE.W (A4,D3.W),(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),(A2) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
MOVE.W P61_rowpos,D7
CMPI.W #32,D7
BLO.S .noFx
MOVE.W (A4,D2.W),(A1) ; TILE AS BLOCK_C
.noFx:
RTS
__BLK_E:
; 33 20: SAle
BSR.W __SET_PT_VISUALS
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU
MOVE.W (A4,D1.W),2(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),2(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D1.W),6(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),6(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),10(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D2.W),10(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),14(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),14(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D1.W),26(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D1.W),26(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D3.W),18(A1) ; FX 1
MOVE.W (A0,D3.W),18(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),22(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D1.W),22(A1) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
MOVE.B AUDIOCHLEVEL2,D5
BSR.W __SHUFFLE_TILES
MOVE.W (A4,D2.W),(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),(A2) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
RTS
__BLK_F:
; 29: KASSONE!
BSR.W __SET_PT_VISUALS
MOVE.W (A5,D1.W),6(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D1.W),6(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D2.W),2(A1) ; FX 1
MOVE.W (A0,D3.W),2(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),18(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A4,D2.W),18(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D0.W),22(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D0.W),22(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A5,D3.W),10(A1) ; FX 1
MOVE.W (A5,D3.W),10(A2) ; 4(A2) FOR GLITCH!!
ADDQ.W #8,A0 ; CHANGE COLOR
MOVE.W (A0,D2.W),14(A1) ; FX 1
MOVE.W (A0,D2.W),14(A2) ; 4(A2) FOR GLITCH!!
MOVE.W (A0,D3.W),26(A1) ; FX 1
MOVE.W (A0,D3.W),26(A2) ; 4(A2) FOR GLITCH!!
ADDQ.W #8,A3 ; CHANGE COLOR
; ## CHANGE TILE EVERY BEAT ##
MOVE.B AUDIOCHLEVEL3,D5
BSR.W __SHUFFLE_TILES
MOVE.W (A3,D3.W),(A1) ; 4(A2) FOR GLITCH!!
MOVE.W (A3,D3.W),(A2) ; 4(A2) FOR GLITCH!!
; ## CHANGE TILE EVERY BEAT ##
ADDQ.W #8,A3 ; CHANGE COLOR
MOVE.W (A3,D0.W),$DFF190 ; POKE "K" WITH CPU