-
Notifications
You must be signed in to change notification settings - Fork 0
/
chronos.asm
2055 lines (1897 loc) · 33.5 KB
/
chronos.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
;Chronos
;;converted over to Aquarius by Bushy.
;Assembled to $e000 with Pasmo Assembler.
;
;
;Load in Binary file : "Chronos.bin"
;at memory $E000
;usr Execution at $0000
;
;Then back at basic, run X=USR(0)
; org $4000 ; Aquarius 4k cassette/cartridge
; org $c000 ; Aquarius lower 8k cartridge
org $e000 ; Aquarius upper 8k cartridge
; org $100 ; Microbee
; org $8000 ; VZ
; org $4000 ; ZX Spectrum
db 98, 117, 115, 104
db 121, 156, 50, 176
db 48, 108, 50, 100
db 50, 168, 183, 112
; out ($fc),a ;11 ; Aquarius
; out ($fe),a ;11 ; ZX
; AND $21 ; VZ
; ld ($6800), a ; VZ
; out (2),a ;11 ; MICROBEE
;------------------------------------------------------------------------------
; Chronos 1-bit music code (C) 1987 Tim Follin / Mastertronic
;
; Disassembled by ZoomTen, June 2020
; Revised: January 2022
;
; https://github.com/ZoomTen/chronos-zxbeeper
;
;------------------------------------------------------------------------------
; whether or not to enable AY noise drums
ENABLE_AY EQU 0
SONGSPEED equ 4
;INCLUDE "notes.asm"
; rough note data equivalency
B_2 EQU 254
C_3 EQU 240
Cs3 EQU 226
D_3 EQU 216
Ds3 EQU 202
E_3 EQU 190
F_3 EQU 181
Fs3 EQU 170
G_3 EQU 159 ; new value
Gs3 EQU 151
A_3 EQU 143
As3 EQU 135
B_3 EQU 127
C_4 EQU 120
Cs4 EQU 113
D_4 EQU 107
Ds4 EQU 101
E_4 EQU 95
F_4 EQU 90
Fs4 EQU 85
G_4 EQU 79 ; new value
Gs4 EQU 76
A_4 EQU 71
As4 EQU 65 ; new value
B_4 EQU 64
; new values
C_5 EQU 58
Cs5 EQU 55
D_5 EQU 50
Ds5 EQU 48
E_5 EQU 45
F_5 EQU 43
Fs5 EQU 40
G_5 EQU 38
Gs5 EQU 36
A_5 EQU 34
As5 EQU 32
B_5 EQU 30
C_6 EQU 28
Cs6 EQU 26
D_6 EQU 24
Ds6 EQU 23
E_6 EQU 22
F_6 EQU 20
Fs6 EQU 19
G_6 EQU 18
Gs6 EQU 17
A_6 EQU 16
As6 EQU 15
B_6 EQU 14
; ------------------- music code start -----------------------------------------
; music init
Music_Init:
di ; Disable interrupts, since perfect timing is needed
IF ENABLE_AY
ld hl, AY_Snare
feature_ay_loop:
; ld bc, $fffd ; + Select AY registers
ld a, (hl)
inc hl
out (129), a ; + Execute AY part
ld bc, $bffd ; + Write to AY registers
ld a, (hl)
inc hl
out (128), a ; + Execute AY part
ld a,(hl)
and a
jp nz, feature_ay_loop
ENDIF
ld ix,Music_Chords ; IX = chords
ld (Chord_RepeatPoint), ix
ld iy,Music_Bass ; IY = bass
; initialize all variables
xor a
ld (Music_Init_42+1), a
inc a
ld (Music_Init_30+1), a
ld (Music_Init_36+1), a
ld (Music_Init_2+1), a
ld (Music_Init_28+1), a
ld (Music_Init_40+1), a
ld (Bass_RepeatPoint), iy
ld a,(Variables_4)
ld (Variables_3), a
ld a,(Variables_5)
ld (Music_Init_12+1), a
ld a,(Variables_6)
ld (Music_Init_14+1), a
exx
ld de,Music_Melody ; DE = melody
ld (Melody_RepeatPoint),DE
ld a,1
ld (Music_Init_34+1), a
exx
IX_CommandProcessor:
ld a,(IX+0) ; Read current byte for 3-tone portion
cp 2
jp nz,Music_Init_1
; 02 xx = set repeat
INC IX
ld a,(IX+0) ; Get repeat count
inc a
ld (Music_Init_2+1), a ; Set the repeat counter
INC IX
ld (Chord_RepeatPoint), ix ; Store repeat point address
ld a,(IX+0)
jp Music_Init_4 ; Read the next byte
Music_Init_1:
cp 1
jp nz,Music_Init_4
; 01 = go back to repeat point
Music_Init_2:
ld a,2 ; This is modified by the subroutine above
DEC A ; A is the repeat counter
jp nz,Music_Init_3 ; If the counter hasn't ran out, go back to loop
; point
INC IX
jp IX_CommandProcessor ; Read the next byte
Music_Init_3:
ld (Music_Init_2+1), a ; Save repeat counter
ld ix,(Chord_RepeatPoint) ; Load saved repeat point
ld a,(IX+0)
Music_Init_4:
AND A
jp z,StopMusic ; If current byte = 0, stop the music entirely
cp 255
jp nz,Music_Init_5 ; If current byte != 255, process some notes
; FF xx aa bb .. = special command for setting effects and envelopes
INC IX ; Begin processing effects
INC IX ; IX now points to the first argument
ld a,(IX-1) ; Check command byte
cp 1
jp z, IX_FFCommand01 ; 1 set envelope
cp 2
jp z, IX_FFCommand02
cp 3
jp z, IX_FFCommand03
cp 4
jp z, IX_FFCommand04 ; 4 play drum pattern?
cp 5
jp z, IX_FFCommand05 ; 5 play drum pattern?
cp 8
jp z, IX_FFCommand08
cp 9
jp z, IX_FFCommand09 ; 9 set 2 note chord mode?
cp 10
jp z, IX_FFCommand0a ; 10 set 3 note chord mode?
jp IX_CommandProcessor
IX_FFCommand09:
ld a,1
ld (Music_Init_42+1), a ; Use 2 channels
jp IX_CommandProcessor
IX_FFCommand0a:
xor a
ld (Music_Init_42+1), a ; Use 3 channels
jp IX_CommandProcessor
IX_FFCommand08:
ld a,(IX+0)
INC IX
ld (Music_Init_24+1), a
jp IX_CommandProcessor
IX_FFCommand04:
ld HL,DrumPatternA
ld (Music_Init_22+1),HL
jp IX_FFCommand02
IX_FFCommand05:
ld HL,DrumPatternB
ld (Music_Init_22+1),HL
jp IX_FFCommand02
IX_FFCommand02:
xor a
ld (Music_Init_23+1), a
ld a,1
ld (Music_Init_21+1), a
jp IX_CommandProcessor
IX_FFCommand03:
xor a
ld (Music_Init_23+1), a
xor a
ld (Music_Init_21+1), a
jp IX_CommandProcessor
IX_FFCommand01:
ld a,(IX+0) ; Attack?
ld (Variables_0), a
ld (Variables), a
ld a,(IX+1) ; Decay target?
ld (Variables_1), a
ld a,(IX+2) ; Decay rate?
ld (Variables_2), a
ld a,(IX+3) ; ???
ld (L62747_2+1), a
INC IX ; Move IX to next music data
INC IX
INC IX
INC IX
jp IX_CommandProcessor ; Read next byte
Music_Init_5:
ld a,(Variables_0)
ld (Variables), a
ld a,(Variables_1)
ld (Music_Init_47+1), a
ld a,(Variables_2)
ld (L62747+1), a
ld D,(IX+2) ; E,H contains the notes
ld E,(IX+0) ; D contains the length / note
ld H,(IX+1)
INC IX
INC IX
ld a,(Music_Init_42+1)
DEC A ; A = 0 if using 2 channels
jp z,Music_Init_6
INC IX
Music_Init_6:
ld a,(Variables)
AND A
jp z,L62682
ld a,D
ld (L63022_7+1), a
SRL A
SRL A
SRL A
ld B, a
SRL A
add a,B
ld (L63022_10+1), a
ld (Music_Init_48+1), a
ld a,E
ld (L63022_13+1), a
SRL A
SRL A
SRL A
ld B, a
SRL A
add a,B
ld (L63022_16+1), a
ld (Music_Init_50+1), a
ld a,H
ld (L63022_19+1), a
SRL A
SRL A
SRL A
ld B, a
SRL A
add a,B
ld (L63022_22+1), a
ld (Music_Init_52+1), a
ld a,1
ld (L63022_8+1), a
ld (L63022_14+1), a
ld (L63022_20+1), a
; This entry point is used by the routine at L62682.
Music_Init_7:
ld a,0
ld (Music_Init_53+1), a
ld a,(IX+0)
INC IX
Music_Init_8:
EX AF, aF'
; xor a
; IN a,(254)
; CPL
; AND 31
; jp nz,StopMusic
Music_Init_9:
ld a, 0
inc a
ld (Music_Init_9+1), a
Music_Init_10:
cp 1
jp nz,Music_Init_11
xor a
ld (Music_Init_9+1), a
ld a,(L63022_28+1)
DEC A
jp z,Music_Init_11
ld (L63022_28+1), a
ld a,(L63022_30+1)
inc a
ld (L63022_30+1), a
Music_Init_11:
ld a,(Variables_3)
AND A
jp z,Music_Init_14
Music_Init_12:
ld a, 1
DEC A
ld (Music_Init_12+1), a
jp nz,Music_Init_15
ld a,(Variables_5)
ld (Music_Init_12+1), a
ld a,(L63022_2+1)
inc a
Music_Init_13:
cp 42
jp z,L62675
ld (L63022_2+1), a
ld a,(L63022_4+1)
DEC A
ld (L63022_4+1), a
jp Music_Init_15
Music_Init_14:
ld a,2
DEC A
ld (Music_Init_14+1), a
jp nz,Music_Init_15
ld a,(Variables_6)
ld (Music_Init_14+1), a
ld a,(L63022_2+1)
DEC A
jp z,Music_Init_15
ld (L63022_2+1), a
ld a,(L63022_4+1)
inc a
ld (L63022_4+1), a
; This entry point is used by the routine at L62675.
Music_Init_15:
ld a,(Music_Init_17+1)
ld B, a
ld a,(Music_Init_18+1)
cp B
jp z,Music_Init_21
Music_Init_16:
ld B, 1
Music_Init_17:
ld a, 113
Music_Init_18:
cp 113 ; Current note
jp z,Music_Init_20
jp c,Music_Init_19
DEC A
DEC A
Music_Init_19:
inc a
ld (Music_Init_17+1), a
djnz Music_Init_17
Music_Init_20:
ld B, a
call L62613
Music_Init_21:
ld a, 0
DEC A
cp 255
jp z,Music_Init_28
ld (Music_Init_21+1), a
AND A
jp nz,Music_Init_28
push hl
push de
push bc
Music_Init_22:
ld HL, DrumPatternA
ld D,0
Music_Init_23:
ld E,2
add HL,DE
ld a,E
add a,2
ld (Music_Init_23+1), a
ld a,(HL)
ld C, a
Music_Init_24:
ld B, 128
DEC B
jp z,Music_Init_26
Music_Init_25:
add a,C
djnz Music_Init_25
Music_Init_26:
ld (Music_Init_21+1), a
inc hl
push hl
ld a,(HL) ; Drums processor?
cp 0
call Z,L62826
cp 1
call Z,L62926
cp 2
call Z,L62845
cp 3
call Z,L62876
cp 4
call Z,L62959
cp 5
call Z,L62994
POP HL
inc hl
ld a,(HL)
cp 255
jp nz,Music_Init_27
xor a
ld (Music_Init_23+1), a
Music_Init_27:
POP BC
POP DE
POP HL
Music_Init_28:
ld a, 9
DEC A
ld (Music_Init_28+1), a
jp nz,Music_Init_34
IY_CommandProcessor:
ld a,(IY+0)
cp 2
jp nz,Music_Init_29
INC IY ; 02 xx Set repeat
ld a,(IY+0)
inc a
ld (Music_Init_30+1), a
INC IY
ld (Bass_RepeatPoint), iy
jp IY_CommandProcessor
Music_Init_29:
cp 1
jp nz,Music_Init_32
Music_Init_30:
ld a,3 ; 01 Go back to repeat point
DEC A
jp z,Music_Init_31
ld (Music_Init_30+1), a
ld iy,(Bass_RepeatPoint)
jp IY_CommandProcessor
Music_Init_31:
INC IY
jp IY_CommandProcessor
Music_Init_32:
cp 3
jp nz,Music_Init_33
INC IY ; 03 xx unknown
ld a,(IY+0)
ld (Music_Init_10+1), a
DEC A
ld (Music_Init_9+1), a
INC IY
jp IY_CommandProcessor
Music_Init_33:
ld (L63022_27+1), a ; Process note
SRL A
SRL A
ld L, a
SRL A
SRL L
add a,L
ld (L63022_28+1), a
ld L, a
ld a,1
ld (L63022_30+1), a
ld a,(IY+1)
ld (Music_Init_28+1), a
INC IY
INC IY
Music_Init_34:
ld a,1 ; Note length
DEC A
ld (Music_Init_34+1), a
jp nz,Music_Init_42
ld a,1
ld (Music_Init_12+1), a
ld (Music_Init_14+1), a
ld a,(Variables_4)
ld (Variables_3), a
exx
DE_CommandProcessor:
ld a,(DE)
cp 2
jp nz,Music_Init_35
INC DE
ld a,(DE)
inc a
ld (Music_Init_36+1), a
INC DE
ld (Melody_RepeatPoint),DE
jp DE_CommandProcessor
Music_Init_35:
cp 1
jp nz,Music_Init_38
Music_Init_36:
ld a,1
DEC A
jp z,Music_Init_37
ld (Music_Init_36+1), a
ld de,(Melody_RepeatPoint)
jp DE_CommandProcessor
Music_Init_37:
INC DE
jp DE_CommandProcessor
Music_Init_38:
ld a,(DE)
cp 3
jp nz,Music_Init_39
INC DE
ld a,(DE)
INC DE
cp 1
jp z,DE_03Command01
cp 2
jp z,DE_03Command02
cp 3
jp z,DE_03Command03
cp 4
jp z,DE_03Command04
cp 5
jp z,DE_03Command05
cp 6
jp z,DE_03Command06
cp 7
jp z,DE_03Command07
jp DE_CommandProcessor
DE_03Command06:
ld a,60 ; inc a, enables echo
ld (Music_Init_45), a
jp DE_CommandProcessor
DE_03Command07:
xor a ; NOP, disables echo
ld (Music_Init_45), a
jp DE_CommandProcessor
DE_03Command05:
ld a,(DE)
INC DE
ld (Music_Init_44+1), a
jp DE_CommandProcessor
DE_03Command03:
ld a,(DE)
ld (Music_Init_16+1), a
INC DE
jp DE_CommandProcessor
DE_03Command01:
ld a,1 ; enable glide
ld (Music_Init_40+1), a
jp DE_CommandProcessor
DE_03Command02:
xor a ; disable glide
ld (Music_Init_40+1), a
jp DE_CommandProcessor
DE_03Command04:
ld a,(DE)
ld (Variables_4), a
ld (Variables_3), a
INC DE
ld a,(DE)
ld (Variables_5), a
INC DE
ld a,(DE)
ld (Variables_6), a
INC DE
ld a,1
ld (Music_Init_12+1), a
ld (Music_Init_14+1), a
jp DE_CommandProcessor
Music_Init_39:
INC DE
ld (Music_Init_18+1), a
ld B, a
Music_Init_40:
ld a,0
AND A
jp nz,Music_Init_41
call L62613
ld a,(L63022_1+1)
ld (Music_Init_17+1), a
Music_Init_41:
ld a,(DE)
ld (Music_Init_34+1), a
INC DE
exx
Music_Init_42:
ld a,1
DEC A
jp nz,Music_Init_46
push hl
push bc
Music_Init_43:
ld a,8
inc a
AND 1
ld (Music_Init_43+1), a
ld HL,Variables_10
ld C, a
add a, a
add a,C
ld C, a
ld B,0
add HL,BC
ld a,(L63022_1+1)
ld (HL), a
inc hl
ld a,(L63022_2+1)
ld (HL), a
inc hl
ld a,(L63022_4+1)
ld (HL), a
ld a,(Music_Init_43+1)
Music_Init_44:
SUB 3
AND 1
ld HL,Variables_10
ld C, a
add a, a
add a,C
ld C, a
add HL,BC
ld a,(HL)
Music_Init_45:
inc a
ld (L63022_7+1), a
inc hl
ld a,(HL)
SRL A
ld B, a
SRL A
SRL A
add a,B
OR 1
ld (L63022_8+1), a
inc hl
ld a,(HL)
SRL A
ld B, a
SRL A
SRL A
add a,B
OR 1
ld (L63022_10+1), a
POP BC
POP HL
Music_Init_46:
call L63022
ld a,(Variables)
cp 0
jp z,L62747
cp 2
jp z,Music_Init_53
Music_Init_47:
ld a,0
DEC A
ld (Music_Init_47+1), a
jp nz,Music_Init_53
ld a,(Variables_1)
ld (Music_Init_47+1), a
ld a,(L63022_8+1)
inc a
Music_Init_48:
cp 0
jp z,Music_Init_49
ld (L63022_8+1), a
ld a,(L63022_10+1)
DEC A
ld (L63022_10+1), a
Music_Init_49:
ld a,(L63022_14+1)
inc a
Music_Init_50:
cp 0
jp z,Music_Init_51
ld (L63022_14+1), a
ld a,(L63022_16+1)
DEC A
ld (L63022_16+1), a
Music_Init_51:
ld a,(L63022_20+1)
inc a
Music_Init_52:
cp 0
jp z,L62668
ld (L63022_20+1), a
ld a,(L63022_22+1)
DEC A
ld (L63022_22+1), a
; This entry point is used by the routines at L62668 and L62747.
Music_Init_53:
ld a,0
XOR 1
ld (Music_Init_53+1), a
jp z,Music_Init_54
EX AF, aF'
jp Music_Init_8
Music_Init_54:
EX AF, aF'
DEC A
jp nz,Music_Init_8
ld a,127
IN a,(254)
AND 1
jp nz, IX_CommandProcessor
StopMusic:
ld iy,23610
ld a,(Music_Init_36+1)
ld C, a
ld B,0
EI
RET
; Routine at 62613
;
; Used by the routine at Music_Init.
L62613:
ld a,(Variables_3)
AND A
jp z,L62613_0
ld a,B
ld (L63022_1+1), a
SRL A
SRL A
ld B, a
SRL A
add a,B
ld (L63022_4+1), a
ld (Music_Init_13+1), a
ld a,1
ld (L63022_2+1), a
RET
L62613_0:
ld a,B
ld (L63022_1+1), a
SRL A
SRL A
ld B, a
SRL A
add a,B
ld (L63022_2+1), a
ld (Music_Init_13+1), a
ld a,1
ld (L63022_4+1), a
RET
; Routine at 62668
;
; Used by the routine at Music_Init.
L62668:
xor a
ld (Variables), a
jp Music_Init_53
; Routine at 62675
;
; Used by the routine at Music_Init.
L62675:
xor a
ld (Variables_3), a
jp Music_Init_15
; Routine at 62682
;
; Used by the routine at Music_Init.
L62682:
ld a,D
ld (L63022_7+1), a
SRL A
SRL A
SRL A
ld B, a
SRL A
add a,B
ld (L63022_8+1), a
ld a,E
ld (L63022_13+1), a
SRL A
SRL A
SRL A
ld B, a
SRL A
add a,B
ld (L63022_14+1), a
ld a,H
ld (L63022_19+1), a
SRL A
SRL A
SRL A
ld B, a
SRL A
add a,B
ld (L63022_20+1), a
ld a,1
ld (L63022_10+1), a
ld (L63022_16+1), a
ld (L63022_22+1), a
jp Music_Init_7
; Routine at 62747
;
; Used by the routine at Music_Init.
L62747:
ld a,2
DEC A
ld (L62747+1), a
jp nz,Music_Init_53
ld a,(Variables_2)
ld (L62747+1), a
ld a,(L63022_8+1)
DEC A
jp z,L62747_0
ld (L63022_8+1), a
ld a,(L63022_10+1)
inc a
ld (L63022_10+1), a
L62747_0:
ld a,(L63022_14+1)
DEC A
jp z,L62747_1
ld (L63022_14+1), a
ld a,(L63022_16+1)
inc a
ld (L63022_16+1), a
L62747_1:
ld a,(L63022_20+1)
DEC A
L62747_2:
cp 1
jp z,L62747_3
ld (L63022_20+1), a
ld a, (L63022_22+1)
inc a
ld (L63022_22+1), a
jp Music_Init_53
L62747_3:
ld a,2
ld (Variables), a
jp Music_Init_53
; Routine at 62826
;
; Used by the routine at Music_Init.
L62826:
ld bc,700
L62826_0:
DEC BC
ld a,B
OR C
jp nz,L62826_0
xor a ; Zero
out ($fc),a ;11 ; Aquarius
; out ($fe),a ;11 ; ZX
; AND $21 ; VZ
; ld ($6800), a ; VZ
; out (2),a ;11 ; MICROBEE
ld a,0
L62826_1:
DEC A
jp nz,L62826_1
RET
; Routine at 62845
;
; Used by the routine at Music_Init.
L62845:
ld HL,0
ld B,10
L62845_0:
xor a
out ($fc),a ;11 ; Aquarius
; out ($fe),a ;11 ; ZX
; AND $21 ; VZ
; ld ($6800), a ; VZ
; out (2),a ;11 ; MICROBEE
ld a,(HL)
inc hl
AND 128
add a,16
L62845_1:
DEC A
jp nz,L62845_1
ld a, 1
out ($fc),a ;11 ; Aquarius
; out ($fe),a ;11 ; ZX
; AND $21 ; VZ
; ld ($6800), a ; VZ
; out (2),a ;11 ; MICROBEE
ld a,20
L62845_2:
DEC A
jp nz,L62845_2
djnz L62845_0
RET
; Routine at 62876
;
; Used by the routine at Music_Init.
L62876:
; ld bc,65533
; ld a,13
; out (c), a
ld a, 1
out ($fc),a ;11 ; Aquarius
; out ($fe),a ;11 ; ZX
; AND $21 ; VZ
; ld ($6800), a ; VZ
; out (2),a ;11 ; MICROBEE
; ld bc,49149
ld a,1
out ($fc),a ;11 ; Aquarius
; out ($fe),a ;11 ; ZX
; AND $21 ; VZ
; ld ($6800), a ; VZ
; out (2),a ;11 ; MICROBEE
ld C,5
ld HL,10
L62876_0:
xor a
out ($fc),a ;11 ; Aquarius
; out ($fe),a ;11 ; ZX
; AND $21 ; VZ
; ld ($6800), a ; VZ
; out (2),a ;11 ; MICROBEE
ld B,(HL)
inc hl
L62876_1:
djnz L62876_1
; ld a,16
ld a, 1
out ($fc),a ;11 ; Aquarius
; out ($fe),a ;11 ; ZX
; AND $21 ; VZ