-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathqsound_dl-1425.asm
1972 lines (1884 loc) · 71.1 KB
/
qsound_dl-1425.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
; PIOC (Parallel I/O Control Register): always set to 0x3800/0x3820
; bits 15 (0x8000): same as bit 4
; bits 13-14 (0x6000) = 1: strobe 2T
; bit 12 (0x1000) = 1: PODS is output
; bit 11 (0x0800) = 1: PIDS is output
; bit 10 (0x0400) = 0: Status/Control mode off
; bit 9 (0x0200) = 0: IBF interrupt disabled
; bit 8 (0x0100) = 0: OBE interrupt disabled
; bit 7 (0x0080) = 0: PIDS interrupt disabled
; bit 6 (0x0040) = 0: PODS interrupt disabled
; bit 5 (0x0020) = 0/1: INT interrupt disabled/enabled
; bit 4 (0x0010): IBF interrupt status
; bit 3 (0x0008): OBE interrupt status
; bit 2 (0x0004): PIDS interrupt status
; bit 1 (0x0002): PODS interrupt status
; bit 0 (0x0001): INT interrupt status
;
; SIOC (Serial I/O Control Register): always set to 0x02E8
; bit 9 (0x0200) = 1: active ILD/OLD = OutCLK / 16, active SYNC = OutCLK/128 or OCK/256
; bits 8-7 (0x0180) = 1: active clock = CKI / 12
; bit 6 (0x0040) = 1; MSB first
; bit 5 (0x0020) = 1: OutLoad is output
; bit 4 (0x0010) = 0: InLoad is input
; bit 3 (0x0008) = 1: OutCLK is output
; bit 2 (0x0004) = 0: InCLK is input
; bit 1 (0x0002) = 0: 16-bit output
; bit 0 (0x0001) = 0: 16-bit input
;
; AUC (Arithmetic Unit Control Register): set to 0x02/0x08/0x0C
; bit 6 (0x40) = 0; enable clearing YL
; bit 5 (0x20) = 0: enable clearing A1L
; bit 4 (0x10) = 0: enable clearing A0L
; bit 3 (0x08) = 0/1: enable/disable A1 saturation on overflow
; bit 2 (0x04) = 0/1: enable/disable A0 saturation on overflow
; bits 0-1 (0x03) = 0/2: set alignment - 0: Ax = p, 2: Ax = p*4
0:000: 0288 goto 0x0288 ; main
interrupt:
0:001: 5150 0001 c0 = 0x0001 ; set interrupt counter to 1
0:003: 45d0 a0 = pdx0
0:004: 30c0 nop, *r0
0:005: 30c0 nop, *r0
0:006: 45d0 a0 = pdx0 ; read destination offset
0:007: 30c0 nop, *r0
0:008: 30c0 nop, *r0
0:009: 4800 r0 = a0
0:00a: 61d0 *r0 = pdx0 ; read data and write to destination
0:00b: c100 ireturn
0:00c: 5110 0001 y = 0x0001
0:00e: 0011 goto 0x0011
0:00f: 5110 0400 y = 0x0400
0:011: 5130 000c auc = 0x000c ; disable alignment, disable A0 saturation, disable A1 saturation
0:013: 5020 00e3 move r2 = 0x00e3
0:015: 5010 0018 move r1 = 0x0018
0:017: 6018 *r2 = r1 ; set main offset = 0x0018 update_dummy
update_dummy:
0:018: 51c0 3820 pioc = 0x3820 ; enable INT interrupts
0:01a: 31a0 a0 = a0+y, *r0
0:01b: 51c0 3800 pioc = 0x3800 ; disable INT interrupts
0:01d: 51e0 0000 pdx1 = 0x0000
0:01f: 49a0 sdx = a0
0:020: 717f do 127 { 0x0021...0x0022 }
0:021: 9e0e a1 = a1>>1
0:022: 9e0e a1 = a1>>1
0:023: 51d0 0000 pdx0 = 0x0000
0:025: 49a0 sdx = a0
0:026: 717f do 127 { 0x0027...0x0028 }
0:027: 9e0e a1 = a1>>1
0:028: 9e0e a1 = a1>>1
0:029: 51e0 0000 pdx1 = 0x0000
0:02b: 49a0 sdx = a0
0:02c: 717f do 127 { 0x002d...0x002e }
0:02d: 9e0e a1 = a1>>1
0:02e: 9e0e a1 = a1>>1
0:02f: 51d0 0000 pdx0 = 0x0000
0:031: 49a0 sdx = a0
0:032: 70ff do 127 { 0x0033 }
0:033: 9e0e a1 = a1>>1
0:034: 707f redo 127
0:035: 707f redo 127
0:036: 703f redo 63
0:037: 7898 pr = *r2 ; return offset = (*0x00E3)
0:038: c000 return
copy_filter_data_1:
0:039: 5020 02b5 move r2 = 0x02b5
0:03b: 5030 00da move r3 = 0x00da
0:03d: 788c pt = *r3 ; set ROM Table Pointer = *0x00DA
0:03e: 715f do 95 { 0x003f...0x0040 } ; loop for pt = *0x00DA..+0x5E, R2 = 0x02B5..0x313
0:03f: c8c0 y = a0, x = *pt++ ; X = ROM[*0x00DA + n]
0:040: 6109 move *r2++ = x ; RAM[0x02B5 + n] = X
0:041: 5020 0314 move r2 = 0x0314
0:043: 5030 00dc move r3 = 0x00dc
0:045: 788c pt = *r3 ; set ROM Table Pointer = *0x00DC
0:046: 715f do 95 { 0x0047...0x0048 } ; loop for pt = *0x00DC..+0x5E, R2 = 0x02B5..0x313
0:047: c8c0 y = a0, x = *pt++ ; X = ROM[*0x00DC + n]
0:048: 6109 move *r2++ = x ; RAM[0x0314 + n] = X
0:049: 5020 00e3 move r2 = 0x00e3
0:04b: 5030 0314 move r3 = 0x0314
0:04d: 6038 *r2 = r3 ; set main offset = 0x0314 update_loop_1
0:04e: 0314 goto 0x0314 ; update_loop_1
copy_filter_data_2:
0:04f: 5020 02a9 move r2 = 0x02a9
0:051: 5030 00da move r3 = 0x00da
0:053: 788d pt = *r3++
0:054: 712d do 45 { 0x0055...0x0056 }
0:055: c8c0 y = a0, x = *pt++
0:056: 6109 move *r2++ = x
0:057: 5020 02d6 move r2 = 0x02d6
0:059: 788d pt = *r3++
0:05a: 712c do 44 { 0x005b...0x005c }
0:05b: c8c0 y = a0, x = *pt++
0:05c: 6109 move *r2++ = x
0:05d: 5020 0302 move r2 = 0x0302
0:05f: 788d pt = *r3++
0:060: 712d do 45 { 0x0061...0x0062 }
0:061: c8c0 y = a0, x = *pt++
0:062: 6109 move *r2++ = x
0:063: 5020 032f move r2 = 0x032f
0:065: 788c pt = *r3
0:066: 712c do 44 { 0x0067...0x0068 }
0:067: c8c0 y = a0, x = *pt++
0:068: 6109 move *r2++ = x
0:069: 5020 00e3 move r2 = 0x00e3
0:06b: 5030 06b2 move r3 = 0x06b2
0:06d: 6038 *r2 = r3 ; set main offset = 0x06B2 update_loop_2
0:06e: 06b2 goto 0x06b2 ; update_loop_2
dw dup (0x0000) times 0xA1
PanTable_FrontL:
0:110 dw 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000
0:118 dw 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000
0:120 dw 0xC000, 0xC666, 0xCCCD, 0xD28F, 0xD70A, 0xDC29, 0xDEB8, 0xE3D7
0:128 dw 0xE7AE, 0xEB96, 0xEE14, 0xF148, 0xF333, 0xF571, 0xF7AE, 0xF8F6
0:130 dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:138 dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:140 dw 0xC005, 0xC02E, 0xC07F, 0xC0F9, 0xC19B, 0xC264, 0xC355, 0xC46D
0:148 dw 0xC5AA, 0xC70C, 0xC893, 0xCA3D, 0xCC09, 0xCDF6, 0xD004, 0xD22F
0:150 dw 0xD22F, 0xD478, 0xD6DD, 0xD95B, 0xDBF3, 0xDEA1, 0xE164, 0xE43B
0:158 dw 0xE724, 0xEA1C, 0xED23, 0xF035, 0xF352, 0xF676, 0xF9A1, 0xFCCF
0:160 dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:168 dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:170 dw 0x0000, 0x0000
0:172 dw 0x0000, 0xF99A, 0xF852, 0xF666, 0xF47B, 0xF28F, 0xF000, 0xEDC3
0:17A dw 0xECCD, 0xEC00, 0xEA8F, 0xE800, 0xE28F, 0xDD81, 0xDB85, 0xD99A
0:182 dw 0xD800, 0xD7AE, 0xD70A, 0xD6B8, 0xD666, 0xD1EC, 0xD000, 0xD000
0:18A dw 0xCF0A, 0xCE98, 0xCE14, 0xCDE3, 0xCD71, 0xCCCD, 0xCB96, 0xC8F6
0:192 dw 0xC000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:19A dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:1A2 dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:1AA dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:1B2 dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:1BA dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:1C2 dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:1CA dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:1D2 dw 0x0000, 0x0000
PanTable_FrontR:
0:1D4 dw 0x0000, 0xF8F6, 0xF7AE, 0xF571, 0xF333, 0xF148, 0xEE14, 0xEB96
0:1DC dw 0xE7AE, 0xE3D7, 0xDEB8, 0xDC29, 0xD70A, 0xD28F, 0xCCCD, 0xC666
0:1E4 dw 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000
0:1EC dw 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000, 0xC000
0:1F4 dw 0xC000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:1FC dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:204 dw 0x0000, 0xFCCF, 0xF9A1, 0xF676, 0xF352, 0xF035, 0xED23, 0xEA1C
0:20C dw 0xE724, 0xE43B, 0xE164, 0xDEA1, 0xDBF3, 0xD95B, 0xD6DD, 0xD478
0:214 dw 0xD22F, 0xD22F, 0xD004, 0xCDF6, 0xCC09, 0xCA3D, 0xC893, 0xC70C
0:21C dw 0xC5AA, 0xC46D, 0xC355, 0xC264, 0xC19B, 0xC0F9, 0xC07F, 0xC02E
0:224 dw 0xC005, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:22C dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:234 dw 0x0000, 0x0000
0:236 dw 0xC000, 0xC8F6, 0xCB96, 0xCCCD, 0xCD71, 0xCDE3, 0xCE14, 0xCE98
0:23E dw 0xCF0A, 0xD000, 0xD000, 0xD1EC, 0xD666, 0xD6B8, 0xD70A, 0xD7AE
0:246 dw 0xD800, 0xD99A, 0xDB85, 0xDD81, 0xE28F, 0xE800, 0xEA8F, 0xEC00
0:24E dw 0xECCD, 0xEDC3, 0xF000, 0xF28F, 0xF47B, 0xF666, 0xF852, 0xF99A
0:256 dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:25E dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:266 dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:26E dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:276 dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:27E dw 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000
0:286 dw 0x0000, 0x0000
main:
0:288: 51c0 3800 pioc = 0x3800 ; disable INT interrupts
0:28a: 5110 0000 y = 0x0000
0:28c: 1800 set r0 = 0x000
0:28d: 70ff do 127 { 0x028e } ; clear words 0000-007E
0:28e: a0d1 au *r0++ = y
0:28f: 707f redo 127 ; clear words 007F-00FE
0:290: 707f redo 127
0:291: 707f redo 127
0:292: 707f redo 127
0:293: 707f redo 127
0:294: 707f redo 127
0:295: 707f redo 127
0:296: 707f redo 127
0:297: 707f redo 127
0:298: 707f redo 127
0:299: 707f redo 127
0:29a: 707f redo 127
0:29b: 707f redo 127
0:29c: 707f redo 127
0:29d: 707f redo 127
0:29e: 7010 redo 16 ; clear words 07F0-07FFF
0:29f: 5000 00e3 move r0 = 0x00e3
0:2a1: 5010 0314 move r1 = 0x0314
0:2a3: 6010 *r0 = r1 ; set main offset = 0x0314 update_loop_1
0:2a4: 5180 02e8 sioc = 0x02e8 ; setup Serial I/O
0:2a6: 51c0 3800 pioc = 0x3800 ; setup Parallel I/O, disable INT interrupts
0:2a8: 5110 0120 y = 0x0120 ; pan 0x120 = centre (PanTable_FrontL + 0x010)
0:2aa: 5000 0080 move r0 = 0x0080 ; 0080: pan position
0:2ac: 7093 do 19 { 0x02ad } ; set pan position of 19 channels (19??)
0:2ad: a0d1 au *r0++ = y
0:2ae: 50b0 0000 i = 0x0000
0:2b0: 5110 0000 y = 0x0000
0:2b2: 3040 p = x*y, *r0
0:2b3: 1008 set j = 0x008
0:2b4: 19f9 set r0 = 0x1f9
0:2b5: 5010 0123 move r1 = 0x0123
0:2b7: 6004 *r1 = r0 ; *0x0123 = 0x01F9
0:2b8: 5000 0257 move r0 = 0x0257
0:2ba: 5010 0124 move r1 = 0x0124
0:2bc: 6004 *r1 = r0 ; *0x0124 = 0x0257
0:2bd: 5000 0373 move r0 = 0x0373
0:2bf: 5010 0120 move r1 = 0x0120
0:2c1: 6004 *r1 = r0 ; *0x0120 = 0x0373
0:2c2: 5000 0554 move r0 = 0x0554
0:2c4: 5010 011f move r1 = 0x011f
0:2c6: 6004 *r1 = r0 ; *0x011F = 0x0554
0:2c7: 5000 00d9 move r0 = 0x00d9
0:2c9: 5110 055a y = 0x055a
0:2cb: a0d0 au *r0 = y ; *0x0D9 = 0x055A
0:2cc: 1b25 set r1 = 0x125
0:2cd: 192d set r0 = 0x12d
0:2ce: 6005 *r1++ = r0 ; *0x125 = 0x012D
0:2cf: 1b27 set r1 = 0x127
0:2d0: 1960 set r0 = 0x160
0:2d1: 6005 *r1++ = r0 ; *0x127 = 0x0160
0:2d2: 1b29 set r1 = 0x129
0:2d3: 1993 set r0 = 0x193
0:2d4: 6005 *r1++ = r0 ; *0x129 = 0x0193
0:2d5: 1b2b set r1 = 0x12b
0:2d6: 19c6 set r0 = 0x1c6
0:2d7: 6005 *r1++ = r0 ; *0x12B = 0X01C6
0:2d8: 18de set r0 = 0x0de
0:2d9: 5110 0000 y = 0x0000
0:2db: a0d1 au *r0++ = y ; *0x0DE = 0x0000
0:2dc: 5110 002e y = 0x002e
0:2de: a0d1 au *r0++ = y ; *0x0DF = 0x002E
0:2df: 5110 0000 y = 0x0000
0:2e1: a0d1 au *r0++ = y ; *0x0E0 = 0x0000
0:2e2: 5110 0030 y = 0x0030
0:2e4: a0d1 au *r0++ = y ; *0x0E1 = 0x0030
0:2e5: 5010 00e2 move r1 = 0x00e2 ; filter refresh flag offset for filter_refresh routine
0:2e7: 85dd call 0x05dd ; filter_refresh_1
0:2e8: 5000 00e4 move r0 = 0x00e4
0:2ea: 5110 3fff y = 0x3fff
0:2ec: 7084 do 4 { 0x02ed } ; set *0x00E4..*0x00E7 = 0x3FFF
0:2ed: a0d1 au *r0++ = y
0:2ee: 5000 0000 move r0 = 0x0000
0:2f0: 1008 set j = 0x008
0:2f1: 5110 8000 y = 0x8000
0:2f3: 7090 do 16 { 0x02f4 } ; set *0x0000/*0x0008/.../*0x0078 = 0x8000
0:2f4: a0d3 au *r0++j = y
0:2f5: 5190 00ff srta = 0x00ff ; Serial Receive Address = 0x00, Serial Transmit Address = 0xFF
0:2f7: 5180 02e8 sioc = 0x02e8 ; setup Serial I/O
0:2f9: 51c0 3800 pioc = 0x3800 ; disable INT interrupts
0:2fb: 1202 set k = 0x002
0:2fc: 5130 0008 auc = 0x0008 ; disable alignment, enable A0 saturation, disable A1 saturation
0:2fe: 5000 00cc move r0 = 0x00cc
0:300: 5110 8000 y = 0x8000
0:302: a0d0 au *r0 = y ; *0x00CC = 0x8000
0:303: 5000 00d0 move r0 = 0x00d0
0:305: a0d0 au *r0 = y ; *0x00D0 = 0x8000
0:306: 5000 00d4 move r0 = 0x00d4
0:308: a0d0 au *r0 = y ; *0x00D4 = 0x8000
0:309: 5000 00da move r0 = 0x00da
0:30b: 5010 0db2 move r1 = 0x0db2
0:30d: 6010 *r0 = r1 ; *0x00DA = 0x0DB2
0:30e: 5000 00dc move r0 = 0x00dc
0:310: 5010 0e11 move r1 = 0x0e11
0:312: 6010 *r0 = r1 ; *0x00DC = 0x0E11
0:313: 0039 goto 0x0039 ; copy_filter_data_1
update_loop_1:
0:314: 5130 0008 auc = 0x0008 ; disable alignment, enable A0 saturation, disable A1 saturation
0:316: 18f1 set r0 = 0x0f1
0:317: 1acb set r1 = 0x0cb
0:318: 3c90 a1 = p, a0 = *r0
0:319: bef4 a1 = a1-p, y = *r1
0:31a: 3160 a0-y, *r0
0:31b: d003 031f if ne goto 0x031f
0:31d: 18e8 set r0 = 0x0e8
0:31e: 20d0 *r0 = a1
0:31f: 18d6 set r0 = 0x0d6
0:320: b890 a0 = p, y = *r0
0:321: 998e if true a0 = y
0:322: d002 0333 if eq goto 0x0333
0:324: 1b1a set r1 = 0x11a
0:325: 20d4 *r1 = a1
0:326: 20d0 *r0 = a1
0:327: 1aeb set r1 = 0x0eb
0:328: 5110 000a y = 0x000a
0:32a: a0d4 au *r1 = y
0:32b: 1ecd set r3 = 0x0cd
0:32c: 1ae8 set r1 = 0x0e8
0:32d: b8dc au y = *r3
0:32e: a0d4 au *r1 = y
0:32f: 1eca set r3 = 0x0ca
0:330: 1af1 set r1 = 0x0f1
0:331: b8dc au y = *r3
0:332: a0d4 au *r1 = y
0:333: 18cc set r0 = 0x0cc
0:334: 7880 pt = *r0
0:335: 18f1 set r0 = 0x0f1
0:336: 3cd0 a0 = *r0
0:337: d850 p = x*y, y = a1, x = *pt++i
0:338: 49e0 pdx1 = a0
0:339: 1cf4 set r2 = 0x0f4
0:33a: 1ee8 set r3 = 0x0e8
0:33b: 30c0 nop, *r0
0:33c: 30c0 nop, *r0
0:33d: 30c0 nop, *r0
0:33e: 1b1a set r1 = 0x11a
0:33f: e0d0 *r0 = a0
0:340: 18eb set r0 = 0x0eb
0:341: f850 p = x*y, y = *r0, x = *pt++i
0:342: 4500 move a0 = x
0:343: 984e a0 = a0>>4
0:344: 988e a0 = a0>>8
0:345: e0d8 *r2 = a0 ; *r2 = leftmost nibble of X (sign-extended)
0:346: b0c8 au x = *r2
0:347: 3c50 p = x*y, a0 = *r0
0:348: 980e a0 = a0>>1
0:349: 9d0e if true a1 = p
0:34a: 99f1 if le a0 = -a0
0:34b: 38c4 a1l = *r1
0:34c: b6ac a1 = a1+p, x = *r3
0:34d: 4920 move yl = a0
0:34e: 3fb8 a1 = a1+y, a0 = *r2
0:34f: 9eee a1 = a1<<16
0:350: 5910 move y = a1
0:351: 3040 p = x*y, *r0
0:352: 9d0e if true a1 = p
0:353: 20d4 *r1 = a1
0:354: 5110 09e4 y = 0x09e4
0:356: 31a0 a0 = a0+y, *r0
0:357: 4880 pt = a0
0:358: f840 p = x*y, y = *r0, x = *pt++
0:359: 3040 p = x*y, *r0
0:35a: 990e if true a0 = p
0:35b: 98ae a0 = a0<<8
0:35c: 982e a0 = a0<<1
0:35d: 982e a0 = a0<<1
0:35e: 5110 0001 y = 0x0001
0:360: 3160 a0-y, *r0
0:361: 9991 if le a0 = y
0:362: 5110 07d0 y = 0x07d0
0:364: 3160 a0-y, *r0
0:365: 9981 if pl a0 = y
0:366: e0d0 *r0 = a0
0:367: 8504 call 0x0504 ; do_sample_1
0:368: 50b0 0000 i = 0x0000
0:36a: 30c0 nop, *r0
0:36b: 30c0 nop, *r0
0:36c: 30c0 nop, *r0
0:36d: 30c0 nop, *r0
0:36e: 30c0 nop, *r0
0:36f: 5130 0008 auc = 0x0008 ; disable alignment, enable A0 saturation, disable A1 saturation
0:371: 18f2 set r0 = 0x0f2
0:372: 1acf set r1 = 0x0cf
0:373: 3c90 a1 = p, a0 = *r0
0:374: bef4 a1 = a1-p, y = *r1
0:375: 3160 a0-y, *r0
0:376: d003 037a if ne goto 0x037a
0:378: 18e9 set r0 = 0x0e9
0:379: 20d0 *r0 = a1
0:37a: 18d7 set r0 = 0x0d7
0:37b: b890 a0 = p, y = *r0
0:37c: 998e if true a0 = y
0:37d: d002 038e if eq goto 0x038e
0:37f: 1b1b set r1 = 0x11b
0:380: 20d4 *r1 = a1
0:381: 20d0 *r0 = a1
0:382: 1aec set r1 = 0x0ec
0:383: 5110 000a y = 0x000a
0:385: a0d4 au *r1 = y
0:386: 1ed1 set r3 = 0x0d1
0:387: 1ae9 set r1 = 0x0e9
0:388: b8dc au y = *r3
0:389: a0d4 au *r1 = y
0:38a: 1ece set r3 = 0x0ce
0:38b: 1af2 set r1 = 0x0f2
0:38c: b8dc au y = *r3
0:38d: a0d4 au *r1 = y
0:38e: 18d0 set r0 = 0x0d0
0:38f: 7880 pt = *r0
0:390: 18f2 set r0 = 0x0f2
0:391: 3cd0 a0 = *r0
0:392: d850 p = x*y, y = a1, x = *pt++i
0:393: 49e0 pdx1 = a0
0:394: 1cf5 set r2 = 0x0f5
0:395: 1ee9 set r3 = 0x0e9
0:396: 30c0 nop, *r0
0:397: 30c0 nop, *r0
0:398: 30c0 nop, *r0
0:399: 1b1b set r1 = 0x11b
0:39a: e0d0 *r0 = a0
0:39b: 18ec set r0 = 0x0ec
0:39c: f850 p = x*y, y = *r0, x = *pt++i
0:39d: 4500 move a0 = x
0:39e: 984e a0 = a0>>4
0:39f: 988e a0 = a0>>8
0:3a0: e0d8 *r2 = a0
0:3a1: b0c8 au x = *r2
0:3a2: 3c50 p = x*y, a0 = *r0
0:3a3: 980e a0 = a0>>1
0:3a4: 9d0e if true a1 = p
0:3a5: 99f1 if le a0 = -a0
0:3a6: 38c4 a1l = *r1
0:3a7: b6ac a1 = a1+p, x = *r3
0:3a8: 4920 move yl = a0
0:3a9: 3fb8 a1 = a1+y, a0 = *r2
0:3aa: 9eee a1 = a1<<16
0:3ab: 5910 move y = a1
0:3ac: 3040 p = x*y, *r0
0:3ad: 9d0e if true a1 = p
0:3ae: 20d4 *r1 = a1
0:3af: 5110 09e4 y = 0x09e4
0:3b1: 31a0 a0 = a0+y, *r0
0:3b2: 4880 pt = a0
0:3b3: f840 p = x*y, y = *r0, x = *pt++
0:3b4: 3040 p = x*y, *r0
0:3b5: 990e if true a0 = p
0:3b6: 98ae a0 = a0<<8
0:3b7: 982e a0 = a0<<1
0:3b8: 982e a0 = a0<<1
0:3b9: 5110 0001 y = 0x0001
0:3bb: 3160 a0-y, *r0
0:3bc: 9991 if le a0 = y
0:3bd: 5110 07d0 y = 0x07d0
0:3bf: 3160 a0-y, *r0
0:3c0: 9981 if pl a0 = y
0:3c1: e0d0 *r0 = a0
0:3c2: 8504 call 0x0504 ; do_sample_1
0:3c3: 50b0 0000 i = 0x0000
0:3c5: 30c0 nop, *r0
0:3c6: 30c0 nop, *r0
0:3c7: 30c0 nop, *r0
0:3c8: 30c0 nop, *r0
0:3c9: 30c0 nop, *r0
0:3ca: 5130 0008 auc = 0x0008 ; disable alignment, enable A0 saturation, disable A1 saturation
0:3cc: 18f3 set r0 = 0x0f3
0:3cd: 1ad3 set r1 = 0x0d3
0:3ce: 3c90 a1 = p, a0 = *r0
0:3cf: bef4 a1 = a1-p, y = *r1
0:3d0: 3160 a0-y, *r0
0:3d1: d003 03d5 if ne goto 0x03d5
0:3d3: 18ea set r0 = 0x0ea
0:3d4: 20d0 *r0 = a1
0:3d5: 18d8 set r0 = 0x0d8
0:3d6: b890 a0 = p, y = *r0
0:3d7: 998e if true a0 = y
0:3d8: d002 03e9 if eq goto 0x03e9
0:3da: 1b1c set r1 = 0x11c
0:3db: 20d4 *r1 = a1
0:3dc: 20d0 *r0 = a1
0:3dd: 1aed set r1 = 0x0ed
0:3de: 5110 000a y = 0x000a
0:3e0: a0d4 au *r1 = y
0:3e1: 1ed5 set r3 = 0x0d5
0:3e2: 1aea set r1 = 0x0ea
0:3e3: b8dc au y = *r3
0:3e4: a0d4 au *r1 = y
0:3e5: 1ed2 set r3 = 0x0d2
0:3e6: 1af3 set r1 = 0x0f3
0:3e7: b8dc au y = *r3
0:3e8: a0d4 au *r1 = y
0:3e9: 18d4 set r0 = 0x0d4
0:3ea: 7880 pt = *r0
0:3eb: 18f3 set r0 = 0x0f3
0:3ec: 3cd0 a0 = *r0
0:3ed: d850 p = x*y, y = a1, x = *pt++i
0:3ee: 49e0 pdx1 = a0
0:3ef: 1cf6 set r2 = 0x0f6
0:3f0: 1eea set r3 = 0x0ea
0:3f1: 30c0 nop, *r0
0:3f2: 30c0 nop, *r0
0:3f3: 30c0 nop, *r0
0:3f4: 1b1c set r1 = 0x11c
0:3f5: e0d0 *r0 = a0
0:3f6: 18ed set r0 = 0x0ed
0:3f7: f850 p = x*y, y = *r0, x = *pt++i
0:3f8: 4500 move a0 = x
0:3f9: 984e a0 = a0>>4
0:3fa: 988e a0 = a0>>8
0:3fb: e0d8 *r2 = a0
0:3fc: b0c8 au x = *r2
0:3fd: 3c50 p = x*y, a0 = *r0
0:3fe: 980e a0 = a0>>1
0:3ff: 9d0e if true a1 = p
0:400: 99f1 if le a0 = -a0
0:401: 38c4 a1l = *r1
0:402: b6ac a1 = a1+p, x = *r3
0:403: 4920 move yl = a0
0:404: 3fb8 a1 = a1+y, a0 = *r2
0:405: 9eee a1 = a1<<16
0:406: 5910 move y = a1
0:407: 3040 p = x*y, *r0
0:408: 9d0e if true a1 = p
0:409: 20d4 *r1 = a1
0:40a: 5110 09e4 y = 0x09e4
0:40c: 31a0 a0 = a0+y, *r0
0:40d: 4880 pt = a0
0:40e: f840 p = x*y, y = *r0, x = *pt++
0:40f: 3040 p = x*y, *r0
0:410: 990e if true a0 = p
0:411: 98ae a0 = a0<<8
0:412: 982e a0 = a0<<1
0:413: 982e a0 = a0<<1
0:414: 5110 0001 y = 0x0001
0:416: 3160 a0-y, *r0
0:417: 9991 if le a0 = y
0:418: 5110 07d0 y = 0x07d0
0:41a: 3160 a0-y, *r0
0:41b: 9981 if pl a0 = y
0:41c: e0d0 *r0 = a0
0:41d: 8504 call 0x0504 ; do_sample_1
0:41e: 50b0 0000 i = 0x0000
0:420: 30c0 nop, *r0
0:421: 30c0 nop, *r0
0:422: 30c0 nop, *r0
0:423: 30c0 nop, *r0
0:424: 30c0 nop, *r0
0:425: 5130 0008 auc = 0x0008 ; disable alignment, enable A0 saturation, disable A1 saturation
0:427: 5000 00cc move r0 = 0x00cc
0:429: 7880 pt = *r0
0:42a: 5000 00f1 move r0 = 0x00f1
0:42c: 3cd0 a0 = *r0
0:42d: f850 p = x*y, y = *r0, x = *pt++i
0:42e: 49e0 pdx1 = a0
0:42f: 992e a0h = a0h+1
0:430: 5020 00f4 move r2 = 0x00f4
0:432: 30c0 nop, *r0
0:433: 30c0 nop, *r0
0:434: 30c0 nop, *r0
0:435: 1ee8 set r3 = 0x0e8
0:436: 5010 011a move r1 = 0x011a
0:438: e0d0 *r0 = a0
0:439: f850 p = x*y, y = *r0, x = *pt++i
0:43a: 4500 move a0 = x
0:43b: 986e a0 = a0<<4
0:43c: 988e a0 = a0>>8
0:43d: 984e a0 = a0>>4
0:43e: e0d8 *r2 = a0 ; *r2 = second-to-left nibble of X (not sign-extended)
0:43f: 4900 move x = a0
0:440: 5000 00eb move r0 = 0x00eb
0:442: b8d0 au y = *r0
0:443: 3cd0 a0 = *r0
0:444: 980e a0 = a0>>1
0:445: 3040 p = x*y, *r0
0:446: 9d0e if true a1 = p
0:447: 99f1 if le a0 = -a0
0:448: 38c4 a1l = *r1
0:449: b6ac a1 = a1+p, x = *r3
0:44a: 4920 move yl = a0
0:44b: 3fb8 a1 = a1+y, a0 = *r2
0:44c: 9eee a1 = a1<<16
0:44d: 5910 move y = a1
0:44e: 3040 p = x*y, *r0
0:44f: 9d0e if true a1 = p
0:450: 20d4 *r1 = a1
0:451: 5110 09e4 y = 0x09e4
0:453: 31a0 a0 = a0+y, *r0
0:454: 4880 pt = a0
0:455: f840 p = x*y, y = *r0, x = *pt++
0:456: 3040 p = x*y, *r0
0:457: 990e if true a0 = p
0:458: 98ae a0 = a0<<8
0:459: 982e a0 = a0<<1
0:45a: 982e a0 = a0<<1
0:45b: 5110 0001 y = 0x0001
0:45d: 3160 a0-y, *r0
0:45e: 9991 if le a0 = y
0:45f: 5110 07d0 y = 0x07d0
0:461: 3160 a0-y, *r0
0:462: 9981 if pl a0 = y
0:463: e0d0 *r0 = a0
0:464: 30c0 nop, *r0
0:465: 30c0 nop, *r0
0:466: 30c0 nop, *r0
0:467: 30c0 nop, *r0
0:468: 8504 call 0x0504 ; do_sample_1
0:469: 50b0 0000 i = 0x0000
0:46b: 30c0 nop, *r0
0:46c: 30c0 nop, *r0
0:46d: 30c0 nop, *r0
0:46e: 30c0 nop, *r0
0:46f: 30c0 nop, *r0
0:470: 5130 0008 auc = 0x0008 ; disable alignment, enable A0 saturation, disable A1 saturation
0:472: 5000 00d0 move r0 = 0x00d0
0:474: 7880 pt = *r0
0:475: 5000 00f2 move r0 = 0x00f2
0:477: 3cd0 a0 = *r0
0:478: f850 p = x*y, y = *r0, x = *pt++i
0:479: 49e0 pdx1 = a0
0:47a: 992e a0h = a0h+1
0:47b: 5020 00f5 move r2 = 0x00f5
0:47d: 30c0 nop, *r0
0:47e: 30c0 nop, *r0
0:47f: 30c0 nop, *r0
0:480: 1ee9 set r3 = 0x0e9
0:481: 5010 011b move r1 = 0x011b
0:483: e0d0 *r0 = a0
0:484: f850 p = x*y, y = *r0, x = *pt++i
0:485: 4500 move a0 = x
0:486: 986e a0 = a0<<4
0:487: 988e a0 = a0>>8
0:488: 984e a0 = a0>>4
0:489: e0d8 *r2 = a0
0:48a: 4900 move x = a0
0:48b: 5000 00ec move r0 = 0x00ec
0:48d: b8d0 au y = *r0
0:48e: 3cd0 a0 = *r0
0:48f: 980e a0 = a0>>1
0:490: 3040 p = x*y, *r0
0:491: 9d0e if true a1 = p
0:492: 99f1 if le a0 = -a0
0:493: 38c4 a1l = *r1
0:494: b6ac a1 = a1+p, x = *r3
0:495: 4920 move yl = a0
0:496: 3fb8 a1 = a1+y, a0 = *r2
0:497: 9eee a1 = a1<<16
0:498: 5910 move y = a1
0:499: 3040 p = x*y, *r0
0:49a: 9d0e if true a1 = p
0:49b: 20d4 *r1 = a1
0:49c: 5110 09e4 y = 0x09e4
0:49e: 31a0 a0 = a0+y, *r0
0:49f: 4880 pt = a0
0:4a0: f840 p = x*y, y = *r0, x = *pt++
0:4a1: 3040 p = x*y, *r0
0:4a2: 990e if true a0 = p
0:4a3: 98ae a0 = a0<<8
0:4a4: 982e a0 = a0<<1
0:4a5: 982e a0 = a0<<1
0:4a6: 5110 0001 y = 0x0001
0:4a8: 3160 a0-y, *r0
0:4a9: 9991 if le a0 = y
0:4aa: 5110 07d0 y = 0x07d0
0:4ac: 3160 a0-y, *r0
0:4ad: 9981 if pl a0 = y
0:4ae: e0d0 *r0 = a0
0:4af: 30c0 nop, *r0
0:4b0: 30c0 nop, *r0
0:4b1: 30c0 nop, *r0
0:4b2: 30c0 nop, *r0
0:4b3: 8504 call 0x0504 ; do_sample_1
0:4b4: 50b0 0000 i = 0x0000
0:4b6: 30c0 nop, *r0
0:4b7: 30c0 nop, *r0
0:4b8: 30c0 nop, *r0
0:4b9: 30c0 nop, *r0
0:4ba: 30c0 nop, *r0
0:4bb: 5130 0008 auc = 0x0008 ; disable alignment, enable A0 saturation, disable A1 saturation
0:4bd: 5000 00d4 move r0 = 0x00d4
0:4bf: 7880 pt = *r0
0:4c0: 5000 00f3 move r0 = 0x00f3
0:4c2: 3cd0 a0 = *r0
0:4c3: f850 p = x*y, y = *r0, x = *pt++i
0:4c4: 49e0 pdx1 = a0
0:4c5: 992e a0h = a0h+1
0:4c6: 5020 00f6 move r2 = 0x00f6
0:4c8: 30c0 nop, *r0
0:4c9: 30c0 nop, *r0
0:4ca: 30c0 nop, *r0
0:4cb: 1eea set r3 = 0x0ea
0:4cc: 5010 011c move r1 = 0x011c
0:4ce: e0d0 *r0 = a0
0:4cf: f850 p = x*y, y = *r0, x = *pt++i
0:4d0: 4500 move a0 = x
0:4d1: 986e a0 = a0<<4
0:4d2: 988e a0 = a0>>8
0:4d3: 984e a0 = a0>>4
0:4d4: e0d8 *r2 = a0
0:4d5: 4900 move x = a0
0:4d6: 5000 00ed move r0 = 0x00ed
0:4d8: b8d0 au y = *r0
0:4d9: 3cd0 a0 = *r0
0:4da: 980e a0 = a0>>1
0:4db: 3040 p = x*y, *r0
0:4dc: 9d0e if true a1 = p
0:4dd: 99f1 if le a0 = -a0
0:4de: 38c4 a1l = *r1
0:4df: b6ac a1 = a1+p, x = *r3
0:4e0: 4920 move yl = a0
0:4e1: 3fb8 a1 = a1+y, a0 = *r2
0:4e2: 9eee a1 = a1<<16
0:4e3: 5910 move y = a1
0:4e4: 3040 p = x*y, *r0
0:4e5: 9d0e if true a1 = p
0:4e6: 20d4 *r1 = a1
0:4e7: 5110 09e4 y = 0x09e4
0:4e9: 31a0 a0 = a0+y, *r0
0:4ea: 4880 pt = a0
0:4eb: f840 p = x*y, y = *r0, x = *pt++
0:4ec: 3040 p = x*y, *r0
0:4ed: 990e if true a0 = p
0:4ee: 98ae a0 = a0<<8
0:4ef: 982e a0 = a0<<1
0:4f0: 982e a0 = a0<<1
0:4f1: 5110 0001 y = 0x0001
0:4f3: 3160 a0-y, *r0
0:4f4: 9991 if le a0 = y
0:4f5: 5110 07d0 y = 0x07d0
0:4f7: 3160 a0-y, *r0
0:4f8: 9981 if pl a0 = y
0:4f9: e0d0 *r0 = a0
0:4fa: 30c0 nop, *r0
0:4fb: 30c0 nop, *r0
0:4fc: 30c0 nop, *r0
0:4fd: 30c0 nop, *r0
0:4fe: 8504 call 0x0504 ; do_sample_1
0:4ff: 50b0 0000 i = 0x0000
0:501: 1ae3 set r1 = 0x0e3
0:502: 7894 pr = *r1 ; return offset = (*0x00E3)
0:503: c000 return
do_sample_1:
0:504: 5130 0002 auc = 0x0002 ; alignment = *4, enable A0 saturation, enable A1 saturation
0:506: 5000 0078 move r0 = 0x0078 ; ofs 078: channel 0 ROM bank
0:508: 7880 pt = *r0 ; preload channel 0 bank
0:509: f880 a0 = p, y = *r0, x = *pt++ ; A0 = P*4 (due to alignment), rest are dummy reads to apply the ROM bank
0:50a: 1800 set r0 = 0x000 ; ChnRAM+00: ROM bank for next channel
0:50b: 1a01 set r1 = 0x001 ; ChnRAM+01: address
0:50c: 1c03 set r2 = 0x003 ; ChnRAM+03: phase (sample address, 16-bit fraction)
0:50d: 1f0a set r3 = 0x10a ; 10A..119: channel sample data with volume applied
0:50e: 1008 set j = 0x008 ; 8 bytes per channel
0:50f: 7710 do 16 { 0x0510...0x051d }
0:510: 79d4 pdx0 = *r1 ; PDX0 = address of sample data to read
0:511: 7881 pt = *r0++ ; set bank for next channel [ChnRAM+00]
0:512: b8f1 a0 = a0-p, y = *r0++ ; A0 = 0, Y = (current offset << 16) [ChnRAM+01]
0:513: 3cc1 a0l = *r0++ ; A0L = playback rate [ChnRAM+02]
0:514: b8c1 au yl = *r0++ ; YL = phase [ChnRAM+03] -> Y = 16.16 sample offset
0:515: 986e a0 = a0<<4 ; make playback rate 4.12 fixed point
0:516: b9b1 a0 = a0+y, y = *r0++ ; A0 = new offset, Y = loop size [ChnRAM+04]
0:517: bdf1 a1 = a0-y, y = *r0++ ; A1 = loop offset, Y = end offset [ChnRAM+05]
0:518: e16b a0-y, *r2++j = a0l ; test (A0 < end offset), save phase
0:519: 9bc1 if pl a0 = a1 ; end offset reached (A0 >= Y) -> loop back
0:51a: f841 p = x*y, y = *r0++, x = *pt++ ; Y = channel volume, X = sample data [ChnRAM+06]
0:51b: e057 p = x*y, *r1++j = a0 ; P = sample*volume, save current offset [ChnRAM+01], advance R1 to next channel
0:51c: 3481 a1 = p, *r0++ ; A1 = P*4, advance R0 to [ChnRAM+00] of next channel
0:51d: 209d a0 = p, *r3++ = a1 ; A0 = P*4 (makes A0=0 above work), save final sample to RAM at 10A..119
0:51e: 190a set r0 = 0x10a ; 10A..119: channel sample data
0:51f: 1cba set r2 = 0x0ba ; 0BA..0C9: channel reverb volume
0:520: b8d1 au y = *r0++ ; Y = ch 0 sample data
0:521: b4e9 a1 = a0-p, x = *r2++ ; A1 = 0, X = channel reverb
0:522: 7110 do 16 { 0x0523...0x0524 }
0:523: b049 p = x*y, x = *r2++ ; P = channel reverb data, get next channel reverb
0:524: beb1 a1 = a1+p, y = *r0++ ; accumulate total reverb, read next channel sample
0:525: 5060 0554 move rb = 0x0554 ; RB [reverb begin] = 0554
0:527: 1ed9 set r3 = 0x0d9
0:528: 787c re = *r3 ; RE [reverb end] = RAM[0x00D9] (reverb delay)
0:529: 1b1f set r1 = 0x11f
0:52a: 7804 r0 = *r1
0:52b: 3cd0 a0 = *r0 ; A0 = RAM[ RAM[0x11F] ]
0:52c: 1f22 set r3 = 0x122
0:52d: 1c93 set r2 = 0x093
0:52e: b8dc au y = *r3
0:52f: e0de *r3-- = a0
0:530: e1bc a0 = a0+y, *r3 = a0
0:531: 980e a0 = a0>>1
0:532: 4910 move y = a0
0:533: b0c8 au x = *r2
0:534: a05c p = x*y, *r3 = y
0:535: 36a0 a1 = a1+p, *r0
0:536: 20d1 *r0++ = a1
0:537: 6004 *r1 = r0
0:538: 5060 0373 move rb = 0x0373 ; RB [reverb begin] = 0373
0:53a: 5070 0553 move re = 0x0553 ; RE [reverb end] = 0553
0:53c: 1b20 set r1 = 0x120
0:53d: 7804 r0 = *r1
0:53e: e0d1 *r0++ = a0 ; write to *R0, then increase+wrap around R0 (if R0 == RE, then R0 = RB, else R0 ++)
0:53f: 6004 *r1 = r0
0:540: 51c0 3820 pioc = 0x3820 ; enable INT interrupts
0:542: 1cf7 set r2 = 0x0f7 ; channel panning, right speaker (PanTable_FrontR)
0:543: 51c0 3800 pioc = 0x3800 ; disable INT interrupts
0:545: 4550 a0 = c0 ; get interrupt counter
0:546: 99ce a0 = a0
0:547: d003 055c if ne goto 0x055c ; if c0 == 1, then jump
0:549: 30c0 nop, *r0 ; else execut NOPs to make up for the cycles taken by the interrupt
0:54a: 30c0 nop, *r0
0:54b: 30c0 nop, *r0
0:54c: 30c0 nop, *r0
0:54d: 30c0 nop, *r0
0:54e: 30c0 nop, *r0
0:54f: 30c0 nop, *r0
0:550: 30c0 nop, *r0
0:551: 30c0 nop, *r0
0:552: 30c0 nop, *r0
0:553: 30c0 nop, *r0
0:554: 30c0 nop, *r0
0:555: 30c0 nop, *r0
0:556: 30c0 nop, *r0
0:557: 30c0 nop, *r0
0:558: 30c0 nop, *r0
0:559: 30c0 nop, *r0
0:55a: 30c0 nop, *r0
0:55b: 055e goto 0x055e
0:55c: 5150 0000 c0 = 0x0000
0:55e: 1b0a set r1 = 0x10a ; 10A..11C: channel sample data
0:55f: 1880 set r0 = 0x080 ; 080..092: channel panning (see PanTable_FrontL)
0:560: 1f1e set r3 = 0x11e ; 11E: final mixed sample data
0:561: 50b0 0062 i = 0x0062
0:563: 5110 0000 y = 0x0000
0:565: 9d8e if true a1 = y ; A1 = 0
0:566: 3040 p = x*y, *r0 ; P = 0
0:567: 990e if true a0 = p ; A0 = 0
0:568: 7213 do 19 { 0x0569...0x056c }
0:569: 7881 pt = *r0++
0:56a: f874 a0 = a0-p, p = x*y, y = *r1, x = *pt++i ; A0 -= ROM[PanRearL] + SampleData (calculates previous channel data)
0:56b: fe75 a1 = a1-p, p = x*y, y = *r1++, x = *pt++i ; A1 -= ROM[PanL] * SampleData
0:56c: 6089 *r2++ = pt ; store PanR address for channels
0:56d: 3060 a0 = a0-p, p = x*y, *r0 ; A0 -= ROM[PanRearL] + SampleData (calculates last channel data)
0:56e: 1d21 set r2 = 0x121
0:56f: befa a1 = a1-p, y = *r2--
0:570: 31a0 a0 = a0+y, *r0 ; add RAM[121] (unknown)
0:571: e0dc *r3 = a0 ; store final data
; do some reverb
0:572: 5020 02b5 move r2 = 0x02b5
0:574: 15f9 set rb = 0x1f9
0:575: 5070 0256 move re = 0x0256
0:577: 1923 set r0 = 0x123
0:578: 7810 r1 = *r0
0:579: b8d5 au y = *r1++
0:57a: b089 a0 = p, x = *r2++
0:57b: 715d do 93 { 0x057c...0x057d }
0:57c: b069 a0 = a0-p, p = x*y, x = *r2++
0:57d: b8d5 au y = *r1++
0:57e: b069 a0 = a0-p, p = x*y, x = *r2++
0:57f: 5910 move y = a1
0:580: a874 a0 = a0-p, p = x*y, *r1zp : y
0:581: 6010 *r0 = r1
; do some filter
0:582: 1ce4 set r2 = 0x0e4
0:583: b0e9 a0 = a0-p, x = *r2++
0:584: 152d set rb = 0x12d
0:585: 175f set re = 0x15f
0:586: 1925 set r0 = 0x125
0:587: 7810 r1 = *r0
0:588: e0d5 *r1++ = a0
0:589: 6011 *r0++ = r1
0:58a: 7810 r1 = *r0
0:58b: b8d5 au y = *r1++
0:58c: b048 p = x*y, x = *r2
0:58d: b89c a0 = p, y = *r3
0:58e: 6011 *r0++ = r1
0:58f: 1560 set rb = 0x160
0:590: 1792 set re = 0x192
0:591: 7810 r1 = *r0
0:592: a0d5 au *r1++ = y
0:593: 6011 *r0++ = r1
0:594: 7810 r1 = *r0
0:595: b8d5 au y = *r1++
0:596: 6010 *r0 = r1
0:597: 5080 09d2 pt = 0x09d2
0:599: f844 p = x*y, y = *r1, x = *pt++
0:59a: 3020 a0 = a0 + p, p = x*y, *r0
0:59b: 996e a0 = rnd(a0)
0:59c: 49a0 sdx = a0 ; output left channel sample data
0:59d: 18f7 set r0 = 0x0f7 ; channel panning, right speaker (PanTable_FrontR)
0:59e: 1b0a set r1 = 0x10a ; 10A..11C: channel sample data
0:59f: 990e if true a0 = p
0:5a0: 9d0e if true a1 = p
0:5a1: 7193 do 19 { 0x05a2...0x05a4 }
0:5a2: 7881 pt = *r0++
0:5a3: f874 a0 = a0-p, p = x*y, y = *r1, x = *pt++i
0:5a4: fe75 a1 = a1-p, p = x*y, y = *r1++, x = *pt++i
0:5a5: 3060 a0 = a0-p, p = x*y, *r0
0:5a6: 1d21 set r2 = 0x121
0:5a7: befa a1 = a1-p, y = *r2--
0:5a8: e7bc a1 = a1+y, *r3 = a0
; do some reverb
0:5a9: 5020 0314 move r2 = 0x0314
0:5ab: 5060 0257 move rb = 0x0257
0:5ad: 5070 02b4 move re = 0x02b4
0:5af: 1924 set r0 = 0x124
0:5b0: 7810 r1 = *r0
0:5b1: b8d5 au y = *r1++
0:5b2: b089 a0 = p, x = *r2++
0:5b3: 715d do 93 { 0x05b4...0x05b5 }
0:5b4: b069 a0 = a0-p, p = x*y, x = *r2++
0:5b5: b8d5 au y = *r1++
0:5b6: b069 a0 = a0-p, p = x*y, x = *r2++
0:5b7: 5910 move y = a1
0:5b8: a874 a0 = a0-p, p = x*y, *r1zp : y
0:5b9: 6010 *r0 = r1
; do some filter
0:5ba: 1ce6 set r2 = 0x0e6
0:5bb: b0e9 a0 = a0-p, x = *r2++
0:5bc: 1593 set rb = 0x193
0:5bd: 17c5 set re = 0x1c5
0:5be: 1929 set r0 = 0x129
0:5bf: 7810 r1 = *r0
0:5c0: e0d5 *r1++ = a0
0:5c1: 6011 *r0++ = r1
0:5c2: 7810 r1 = *r0
0:5c3: b8d5 au y = *r1++
0:5c4: b048 p = x*y, x = *r2
0:5c5: b89c a0 = p, y = *r3
0:5c6: 6011 *r0++ = r1
0:5c7: 15c6 set rb = 0x1c6
0:5c8: 5070 01f8 move re = 0x01f8
0:5ca: 7810 r1 = *r0
0:5cb: a0d5 au *r1++ = y
0:5cc: 6011 *r0++ = r1
0:5cd: 7810 r1 = *r0
0:5ce: b8d5 au y = *r1++
0:5cf: 6010 *r0 = r1
0:5d0: 5080 09d2 pt = 0x09d2
0:5d2: f844 p = x*y, y = *r1, x = *pt++
0:5d3: 3020 a0 = a0 + p, p = x*y, *r0
0:5d4: 996e a0 = rnd(a0)
0:5d5: 51e0 0000 pdx1 = 0x0000
0:5d7: 49a0 sdx = a0 ; output right channel sample data
0:5d8: 1ae2 set r1 = 0x0e2 ; load filter refresh flag offset
0:5d9: b8d4 au y = *r1
0:5da: 3180 a0 = y, *r0
0:5db: d002 0612 if eq goto 0x0612 ; loc_612
filter_refresh_1:
0:5dd: 5020 00de move r2 = 0x00de
0:5df: 5030 0126 move r3 = 0x0126
0:5e1: 5000 0125 move r0 = 0x0125
0:5e3: 3cd1 a0 = *r0++ ; A0 = *0x0125
0:5e4: b8d9 au y = *r2++ ; Y = *0x00DE
0:5e5: 31e0 a0 = a0-y ; A0 = *0x0125 - *0x00DE
0:5e6: 5110 0033 y = 0x0033
0:5e8: 35a0 a1 = a0+y ; A1 = *0x0125 - *0x00DE + 0x0033
0:5e9: 5110 012d y = 0x012d
0:5eb: 3160 a0-y, *r0
0:5ec: 9bc0 if mi a0 = a1 ; if (A0 < 0x012D) A0 = A1
0:5ed: e0d1 *r0++ = a0 ; *0x0126 = A0
0:5ee: 3cd1 a0 = *r0++ ; A0 = *0x0127
0:5ef: b8d9 au y = *r2++ ; Y = *0x00DF
0:5f0: 31e0 a0 = a0-y ; A0 = *0x0127 - *0x00DF
0:5f1: 5110 0033 y = 0x0033
0:5f3: 35a0 a1 = a0+y ; A1 = *0x0127 - *0x00DF + 0x0033
0:5f4: 5110 0160 y = 0x0160
0:5f6: 3160 a0-y, *r0
0:5f7: 9bc0 if mi a0 = a1 ; if (A0 < 0x0160) A0 = A1
0:5f8: e0d1 *r0++ = a0 ; *0x0128 = A0
0:5f9: 3cd1 a0 = *r0++ ; A0 = *0x0129
0:5fa: b8d9 au y = *r2++
0:5fb: 31e0 a0 = a0-y ; A0 = *0x0129 - *0x00E0
0:5fc: 5110 0033 y = 0x0033
0:5fe: 35a0 a1 = a0+y ; A1 = *0x0129 - *0x00E0 + 0x0033
0:5ff: 5110 0193 y = 0x0193
0:601: 3160 a0-y, *r0
0:602: 9bc0 if mi a0 = a1 ; if (A0 < 0x0193) A0 = A1