/[projet1]/public/oric/games/Space 1999/Sources/trailer/sound.s
Defence Force logotype

Annotation of /public/oric/games/Space 1999/Sources/trailer/sound.s

Parent Directory Parent Directory | Revision Log Revision Log


Revision 365 - (hide annotations)
Mon Jul 19 10:58:27 2010 UTC (9 years, 1 month ago) by dbug
File size: 40131 byte(s)
Added the Space:1999 Trailer to the repository.

1 dbug 365
2     ; Space1999 Music & SFX (All Code and Data)
3    
4     ; Sound routines & data come after the game frame (frame.s), as specified in
5     ; osdk_config.bat. It is automatically added to the .bss section in the correct
6     ; addresses.
7     ; This file is also #included when compiling overlay data and generating the
8     ; game disk.
9    
10     ;System Defines
11     #define sys_IRQJump $0244
12     #define sys_IRQVectorLo $0245
13     #define sys_IRQVectorHi $0246
14     ;Music Defines
15     #define pcr_Disabled $DD
16     #define pcr_Register $FF
17     #define pcr_Value $FD
18    
19     #define via_portb $0300
20     #define via_t1cl $0304
21     #define via_pcr $030C
22     #define via_porta $030F
23     ;Effect Defines
24     #define NoteC 0
25     #define NoteD 2
26     #define NoteE 4
27     #define NoteF 5
28     #define NoteG 7
29     #define NoteA 9
30     #define NoteB 11
31    
32     #define hEffectD 0
33     #define hEffectE 4
34     #define hEffectF 8
35     #define hEffectG 12
36     #define hEffectH 16
37     #define hEffectI 20
38     #define hEffectJ 24
39     #define hEffectK 28
40     #define hEffectL 32
41     #define hEffectM 36
42     #define hEffectN 40
43     #define hEffectO 44
44     #define hEffectP 48
45     #define hEffectQ 52
46     #define hEffectR 56
47     #define hEffectS 60
48     #define hEffectT 64
49     #define hEffectU 68
50     #define hEffectV 72
51    
52     #define EG20 1
53     #define EG09 2
54     #define EG02 3
55     ;Missing DEC/INC Period and Noise
56     #define efx_End 0
57     #define efx_ToneOn 1
58     #define efx_ToneOff 2
59     #define efx_NoiseOn 3
60     #define efx_NoiseOff 4
61     #define efx_EnvelopeOn 5
62     #define efx_EnvelopeOff 6
63     #define efx_SetAbsoluteMode 7
64     #define efx_IncPitch 8
65     #define efx_DecPitch 40
66     #define efx_IncNote 72
67     #define efx_DecNote 104
68     #define efx_SetNoiseRandom 136
69     #define efx_IncVolume 137
70     #define efx_DecVolume 138
71     #define efx_SkipZeroVolume 139
72     #define efx_SkipZeroCount 140
73     #define efx_Volume 141
74     #define efx_SetEnvTriangle 157
75     #define efx_SetEnvSawtooth 158
76     #define efx_FilterFrequency 159
77     #define efx_LoopRow 163
78     #define efx_SetCounter 185
79     #define efx_Pause 205
80     #define efx_SkipZeroPitch 255
81    
82    
83     .zero
84     ;*=$00
85     ;Music ZP Starts here..
86     irq_source .dsb 2
87     MusicTempoCount .dsb 1 ;Effect Tempo fixed at 100hz
88     PatternNotePeriod .dsb 3
89     irqTemp02 .dsb 1
90     irqTemp03 .dsb 1
91     irqTemp04 .dsb 1
92     ;Effect ZP starts here..
93     EffectSource .dsb 2
94     EffectTemp01 .dsb 1
95     EffectTemp02 .dsb 1
96    
97     irq_A .byt 0
98     irq_X .byt 0
99     irq_Y .byt 0
100     _FrameCounter .byt 0
101     _TimerCounter .byt 40 ;Slows key read to 25Hz
102    
103    
104     .text
105    
106     irqsav .dsb 2
107    
108    
109    
110     _PlayMainTune
111     lda #%10000000
112     jmp PlayAudio
113    
114     _StopMusic
115     lda #0
116     jmp PlayAudio
117    
118    
119     _restore_irq
120     sei
121     lda irqsav
122     ;sta $0245
123     sta $fffe
124     lda irqsav+1
125     ;sta $0246
126     sta $ffff
127     cli
128     rts
129    
130     _init_irq_routine
131     ;Since we are starting from when the standard irq has already been
132     ;setup, we need not worry about ensuring one irq event and/or right
133     ;timer period, only redirecting irq vector to our own irq handler.
134     sei
135     ;lda $0245
136     lda $fffe
137     sta irqsav
138     lda #<irq_routine
139     ;sta $0245 ;When we disable rom, we should change this to $fffe
140     sta $fffe
141     ;lda $0246
142     lda $ffff
143     sta irqsav+1
144     lda #>irq_routine
145     ;sta $0246 ;When we disable rom, we should change this to $ffff
146     sta $ffff
147    
148     ;Turn off music and sfx
149     lda #128
150     sta MusicStatus
151     ;sta EffectNumber
152     ;sta EffectNumber+1
153     ;sta EffectNumber+2
154    
155     cli
156     rts
157    
158     ;The IRQ routine will run (Like Oric) at 100Hz.
159     irq_routine
160     sei
161     ;Preserve registers
162     sta irq_A
163     stx irq_X
164     sty irq_Y
165    
166     ;Protect against Decimal mode
167     cld
168    
169     ;Clear IRQ event
170     lda via_t1cl
171    
172     ;Process Music
173     jsr ProcMusic
174    
175     ;Process timer event
176     dec _TimerCounter
177    
178     ;Restore Registers
179     lda irq_A
180     ldx irq_X
181     ldy irq_Y
182    
183     ;End of IRQ
184     cli
185     rti
186    
187     diskcntrl .byt $86
188    
189     _switch_eprom
190     lda $0314
191     and #%01111101
192     sta $0314
193     rts
194    
195     _switch_ovl
196     php
197     pha
198     sei
199     lda diskcntrl
200     eor #2
201     sta diskcntrl
202     sta $0314
203     pla
204     plp
205     rts
206    
207    
208     /*
209     _reboot_oric
210     .(
211     lda $0314
212     and #%01111101
213     sta $0314
214    
215     ldx #0
216     txs
217    
218     jmp $eb7e
219    
220     .)
221     */
222    
223    
224     ; X=Number of seconds
225     _WaitSecond
226     .(
227     loop
228     lda #100
229     sta _TimerCounter
230     wait
231     lda _TimerCounter
232     bne wait
233     dex
234     bne loop
235     rts
236     .)
237    
238    
239     _WaitTenFrames
240     ldx #10
241     jmp _WaitFrames
242     _WaitOneFrame
243     ldx #1
244     _WaitFrames ; X=Number of frames
245     .(
246     stx _TimerCounter
247     wait
248     lda _TimerCounter
249     bne wait
250     rts
251     .)
252    
253    
254    
255    
256     ;>>>> Call here
257     ;Load Accumulator with the following Bits before calling PlayAudio
258     ;Bit 0-1 Forms value 0-3
259     ; 0 Assign Music to Track specified in Data
260     ; 1 Assign Effect specified in Data to Channel A
261     ; 2 Assign Effect specified in Data to Channel B
262     ; 3 Assign Effect specified in Data to Channel C
263     ;Bit 2-6 Forms value 0-31
264     ; 0-31 Data
265     ;Bit 7-7 Forms value 0-1
266     ; 0 Stop Effect on specified Channel or Track
267     ; 1 Start Effect on specified Channel or Track
268     PlayAudio
269     sta paTemp01
270     and #03
271     beq ControlMusic
272    
273     #ifdef 0
274     tax
275     lda paTemp01
276     lsr
277     lsr
278     cmp #32
279     and #31
280     bcc StopEffect
281     StartEffect
282     ;
283     tay
284     lda Channel_SFX_NoteHeaders,y
285     dex
286     sta EffectNote,x
287     sty EffectTemp02
288     jsr CalcAndStorePitch
289     ldy EffectTemp02
290     lda Channel_SFX_EffectAndEGHeaders,y ;0-1 EG / 2-6 Effect
291     lsr
292     lsr
293     sta EffectNumber,x
294     lda #00
295     sta EffectIndex,x
296     sta FilterIndex,x
297     ;Disable Sample and Ornaments on this channel
298     lda #128
299     sta SampleProperty,x
300     sta OrnamentProperty,x
301    
302     lda Channel_SFX_EffectAndEGHeaders,y
303     and #03
304     .(
305     beq skip1 ;No EG Setting
306     tay
307     lda EGValue-1,y
308     sta AY_EGPeriodLo
309     skip1 rts
310     .)
311     StopEffect
312     lda #128
313     sta EffectNumber-1,x
314     lda #00
315     sta AY_Volume-1,x
316     rts
317     #endif
318     ControlMusic
319     ;Data holds index
320     lda paTemp01
321     lsr
322     lsr
323     and #31
324     tax
325     lda paTemp01
326     .(
327     bpl StopMusic
328     sei
329     sta TrackLoop ;Default Loop Off
330     ldy EventStart,x
331     sty EventIndex
332     lda TrackProperty,x ;B7==Loop B0-4==Music Tempo
333     bpl skip1
334     sty TrackLoop
335     skip1
336     and #63
337     STA MusicTempoCount
338     sta MusicTempoReference
339     lda EventEnd,x
340     sta EndEvent
341     lda TrackChannels,x
342     sta TracksChannelsUsed
343    
344     ;Enable all channels
345     lda #%01111000
346     sta AY_Status
347    
348     ;And start music
349     lda #00
350     sta MusicStatus
351     jsr ProcEvents
352     ldx #2
353     loop1
354     jsr ProcPattern
355     dex
356     bpl loop1
357     cli
358     rts
359    
360     StopMusic
361     .)
362     lda #128
363     sta MusicStatus
364     ;Silence channels that the music used
365     ldx #02
366     .(
367     loop1
368     lda #128
369     sta SampleProperty,X
370     sta OrnamentProperty,X
371     lsr TracksChannelsUsed
372     bcc skip1
373     lda #00
374     sta AY_Volume,x
375     skip1 dex
376     bpl loop1
377     .)
378     rts
379    
380     ;*********** Music Routines start here ******************
381    
382     MaximumVolume
383     .byt 0 ;0(Loud)-15(Mute)
384    
385     ProcMusic
386     dec MusicTempoCount
387     .(
388     bne skip4 ;28DA
389     lda MusicTempoReference
390     sta MusicTempoCount
391     lda MusicStatus
392     bmi SendAY ;28F7
393     skip1
394     ldx #2 ;Process Delays
395     loop2 ;Add Pattern Rest Check
396     lda PatternRest,x
397     bmi skip2
398     dec PatternNotePeriod,x
399     bne skip2 ;28C7
400     jsr ProcPattern
401     lda MusicStatus
402     bne skip3 ;28CA
403     skip2 dex
404     bpl loop2 ;28BB
405    
406     skip3
407     lda MusicStatus
408     lsr
409     bcc skip4 ;28DA
410     asl
411     sta MusicStatus
412     jsr ProcEvents ;ProcEvents
413     jmp skip1
414     skip4
415     ldx #$02
416     loop3
417     lda SampleProperty,X
418     bmi skip5 ;28EC
419     jsr ProcSample ;ProcSample
420     skip5
421     lda OrnamentProperty,X
422     bmi skip6 ;28F4
423     jsr ProcOrnament ;Process Ornaments
424     skip6
425     dex
426     bpl loop3 ;28E4
427     .)
428    
429    
430     ControlMaximumVolume
431     ldx #02
432     .(
433     loop1 lda ReferenceBank+8,x
434     cmp RegisterBank+8,x
435     beq skip2
436     lda AY_Volume,x
437     sec
438     sbc MaximumVolume
439     bcs skip1
440     lda #00
441     skip1 sta AY_Volume,x
442     skip2 dex
443     bpl loop1
444     .)
445    
446     ;Expand SendAY
447     ; 1)include EG
448     ; 2)Pitch Registers are indexed
449     ; 3)Reference Bank avoids sending same value twice
450     SendAY ldy #$0D
451     .(
452     loop1
453     ldx RegisterPointer,y
454     lda RegisterBank,x
455     cmp ReferenceBank,x
456     beq skip1
457     sta ReferenceBank,x
458     sty via_porta
459     ldx #pcr_Register
460     stx via_pcr
461     ldx #pcr_Disabled
462     stx via_pcr
463     sta via_porta
464     lda #pcr_Value
465     sta via_pcr
466     stx via_pcr
467     skip1
468     dey
469     bpl loop1
470     .)
471    
472     rts
473    
474     ProcPattern
475     LDA RuntimePatternBaseLo,X
476     STA irq_source
477     LDA RuntimePatternBaseHi,X
478     STA irq_source+1
479     LDY RuntimePatternIndex,X
480     LDA (irq_source),Y
481     PHP
482     AND #127
483     CMP #126
484    
485     BCS mskip1 ; 2968
486     ADC RuntimePatternNoteOffset,X ;Note Offset
487     STA RuntimeNote,X
488     LDA #0
489     STA SampleIndex,x
490     STA OrnamentIndex,x
491     INY
492     LDA (irq_source),Y
493     LSR
494     LSR
495     LSR
496     LSR
497     STA OrnamentProperty,X ;Ornament Number
498     LDA (irq_source),Y
499     AND #$0F
500     PLP
501     BPL mskip2 ;295B
502     STA AY_Volume,X
503     LDA #$80
504     mskip2 STA SampleProperty,X
505     LDA #$01
506     Routine2960
507     STA PatternNotePeriod,X
508     INY
509     Routine2963
510     TYA
511     STA RuntimePatternIndex,X
512     RTS
513     mskip1
514     BNE mskip3 ; 2971
515     PLP
516     INY
517     LDA (irq_source),Y
518     JMP Routine2960
519     mskip3
520    
521     PLP
522     LDA #$01
523     STA PatternNotePeriod,X
524     LDA MusicStatus
525     ORA #$01
526     STA MusicStatus
527     JMP Routine2963
528    
529     ProcOrnament ;Ornament
530     ;A is Ornament Number
531     tay
532     lda OrnamentAddressTableLo,y
533     sta irq_source
534     lda OrnamentAddressTableHi,y
535     sta irq_source+1
536     mloop10 LDY OrnamentIndex,x
537     LDA (irq_source),Y
538     BEQ Routine29C7
539     cmp #03 ;$03 is flag to loop to start
540     bne mskip10
541     lda #00
542     sta OrnamentIndex,X
543     jmp mloop10
544     mskip10 LSR
545     BCS Routine29D7
546     LSR
547     BCS Routine29AA
548     ;Note?
549     ADC RuntimeNote,X
550     JMP Routine29B1
551     Routine29AA
552     STA irqTemp02
553     LDA RuntimeNote,X
554     SBC irqTemp02
555     Routine29B1
556     JSR Routine2AE2
557     ;Resultant pitch in A(Lo) and irq_source(Hi)
558     sta AY_PitchLo,x
559     lda irq_source
560     sta AY_PitchHi,x
561     Routine29B9
562     INY
563     TYA
564     STA OrnamentIndex,X
565     RTS
566     Routine29C7
567     CPY #$00
568     BNE Routine29D1
569     LDA RuntimeNote,X
570     JSR Routine29B1
571     Routine29D1
572     LDA #$80
573     STA OrnamentProperty,X
574     RTS
575     Routine29D7 ;Pitch
576     LSR
577     PHP
578     STA irqTemp04
579     LDA RuntimeNote,X
580     JSR Routine2AE2
581     PLP
582     BCS Routine29F0
583     ADC irqTemp04
584     sta AY_PitchLo,x
585     LDA irq_source
586     ADC #$00
587     sta AY_PitchHi,x
588     JMP Routine29B9
589     Routine29F0
590     SBC irqTemp04
591     sta AY_PitchLo,x
592     LDA irq_source
593     SBC #$00
594     sta AY_PitchHi,x
595     JMP Routine29B9
596    
597     ProcSample ;Sample (A==SampleNum?)
598     tay
599     lda SampleAddressTableLo,y
600     sta irq_source
601     lda SampleAddressTableHi,y
602     sta irq_source+1
603     LDY SampleIndex,X
604     LDA (irq_source),Y
605     BEQ Routine2A55
606     PHA
607     AND #$0F
608     STA AY_Volume,X
609     PLA
610     LSR
611     LSR
612     LSR
613     AND #$1E
614     STA AY_Noise
615     BEQ Routine2A46
616     JSR Routine2A5B
617     EOR #$FF
618     AND AY_Status
619     JMP Routine2A4C
620     Routine2A46
621     JSR Routine2A5B
622     ORA AY_Status
623     Routine2A4C
624     STA AY_Status
625     INY
626     TYA
627     STA SampleIndex,X
628     RTS
629     Routine2A55
630     LDA #$80
631     STA SampleProperty,X
632     RTS
633     Routine2A5B
634     LDA #$04
635     STX irqTemp02
636     Routine2A5F
637     ASL
638     DEX
639     BPL Routine2A5F
640     LDX irqTemp02
641     RTS
642    
643     ProcEvents
644     LDX #$02
645     LDA #$00
646     Routine2A6A
647     STA RuntimePatternIndex,X
648     DEX
649     BPL Routine2A6A
650     ; DEC EventRowRepeats
651     ; BMI Routine2A76
652     ; RTS
653     Routine2A76
654     LDX EventIndex
655     LDA Event_A_Pats,X
656     sta PatternRest
657     AND #$1F
658     TAY
659     LDA Table33A4,Y
660     STA RuntimePatternBaseLo
661     LDA Table33AC,Y
662     STA RuntimePatternBaseHi
663     LDA Event_A_NOFS,X
664     AND #$7F
665     STA RuntimePatternNoteOffset
666    
667     LDA Event_B_Pats,X
668     sta PatternRest+1
669     AND #$1F
670     TAY
671     LDA Table33B4,Y
672     STA RuntimePatternBaseLo+1
673     LDA Table33BC,Y
674     STA RuntimePatternBaseHi+1
675     LDA Event_B_NOFS,X
676     AND #$7F
677     STA RuntimePatternNoteOffset+1
678    
679     LDA Event_C_Pats,X
680     sta PatternRest+2
681     AND #$1F
682     TAY
683     LDA Table33C4,Y
684     STA RuntimePatternBaseLo+2
685     LDA Table33CC,Y
686     STA RuntimePatternBaseHi+2
687     LDA Event_C_NOFS,X
688     AND #$7F
689     STA RuntimePatternNoteOffset+2
690     INX
691     CPX EndEvent ;#$0B
692     BCC Routine2ADE
693     ;Handle Looping
694     lda TrackLoop
695     nop
696     bmi mskip99
697     sta EventIndex
698     rts
699    
700     mskip99 LDA MusicStatus
701     ORA #$80
702     STA MusicStatus
703     Routine2ADE
704     STX EventIndex
705     RTS
706     Routine2AE2
707     STX irqTemp02
708     LDX #$FF
709     SEC
710     SBC #$40
711     BCC Routine2B0B
712     Routine2AEB
713     INX
714     SBC #$0C
715     BCS Routine2AEB
716     STX irqTemp03
717     ADC #$0C
718     TAX
719     LDA BasePitchHi,X
720     STA irq_source
721     LDA BasePitchLo,X
722     LDX irqTemp03
723     BEQ Routine2B07
724     Routine2B01
725     LSR irq_source
726     ROR
727     DEX
728     BNE Routine2B01
729     Routine2B07
730     LDX irqTemp02
731     CLC
732     RTS
733     Routine2B0B
734     LDA #$00
735     STA irq_source
736     LDX irqTemp02
737     RTS
738    
739     ;******************* Effect Code Starts here ************************
740     #ifdef 0
741     ProcEffect
742     ldx #02
743     .(
744     loop3 ldy EffectNumber,x
745     bmi skip2
746     lda PauseDelay,x
747     beq skip3
748     dec PauseDelay,x
749     jmp skip2
750    
751     skip3 lda EffectBaseAddressLo,y
752     sta EffectSource
753     lda EffectBaseAddressHi,y
754     sta EffectSource+1
755     loop2 ldy EffectIndex,x
756     lda (EffectSource),y
757     ldy #24
758     loop1 cmp EffectCodeThreshhold,y
759     bcs skip1
760     dey
761     bpl loop1
762     skip1 sbc EffectCodeThreshhold,y
763     pha
764     lda EffectCodeVectorLo,y
765     sta vector1+1
766     lda EffectCodeVectorHi,y
767     sta vector1+2
768     pla
769     clc
770     vector1 jsr $dead
771     inc EffectIndex,x
772     bcs skip2
773     jmp loop2
774     skip2 dex
775     bpl loop3
776     .)
777     ;Now Process Effect Pitch
778     ldx #02
779     .(
780     loop1 ldy FilterIndex,x
781     beq skip3
782     lda EffectPitchLo,x
783     and FilterMask-1,y
784     sta AY_PitchLo,x
785     lda #00
786     sta AY_PitchHi,x
787     jmp skip1
788     ;Store Pitch
789     skip3 lda EffectPitchLo,x
790     sta AY_PitchLo,x
791     lda EffectPitchHi,x
792     sta AY_PitchHi,x
793     skip1 dex
794     bpl loop1
795     .)
796     rts
797    
798     efxc_End ;00 000(1)
799     lda #128
800     sta EffectNumber,x
801     sec ;Wait indefinately
802     rts
803     efxc_ToneOn ;01 001(1)
804     lda AY_Status
805     and ToneMask,x
806     sta AY_Status
807     rts
808     efxc_ToneOff ;02 002(1)
809     lda AY_Status
810     ora ToneBit,x
811     sta AY_Status
812     rts
813     efxc_NoiseOn ;03 003(1)
814     lda AY_Status
815     and NoiseMask,x
816     sta AY_Status
817     rts
818     efxc_NoiseOff ;04 004(1)
819     lda AY_Status
820     ora NoiseBit,x
821     sta AY_Status
822     rts
823     efxc_EnvelopeOn ;05 005(1)
824     lda AY_Volume,x
825     ora #16
826     sta AY_Volume,x
827     rts
828     efxc_EnvelopeOff ;06 006(1)
829     lda AY_Volume,x
830     and #15
831     sta AY_Volume,x
832     rts
833     efxc_SetAbsoluteMode ;07 007(1)
834     lda #01
835     sta AbsoluteMode,x
836     rts
837     efxc_SetNoiseRandom
838     jsr getrand2
839     and #31
840     sta AY_Noise
841     rts
842     efxc_IncVolume ;13 137(1)
843     inc AY_Volume,x
844     rts
845     efxc_DecVolume ;14 138(1)
846     dec AY_Volume,x
847     rts
848     efxc_Volume ;17 141(16)
849     sta AY_Volume,x
850     rts
851     efxc_SetEnvTriangle ;18 157(1)
852     lda #10
853     sta AY_EGCycle
854     rts
855     efxc_SetEnvSawtooth ;19 158(1)
856     lda #12
857     sta AY_EGCycle
858     rts
859     efxc_SetCounter ;22 185(20)
860     sta EffectCounter,x
861     rts
862     efxc_Pause ;23 205(50)
863     sta PauseDelay,x
864     sec ;Wait on Pause
865     rts
866     efxc_IncPitch ;08 008(32)
867     sta PitchOffset
868     ;Inc Pitch Relative
869     lda EffectPitchLo,x
870     clc
871     adc PitchOffset
872     sta TempPitchLo
873     lda EffectPitchHi,x
874     adc #00
875     and #15
876     sta TempPitchHi
877     jmp efxc_PitchSort
878    
879    
880     efxc_DecPitch ;09 040(32)
881     sta PitchOffset
882     ;Inc Pitch Relative
883     lda EffectPitchLo,x
884     sec
885     sbc PitchOffset
886     sta TempPitchLo
887     lda EffectPitchHi,x
888     sbc #00
889     and #15
890     sta TempPitchHi
891     efxc_PitchSort
892     ;Support Relative & Absolute Modes
893     ldy AbsoluteMode,x
894     .(
895     beq skip1
896     lda TempPitchLo
897     sta EffectPitchLo,x
898     lda TempPitchHi
899     sta EffectPitchHi,x
900    
901     skip1
902     .)
903     clc
904     rts
905    
906    
907     efxc_IncNote ;10 072(32)
908     sta NoteOffset
909     ;Inc Note Relative
910     lda EffectNote,x
911     clc
912     adc NoteOffset
913     ;Support Relative & Absolute Modes
914     ldy AbsoluteMode,x
915     .(
916     beq skip1
917     sta EffectNote,x
918     skip1 jmp CalcAndStorePitch ;Store also to EffectPitchLo and Hi
919     .)
920    
921     efxc_DecNote ;11 104(32)
922     sta NoteOffset
923     ;Dec Note Relative
924     lda EffectNote,x
925     sec
926     sbc NoteOffset
927     ;Support Relative & Absolute Modes
928     ldy AbsoluteMode,x
929     .(
930     beq skip1
931     sta EffectNote,x
932     skip1 jmp CalcAndStorePitch
933     .)
934    
935     efxc_SkipZeroPitch
936     ldy #00
937     lda AY_PitchLo,x
938     jmp SkipZeroCountRent
939     efxc_SkipZeroVolume ;15 139(1)
940     lda AY_Volume,x
941     ldy #00
942     and #15
943     jmp SkipZeroCountRent
944     efxc_SkipZeroCount ;16 140(1)
945     ldy #00
946     lda EffectCounter,x
947     SkipZeroCountRent
948     .(
949     bne skip1
950     ldy #01
951     skip1 tya
952     .)
953     sta SkipLoopFlag,x
954     rts
955     efxc_LoopRow ;21 163(22)
956     sta EffectTemp01
957     ;Count counter
958     lda EffectCounter,x
959     .(
960     beq skip2
961     dec EffectCounter,x
962     skip2 lda SkipLoopFlag,x
963     bne skip1
964     lda EffectIndex,x
965     sec
966     sbc EffectTemp01
967     sta EffectIndex,x
968     dec EffectIndex,x
969     ;On a loop, disable any transient sample/ornament flags
970     lda #128
971     sta SampleProperty,x
972     sta OrnamentProperty,x
973     clc
974     skip1 lda #00
975     sta SkipLoopFlag,x
976     rts
977     .)
978    
979     efxc_FilterFrequency ;20 159(4)
980     ;Need to check original code (possibly latest)
981     sta FilterIndex,x
982     rts
983    
984     random2 .word $3611
985     temprand .byt $00
986     getrand2
987     lda random2+1
988     sta temprand
989     lda random2
990     asl
991     rol temprand
992     asl
993     rol temprand
994    
995     clc
996     adc random2
997     pha
998     lda temprand
999     adc random2+1
1000     sta random2+1
1001     pla
1002     adc #$11
1003     sta random2
1004     lda random2+1
1005     adc #$36
1006     sta random2+1
1007     rts
1008    
1009     CalcAndStorePitch ;Store also to EffectPitchLo and Hi
1010     ;Note in "A" - Use Routine2AEB (Sonix routine)
1011     ldy #255
1012     .(
1013     loop1 iny
1014     sbc #$0C
1015     bcs loop1
1016     sty irqTemp03
1017     adc #$0C
1018     tay
1019     lda BasePitchHi,y
1020     sta irq_source
1021     lda BasePitchLo,y
1022     ldy irqTemp03
1023     beq skip1
1024     loop2 lsr irq_source
1025     ror
1026     dey
1027     bne loop2
1028     skip1 ;A==Low irq_source==High
1029     .)
1030     sta EffectPitchLo,x
1031     lda irq_source
1032     sta EffectPitchHi,x
1033     rts
1034    
1035     #endif
1036    
1037     ;**** Generic Routine Tables and Variables go here *****
1038     paTemp01 .byt 0
1039     EventStart
1040     .byt 0 ;Title Tune (Start Event 0) (ABC)
1041     .byt 10 ;Reggae Track (AB)
1042     .byt 11 ;Repeating Drum Pattern (A)
1043     .byt 12 ;Pool Music (AB)
1044     .byt 13 ;Hifi Music (AB)
1045     EventEnd
1046     .byt 10 ;Title Tune (End on Event 10)
1047     .byt 11
1048     .byt 12
1049     .byt 13
1050     .byt 14
1051     TrackProperty
1052     .byt 128+13 ;Title Tune (Loop and tempo 13)
1053     .byt 128+16
1054     .byt 128+14
1055     .byt 128+30
1056     .byt 128+12
1057     TrackChannels
1058     .byt 1+2+4
1059     .byt 2+4
1060     .byt 4
1061     .byt 2+4
1062     .byt 2+4
1063     TracksChannelsUsed
1064     .byt 0
1065    
1066     ;************** Music Data Starts Here *****************
1067    
1068     PatternRest
1069     .byt 0,0,0
1070     Event_A_Pats ;Event A Patterns
1071     ; 00 01 02 03 04 05 06 07 08 09 10 11 12 13
1072     .byt $00,$01,$02,$03,$04,$05,$06,$03,$04,$07,$04,$04,$06,$03
1073     Event_A_NOFS ;Event A Note Offsets
1074     .byt $40,$34,$34,$34,$34,$34,$34,$34,$34,$34,$34,$34,$34,$34
1075     Event_B_Pats ;Event B Patterns
1076     .byt $00,$01,$02,$03,$04,$05,$06,$03,$04,$07,$03,$80,$04,$04 ;$80 is pattern rest
1077     Event_B_NOFS ;Event B Note Offsets
1078     .byt $40,$34,$34,$34,$34,$34,$34,$34,$34,$34,$34,$34,$34,$34
1079     Event_C_Pats ;Event C Patterns
1080     .byt $00,$01,$02,$03,$04,$05,$06,$03,$04,$07,$80,$80,$80,$80
1081     Event_C_NOFS ;Event C Note Offsets
1082     .byt $40,$40,$34,$34,$34,$34,$34,$34,$34,$34,$34,$34,$34,$34
1083    
1084     ;Pattern Memory
1085     Pattern2B60
1086     .byt $39,$0,$FE,$3,$3F,$0,$FE,$3,$3E,$0,$FE,$7,$BE,$0,$FE,$3,$38,$0
1087     .byt $FE,$1,$3A,$0,$BA,$0,$3C,$0,$FE,$9,$BC,$0,$FE,$1,$37,$0,$FE,$B
1088     .byt $3C,$0,$FE,$2,$BC,$0,$3C,$0,$FE,$1,$BC,$0,$FE,$4,$F8,$0,$FE,$4,$FF
1089     Pattern2B97
1090     .byt $30,$0,$FE,$1,$B0,$0,$FE,$1,$30,$0,$FE,$1,$B0,$0,$FE,$1,$2E,$0
1091     .byt $FE,$1,$AE,$0,$FE,$1,$2E,$0,$FE,$1,$AE,$0,$FE,$1,$2D,$0,$FE,$1
1092     .byt $AD,$0,$FE,$1,$2D,$0,$FE,$1,$AD,$0,$FE,$1,$2C,$0,$FE,$1,$AC,$0
1093     .byt $FE,$1,$2C,$0,$FE,$1,$AC,$0,$FE,$1,$2B,$0,$FE,$C,$AB,$0,$FE,$5
1094     .byt $37,$0,$43,$0,$37,$0,$43,$0,$37,$0,$43,$0,$37,$0,$43,$0,$37,$0
1095     .byt $43,$0,$37,$0,$43,$0,$37,$0,$FF
1096     Pattern2BFA
1097     .byt $FE,$3,$29,$11,$29,$11,$A9,$0,$29,$11,$FE,$1,$29,$11,$A9,$0,$FE,$9
1098     .byt $29,$11,$29,$11,$A9,$0,$29,$11,$FE,$1,$29,$11,$FE,$1,$A9,$0,$FE,$9
1099     .byt $29,$11,$A9,$0,$FE,$2,$29,$11,$A9,$0,$FE,$16,$FF
1100     Pattern2C2B
1101     .byt $41,$22,$C1,$0,$79,$3,$30,$14,$3C,$14,$FE,$1,$30,$14,$B0,$0,$30
1102     .byt $14,$B0,$0,$79,$3,$30,$14,$3C,$14,$FE,$1,$30,$14,$B0,$0,$30,$14
1103     .byt $B0,$0,$79,$3,$30,$14,$3C,$14,$BC,$0,$30,$14,$B0,$0,$30,$14,$B0
1104     .byt $0,$30,$14,$B0,$0,$41,$22,$C1,$0,$30,$14,$30,$14,$41,$22,$C1,$0
1105     .byt $79,$3,$30,$14,$3C,$14,$FE,$1,$30,$14,$B0,$0,$30,$14,$B0,$0,$79
1106     .byt $3,$30,$14,$3C,$14,$FE,$1,$30,$14,$B0,$0,$41,$22,$C1,$0,$78,$3
1107     .byt $F8,$0,$78,$2,$F8,$0,$78,$3,$30,$14,$78,$2,$F8,$0,$FE,$2,$48,$0
1108     .byt $4B,$0,$4F,$0,$C3,$0,$FF
1109     Pattern2CAA
1110     .byt $41,$22,$C1,$0,$79,$3,$30,$14,$3C,$14,$FE,$1,$30,$14,$B0,$0,$30
1111     .byt $14,$B0,$0,$79,$3,$30,$14,$3C,$14,$FE,$1,$30,$14,$B0,$0,$30,$14
1112     .byt $B0,$0,$79,$3,$30,$14,$3C,$14,$BC,$0,$30,$14,$B0,$0,$30,$14,$B0
1113     .byt $0,$30,$14,$B0,$0,$41,$22,$C1,$0,$30,$14,$30,$14,$41,$22,$C1,$0
1114     .byt $79,$3,$30,$14,$3C,$14,$FE,$1,$30,$14,$B0,$0,$30,$14,$B0,$0,$79
1115     .byt $3,$30,$14,$3C,$14,$FE,$1,$30,$14,$B0,$0,$30,$14,$B0,$0,$79,$3
1116     .byt $30,$14,$3C,$14,$BC,$0,$30,$14,$B0,$0,$30,$14,$B0,$0,$30,$14,$B0
1117     .byt $0,$41,$22,$C1,$0,$30,$14,$B0,$0,$FF
1118     Pattern2D2B
1119     .byt $2B,$11,$FE,$F,$2B,$11,$FE,$F,$41,$22,$C1,$0,$79,$3,$30,$14,$3C
1120     .byt $14,$FE,$1,$30,$14,$B0,$0,$30,$14,$B0,$0,$79,$3,$30,$14,$3C,$14
1121     .byt $FE,$1,$30,$14,$B0,$0,$30,$14,$B0,$0,$79,$3,$30,$14,$3C,$14,$BC
1122     .byt $0,$30,$14,$B0,$0,$30,$14,$B0,$0,$30,$14,$B0,$0,$41,$22,$C1,$0
1123     .byt $30,$14,$B0,$0,$FF
1124     Pattern2D74
1125     .byt $2E,$11,$FE,$17,$2B,$11,$FE,$1,$2B,$11,$FE,$1,$2B,$11,$FE,$1,$2B
1126     .byt $11,$FE,$1,$2B,$11,$FE,$3,$BA,$A,$FE,$2,$BA,$0,$BE,$A,$FE,$1,$2B
1127     .byt $11,$FE,$1,$2B,$11,$FE,$1,$2B,$11,$FE,$1,$2B,$11,$FE,$3,$BC,$A,$FE
1128     .byt $2,$C0,$0,$C0,$A,$FE,$1,$2B,$11,$FE,$1,$2B,$11,$FE,$1,$2B,$11,$FE
1129     .byt $1,$FF
1130     Pattern2DBD
1131     .byt $F8,$0,$FE,$23,$2B,$11,$FE,$1,$2B,$11,$FE,$1,$2B,$11,$FE,$B,$2B
1132     .byt $11,$FE,$1,$2B,$11,$FE,$1,$2B,$11,$FE,$3,$2B,$11,$35,$0,$39,$0
1133     .byt $3C,$0,$FF
1134     Pattern8A
1135     Pattern8B
1136     Pattern8C
1137     .byt $F8,$0,$FE,63
1138     .byt $FF
1139    
1140     Pattern2DE2
1141     .byt $23,$0,$FE,$1,$A3,$0,$FE,$1,$23,$0,$FE,$1,$A3,$0,$FE,$1,$22,$0
1142     .byt $FE,$1,$A2,$0,$FE,$1,$22,$0,$FE,$1,$A2,$0,$FE,$1,$27,$0,$FE,$1
1143     .byt $A7,$0,$FE,$1,$27,$0,$FE,$1,$A7,$0,$FE,$1,$25,$0,$FE,$1,$A5,$0
1144     .byt $FE,$1,$25,$0,$FE,$1,$A5,$0,$24,$0,$FE,$2,$A4,$0,$FE,$1,$24,$0
1145     .byt $A4,$0,$FE,$1,$24,$0,$27,$0,$FE,$1,$A7,$0,$FE,$1,$25,$0,$FE,$1
1146     .byt $A5,$0,$FE,$1,$24,$0,$FE,$1,$A4,$0,$FE,$1,$24,$0,$FE,$1,$A4,$0
1147     .byt $FE,$4,$F8,$0,$FE,$4,$FF
1148     Pattern2E55
1149     .byt $3F,$0,$FE,$A,$3E,$0,$FE,$3,$41,$0,$41,$0,$FE,$9,$C1,$0,$3F,$0
1150     .byt $3E,$0,$FE,$1,$3C,$0,$FE,$1,$3E,$0,$FE,$F,$BE,$0,$FE,$2,$43,$0
1151     .byt $FE,$9,$C3,$0,$FE,$2,$FF
1152     Pattern2E80
1153     .byt $FE,$3,$41,$0,$41,$0,$43,$0,$FE,$1,$40,$0,$FE,$8,$C0,$0,$FE,$2
1154     .byt $40,$0,$3F,$0,$BF,$0,$3E,$0,$BE,$0,$3D,$0,$FE,$7,$BD,$0,$FE,$2
1155     .byt $3D,$0,$3C,$0,$FE,$1,$3B,$0,$FE,$1,$3C,$0,$FE,$8,$BC,$0,$FE,$2
1156     .byt $3B,$0,$FE,$3,$3C,$0,$BC,$0,$FE,$1,$48,$0,$3C,$0,$FE,$1,$3E,$0
1157     .byt $FE,$1,$FF
1158     Pattern2ECB
1159     .byt $24,$0,$A4,$0,$FE,$1,$22,$0,$1F,$0,$FE,$1,$22,$0,$A2,$0,$24,$0
1160     .byt $A4,$0,$22,$0,$FE,$1,$1F,$0,$FE,$1,$22,$0,$A2,$0,$20,$0,$FE,$1
1161     .byt $A0,$0,$FE,$1,$27,$0,$A7,$0,$FE,$1,$2C,$0,$AC,$0,$2C,$0,$AC,$0
1162     .byt $2C,$0,$27,$0,$A7,$0,$FE,$2,$24,$0,$A4,$0,$FE,$1,$22,$0,$1F,$0
1163     .byt $FE,$1,$22,$0,$A2,$0,$24,$0,$A4,$0,$22,$0,$FE,$1,$1F,$0,$FE,$1
1164     .byt $22,$0,$A2,$0,$20,$0,$FE,$1,$A0,$0,$FE,$1,$1F,$0,$FE,$1,$9F,$0
1165     .byt $FE,$1,$24,$0,$FE,$1,$A4,$0,$FE,$1,$3C,$35,$FE,$3,$FF
1166     Pattern2F46
1167     .byt $24,$0,$A4,$0,$FE,$1,$22,$0,$1F,$0,$FE,$1,$22,$0,$A2,$0,$24,$0
1168     .byt $A4,$0,$22,$0,$FE,$1,$1F,$0,$FE,$1,$22,$0,$A2,$0,$20,$0,$FE,$1
1169     .byt $A0,$0,$FE,$1,$27,$0,$A7,$0,$FE,$1,$2C,$0,$AC,$0,$2C,$0,$AC,$0
1170     .byt $2C,$0,$27,$0,$A7,$0,$FE,$2,$24,$0,$A4,$0,$FE,$1,$22,$0,$1F,$0
1171     .byt $FE,$1,$22,$0,$A2,$0,$24,$0,$A4,$0,$22,$0,$FE,$1,$1F,$0,$FE,$1
1172     .byt $22,$0,$A2,$0,$24,$0,$A4,$0,$FE,$1,$22,$0,$1F,$0,$FE,$1,$22,$0
1173     .byt $A2,$0,$24,$0,$A4,$0,$22,$0,$FE,$1,$1F,$0,$FE,$1,$22,$0,$A2,$0,$FF
1174     Pattern2FC5
1175     .byt $4A,$0,$FE,$3,$4F,$0,$FE,$9,$CF,$0,$FE,$9,$56,$0,$51,$0,$4D,$0
1176     .byt $4A,$0,$47,$0,$43,$0,$3B,$0,$35,$0,$24,$0,$A4,$0,$FE,$1,$22,$0
1177     .byt $1F,$0,$FE,$1,$22,$0,$A2,$0,$24,$0,$A4,$0,$22,$0,$FE,$1,$1F,$0
1178     .byt $FE,$1,$22,$0,$A2,$0,$24,$0,$A4,$0,$FE,$1,$22,$0,$1F,$0,$FE,$1
1179     .byt $22,$0,$A2,$0,$24,$0,$A4,$0,$22,$0,$FE,$1,$1F,$0,$FE,$1,$22,$0
1180     .byt $A2,$0,$FF
1181     Pattern3022
1182     .byt $4B,$0,$FE,$1B,$4A,$0,$FE,$3,$4F,$0,$FE,$F,$4C,$0,$FE,$F,$FF
1183     Pattern3033
1184     .byt $A9,$11,$FE,$1,$A9,$12,$FE,$1,$A9,$13,$FE,$1,$A9,$14,$FE,$1
1185     .byt $A9,$15,$FE,$1,$A9,$16,$FE,$1,$A9,$17,$FE,$1,$A9,$18,$FE,$1
1186     .byt $A9,$19,$FE,$1,$A9,$1A,$FE,$1,$A9,$1B,$FE,$1,$A9,$1C,$FE,$1
1187     .byt $A9,$1D,$FE,$1,$29,$11,$FE,$1,$29,$11,$29,$11,$29,$11,$29,$11
1188     .byt $3E,$0,$FE,$1B,$33,$0,$34,$0,$3B,$0,$3E,$0,$FF
1189    
1190     Pattern3080
1191     .byt $39,$0,$FE,$9,$38,$0,$FE,$1,$37,$0,$B7,$0,$35,$0,$FE,$1,$37,$0
1192     .byt $FE,$8,$B7,$0,$FE,$1,$37,$0,$35,$0,$FE,$1,$33,$0,$FE,$1,$30,$0
1193     .byt $FE,$5,$B0,$0,$FE,$5,$37,$0,$FE,$3,$3C,$0,$FE,$2,$BC,$0,$3C,$0
1194     .byt $FE,$6,$F8,$0,$FE,$4,$FF
1195     Pattern30BD
1196     .byt $4B,$0,$FE,$2,$46,$0,$4A,$0,$4B,$0,$4D,$0,$CD,$0,$4F,$0,$FE,$5
1197     .byt $CF,$0,$FE,$2,$43,$0,$FE,$1,$45,$0,$FE,$1,$46,$0,$FE,$1,$48,$0
1198     .byt $FE,$6,$C8,$0,$FE,$4,$3B,$0,$BB,$0,$3B,$0,$BB,$0,$3C,$0,$BC,$0
1199     .byt $3C,$0,$FE,$1,$BC,$0,$FE,$1,$3C,$0,$3C,$0,$3C,$0,$3B,$0,$BB,$0
1200     .byt $FE,$5,$37,$0,$3A,$0,$3B,$0,$3C,$0,$3E,$0,$40,$0,$41,$0,$44,$0
1201     .byt $50,$0,$FF
1202     Pattern311A
1203     .byt $55,$0,$FE,$B,$54,$0,$FE,$3,$4E,$0,$FE,$B,$4F,$0,$FE,$3,$52,$0
1204     .byt $FE,$3,$2E,$0,$FE,$1,$AE,$0,$FE,$1,$2C,$0,$FE,$1,$AC,$0,$FE,$1
1205     .byt $50,$0,$FE,$3,$47,$0,$FE,$2,$2F,$0,$2F,$0,$FE,$2,$48,$0,$30,$0
1206     .byt $FE,$1,$B0,$0,$FE,$1,$48,$0,$C8,$0,$4A,$0,$FE,$1,$FF
1207     Pattern315F
1208     .byt $39,$0,$FE,$A,$38,$0,$37,$0,$FE,$1,$35,$0,$FE,$1,$37,$0,$FE,$8
1209     .byt $B7,$0,$FE,$1,$37,$0,$35,$0,$FE,$1,$33,$0,$FE,$1,$3C,$0,$FE,$F
1210     .byt $BC,$0,$FE,$F,$FF
1211     Pattern3188
1212     .byt $37,$0,$FE,$F,$38,$0,$FE,$B,$37,$0,$FE,$3,$3C,$0,$FE,$D,$BC,$0
1213     .byt $FE,$1,$3A,$0,$FE,$F,$FF
1214     Pattern31A1
1215     .byt $46,$0,$FE,$F,$50,$0,$4D,$0,$4A,$0,$47,$0,$4D,$0,$4A,$0,$47,$0
1216     .byt $44,$0,$4A,$0,$47,$0,$44,$0,$41,$0,$47,$0,$44,$0,$41,$0,$3E,$0
1217     .byt $48,$4,$FE,$1,$3C,$4,$BC,$0,$48,$4,$C8,$0,$FE,$2,$48,$4,$C8,$0
1218     .byt $3C,$4,$BC,$0,$48,$4,$C8,$0,$FE,$2,$48,$4,$C8,$0,$3C,$4,$BC,$0
1219     .byt $48,$4,$C8,$0,$FE,$2,$48,$4,$FE,$1,$3C,$4,$BC,$0,$48,$4,$C8,$0
1220     .byt $FE,$2,$FF
1221     Pattern31FE
1222     .byt $2F,$0,$FE,$7,$2E,$0,$FE,$7,$2D,$0,$FE,$7,$2C,$0,$FE,$7,$2B,$0
1223     .byt $FE,$F,$30,$0,$FE,$F,$FF
1224     Pattern3217
1225     .byt $F8,$0,$A9,$11,$FE,$1,$A9,$12,$FE,$1,$A9,$13,$FE,$1,$A9,$14,$FE
1226     .byt $1,$A9,$15,$FE,$1,$A9,$16,$FE,$1,$A9,$17,$FE,$1,$A9,$18,$FE,$1
1227     .byt $A9,$19,$FE,$1,$A9,$1A,$FE,$1,$A9,$1B,$FE,$1,$A9,$1C,$FE,$1,$A9
1228     .byt $1D,$FE,$1,$29,$11,$FE,$1,$29,$11,$29,$11,$29,$11,$32,$0,$FE,$F
1229     .byt $31,$0,$FE,$7,$30,$0,$FE,$7,$FF
1230    
1231     OrnamentAddressTableLo
1232     .byt <Ornament0
1233     .byt <Ornament1
1234     .byt <Ornament2
1235     .byt <Ornament3
1236     OrnamentAddressTableHi
1237     .byt >Ornament0
1238     .byt >Ornament1
1239     .byt >Ornament2
1240     .byt >Ornament3
1241    
1242     OrnamentData
1243     Ornament0 ;Repeat
1244     .byt $01,$05,$01,$07,$03 ;$03 is flag to loop to start
1245     Ornament1
1246     .byt $01,$0E,$16,$22,$32,$3E,$4A,$62,$6E,$76,$82,$8E,$00
1247     Ornament2
1248     .byt $01,$0E,$16,$22,$32,$3E,$4A,$62,$6E,$76,$82,$8E,$FE,$00
1249     Ornament3
1250     .byt $01,$01,$04,$04,$0C,$0C,$14,$14,$20,$20,$30,$30,$30,$3C,$3C,$3C ;3
1251     .byt $44,$44,$44,$50,$50,$50,$60,$60,$60,$6C,$6C,$6C,$74,$74,$74,$00
1252    
1253     SampleAddressTableLo
1254     .byt <Sample0
1255     .byt <Sample1
1256     .byt <Sample2
1257     .byt <Sample3
1258     .byt <Sample4
1259     .byt <Sample5
1260     SampleAddressTableHi
1261     .byt >Sample0
1262     .byt >Sample1
1263     .byt >Sample2
1264     .byt >Sample3
1265     .byt >Sample4
1266     .byt >Sample5
1267    
1268     SampleData
1269     Sample0
1270     .byt $1E,$0D,$00
1271     Sample1
1272     .byt $0B,$0C,$0B,$0A,$0A,$09,$09,$08,$08,$07,$07,$06,$06,$05,$05,$04 ;1
1273     .byt $04,$04,$00
1274     Sample2
1275     .byt $1F,$2E,$1E,$2D,$1D,$2C,$1C,$2B,$1B,$2A,$1A,$29,$19,$28,$18,$27 ;2
1276     .byt $17,$26,$16,$25,$15,$24,$14,$23,$13,$22,$12,$21,$11,$10,$00
1277     Sample3
1278     .byt $0F,$17,$14,$01,$10,$00
1279     Sample4
1280     .byt $0F,$0E,$0D,$0C,$0B,$09,$07,$05,$03,$01,$10,$00
1281     Sample5
1282     .byt $0F,$0F,$0E,$0E,$0D,$0D,$0C,$0C,$0B,$0B,$0A,$0A,$09,$09,$08,$08 ;5
1283     .byt $07,$07,$06,$06,$05,$05,$04,$04,$03,$03,$02,$02,$01,$01,$10,$00
1284    
1285     Table33A4 ;Pattern Address Table A Lo
1286     .byt <Pattern2DBD
1287     .byt <Pattern2D74
1288     .byt <Pattern2D2B
1289     .byt <Pattern2CAA
1290     .byt <Pattern2C2B
1291     .byt <Pattern2BFA
1292     .byt <Pattern2B97
1293     .byt <Pattern2B60
1294     Table33AC ;Pattern Address Table A Hi
1295     .byt >Pattern2DBD
1296     .byt >Pattern2D74
1297     .byt >Pattern2D2B
1298     .byt >Pattern2CAA
1299     .byt >Pattern2C2B
1300     .byt >Pattern2BFA
1301     .byt >Pattern2B97
1302     .byt >Pattern2B60
1303     Table33B4 ;Pattern Address Table B Lo
1304     .byt <Pattern3033
1305     .byt <Pattern3022
1306     .byt <Pattern2FC5
1307     .byt <Pattern2F46
1308     .byt <Pattern2ECB
1309     .byt <Pattern2E80
1310     .byt <Pattern2E55
1311     .byt <Pattern2DE2
1312     Table33BC ;Pattern Address Table B Hi
1313     .byt >Pattern3033
1314     .byt >Pattern3022
1315     .byt >Pattern2FC5
1316     .byt >Pattern2F46
1317     .byt >Pattern2ECB
1318     .byt >Pattern2E80
1319     .byt >Pattern2E55
1320     .byt >Pattern2DE2
1321     Table33C4 ;Pattern Address Table C Lo
1322     .byt <Pattern3217
1323     .byt <Pattern31FE
1324     .byt <Pattern31A1
1325     .byt <Pattern3188
1326     .byt <Pattern315F
1327     .byt <Pattern311A
1328     .byt <Pattern30BD
1329     .byt <Pattern3080
1330     Table33CC ;Pattern Address Table C Hi
1331     .byt >Pattern3217
1332     .byt >Pattern31FE
1333     .byt >Pattern31A1
1334     .byt >Pattern3188
1335     .byt >Pattern315F
1336     .byt >Pattern311A
1337     .byt >Pattern30BD
1338     .byt >Pattern3080
1339    
1340     RegisterBank
1341     AY_PitchLo
1342     .byt 0
1343     .byt 0
1344     .byt 0
1345     AY_PitchHi
1346     .byt 0
1347     .byt 0
1348     .byt 0
1349     AY_Noise
1350     .byt 0
1351     AY_Status
1352     .byt $78
1353     AY_Volume
1354     .byt 0
1355     .byt 0
1356     .byt 0
1357     AY_EGPeriodLo .byt 0
1358     AY_EGPeriodHi .byt 0
1359     AY_EGCycle .byt 0
1360     RegisterPointer
1361     .byt 0,3
1362     .byt 1,4
1363     .byt 2,5
1364     .byt 6
1365     .byt 7
1366     .byt 8,9,10
1367     .byt 11,12
1368     .byt 13
1369     ReferenceBank
1370     .byt 0,0,0,0,0,0
1371     .byt 0,0
1372     .byt 0,0,0
1373     .byt 0,0,0
1374    
1375     BasePitchLo ;Base Note Pitches Lo
1376     .byt $EE,$16,$4C
1377     .byt $8E,$D8,$2E
1378     .byt $8E,$F6,$66
1379     .byt $E0,$60,$E8
1380     BasePitchHi ;Base Note Pitches Hi
1381     .byt $0E,$0E,$0D
1382     .byt $0C,$0B,$0B
1383     .byt $0A,$09,$09
1384     .byt $08,$08,$07
1385     EventIndex .byt 0
1386     EndEvent .byt 0
1387     TrackLoop .byt 0
1388     MusicTempoReference .byt 0
1389     MusicStatus .byt 0
1390    
1391     SampleProperty
1392     .byt 128,128,128
1393     SampleIndex
1394     .byt 0,0,0
1395     OrnamentProperty
1396     .byt 128,128,128
1397     OrnamentIndex
1398     .byt 0,0,0
1399     RuntimePatternBaseLo
1400     .byt 0,0,0
1401     RuntimePatternBaseHi
1402     .byt 0,0,0
1403     RuntimePatternIndex
1404     .byt 0,0,0
1405     RuntimePatternNoteOffset
1406     .byt 0,0,0
1407     RuntimeNote
1408     .byt 0,0,0
1409     EndOfMusic
1410    
1411     ;************************ Effect Data starts here **********************
1412     #ifdef 0
1413    
1414     Channel_SFX_NoteHeaders
1415     .byt NoteG+12*7 ;A 00
1416     .byt NoteC+12*1 ; 01
1417     .byt NoteC+12*2 ; 02
1418     .byt NoteC+12*6 ; 03
1419     .byt NoteC+12*3 ; 04
1420     .byt NoteF+12*9 ; 05
1421     .byt NoteC+12*1 ; 06
1422     .byt NoteD+12*2 ; 07
1423     .byt NoteG+12*3 ; 08
1424    
1425     .byt NoteC+12*6 ;B 09
1426     .byt NoteF+12*6 ; 10
1427     .byt NoteC+12*3 ; 11
1428     .byt NoteC+12*4 ; 12
1429     .byt NoteC+12*4 ; 13
1430     .byt NoteF+12*7 ; 14
1431     .byt NoteG+12*3 ; 15
1432     .byt NoteG+12*7 ; 16
1433    
1434     .byt NoteC+12*5 ;C 17
1435     .byt NoteC+12*0 ; 18
1436     .byt NoteC+12*5 ; 19
1437     .byt NoteG+12*7 ; 20
1438     .byt NoteG+12*7 ; 21
1439     .byt NoteG+12*3 ; 22
1440    
1441     Channel_SFX_EffectAndEGHeaders
1442     .byt hEffectV ;A 00 Switch
1443     .byt hEffectU ; 01 Door Opening/Closing
1444     .byt hEffectT ; 02 Pick up
1445     .byt hEffectS ; 03 Drop
1446     .byt hEffectR ; 04 Step #1 (Keonig)
1447     .byt hEffectR ; 05 Step #2 (Carter)
1448     .byt hEffectH+EG20 ; 06 Lift Start
1449     .byt hEffectG+EG20 ; 07 Lift End
1450     .byt hEffectE+EG09 ; 08 Alarm #1 (Power Down)
1451    
1452     .byt hEffectQ ;B 09 Effect #1 (InfoPost)
1453     .byt hEffectP ; 10 New Msg through Commlink
1454     .byt hEffectO ; 11 Effect #2 (InfoPost)
1455     .byt hEffectN ; 12 Computer Room #1
1456     .byt hEffectM ; 13 Computer Room #2
1457     .byt hEffectP ; 14 Beep for Info Messages in Text Area
1458     .byt hEffectF ; 15 Robot Shuffle
1459     .byt hEffectD+EG20 ; 16 Alarm #2
1460    
1461     .byt hEffectL ;C 17 Dying
1462     .byt hEffectK+EG20 ; 18 Contact with Enemy #2
1463     .byt hEffectK+EG02 ; 19 Contact with Enemy #1(Primary)
1464     .byt hEffectJ ; 20 Alarm #3 (Life Support Circuit Open)
1465     .byt hEffectI ; 21 Alarm #3 End
1466    
1467     ;Nice effect of mixing Effect 0F on A whilst playing Track 02 on A
1468     ;Effects(19)
1469    
1470     EffectBaseAddressLo
1471     .byt <EffectD
1472     .byt <EffectE
1473     .byt <EffectF
1474     .byt <EffectG
1475     .byt <EffectH
1476     .byt <EffectI
1477     .byt <EffectJ
1478     .byt <EffectK
1479     .byt <EffectL
1480     .byt <EffectM
1481     .byt <EffectN
1482     .byt <EffectO
1483     .byt <EffectP
1484     .byt <EffectQ
1485     .byt <EffectR
1486     .byt <EffectS
1487     .byt <EffectT
1488     .byt <EffectU
1489     .byt <EffectV
1490     EffectBaseAddressHi
1491     .byt >EffectD
1492     .byt >EffectE
1493     .byt >EffectF
1494     .byt >EffectG
1495     .byt >EffectH
1496     .byt >EffectI
1497     .byt >EffectJ
1498     .byt >EffectK
1499     .byt >EffectL
1500     .byt >EffectM
1501     .byt >EffectN
1502     .byt >EffectO
1503     .byt >EffectP
1504     .byt >EffectQ
1505     .byt >EffectR
1506     .byt >EffectS
1507     .byt >EffectT
1508     .byt >EffectU
1509     .byt >EffectV
1510    
1511     EffectD ;16
1512     .byt efx_ToneOn
1513     .byt efx_NoiseOff
1514     .byt efx_EnvelopeOff
1515     .byt efx_Volume+6
1516     .byt efx_Pause+27
1517     .byt efx_EnvelopeOn
1518     .byt efx_Pause+18
1519     .byt efx_EnvelopeOff
1520     .byt efx_Pause+7
1521     .byt efx_EnvelopeOn
1522     .byt efx_Pause+9
1523     .byt efx_EnvelopeOff
1524     .byt efx_Pause+36
1525     .byt efx_EnvelopeOn
1526     .byt efx_Pause+18
1527     .byt efx_LoopRow+13 ;Row 2
1528     EffectE ;16
1529     .byt efx_ToneOn
1530     .byt efx_EnvelopeOn
1531     .byt efx_NoiseOff
1532     .byt efx_SetAbsoluteMode
1533     .byt efx_IncPitch+1
1534     .byt efx_Volume+0
1535     .byt efx_Pause+3
1536     .byt efx_DecPitch+2
1537     .byt efx_IncVolume
1538     .byt efx_SkipZeroVolume
1539     .byt efx_LoopRow+4 ;To row 6
1540     .byt efx_Volume+12
1541     .byt efx_Pause+9
1542     .byt efx_IncPitch+31
1543     .byt efx_Pause+18
1544     .byt efx_LoopRow+11 ;To row 4
1545     EffectF ;16
1546     .byt efx_ToneOff
1547     .byt efx_EnvelopeOff
1548     .byt efx_NoiseOn
1549     .byt efx_SetCounter+6
1550     .byt efx_Volume+0
1551     .byt efx_IncVolume
1552     .byt efx_Pause+1
1553     .byt efx_SkipZeroCount
1554     .byt efx_LoopRow+3
1555     .byt efx_DecVolume
1556     .byt efx_Pause+1
1557     .byt efx_SkipZeroVolume
1558     .byt efx_LoopRow+3
1559     .byt efx_End
1560     EffectG ;19
1561     .byt efx_ToneOn
1562     .byt efx_NoiseOff
1563     .byt efx_EnvelopeOn
1564     .byt efx_SetEnvTriangle
1565     .byt efx_SetAbsoluteMode
1566     .byt efx_SetCounter+8
1567     .byt efx_Pause+9
1568     .byt efx_DecNote+2
1569     .byt efx_SkipZeroCount
1570     .byt efx_LoopRow+3 ;6
1571     .byt efx_EnvelopeOff
1572     .byt efx_Pause+18
1573     .byt efx_Volume+13
1574     .byt efx_IncNote+31
1575     .byt efx_IncNote+24
1576     .byt efx_Pause+4
1577     .byt efx_DecVolume
1578     .byt efx_SkipZeroVolume
1579     .byt efx_LoopRow+3 ;?16
1580     .byt efx_End
1581     EffectH ;10
1582     .byt efx_ToneOn
1583     .byt efx_NoiseOff
1584     .byt efx_EnvelopeOn
1585     .byt efx_SetEnvTriangle
1586     .byt efx_SetAbsoluteMode
1587     .byt efx_SetCounter+8
1588     .byt efx_Pause+4
1589     .byt efx_IncNote+2
1590     .byt efx_SkipZeroCount
1591     .byt efx_LoopRow+3 ;6
1592     .byt efx_End
1593     EffectI ;11
1594     .byt efx_ToneOn
1595     .byt efx_NoiseOff
1596     .byt efx_EnvelopeOff
1597     .byt efx_Volume+15
1598     .byt efx_Pause+4
1599     .byt efx_Volume+0
1600     .byt efx_Pause+7
1601     .byt efx_Volume+9
1602     .byt efx_Pause+5
1603     .byt efx_Volume+0
1604     .byt efx_End
1605     EffectJ ;8
1606     .byt efx_ToneOn
1607     .byt efx_NoiseOff
1608     .byt efx_EnvelopeOff
1609     .byt efx_Volume+15
1610     .byt efx_Pause+4
1611     .byt efx_Volume+0
1612     .byt efx_Pause+7
1613     .byt efx_LoopRow+4 ;3
1614     EffectK ;19
1615     .byt efx_ToneOn
1616     .byt efx_NoiseOff
1617     .byt efx_EnvelopeOn
1618     .byt efx_SetAbsoluteMode
1619     .byt efx_SetCounter+8
1620     .byt efx_SetEnvTriangle
1621     .byt efx_IncNote+5
1622     .byt efx_Pause+1
1623     .byt efx_SetEnvSawtooth
1624     .byt efx_IncNote+9
1625     .byt efx_Pause+1
1626     .byt efx_SkipZeroCount
1627     .byt efx_LoopRow+7
1628     .byt efx_EnvelopeOff
1629     .byt efx_End
1630     EffectL ;16 Decreasing pitch and volume
1631     .byt efx_ToneOn
1632     .byt efx_NoiseOff
1633     .byt efx_EnvelopeOff
1634     .byt efx_Volume+15
1635     .byt efx_SetAbsoluteMode
1636     .byt efx_SetCounter+15
1637     .byt efx_Pause+2
1638     .byt efx_IncPitch+1
1639     .byt efx_SkipZeroCount
1640     .byt efx_LoopRow+3 ;6
1641     .byt efx_DecPitch+7
1642     .byt efx_DecVolume
1643     .byt efx_SkipZeroVolume
1644     .byt efx_LoopRow+8
1645     .byt efx_End
1646     EffectM ;9
1647     .byt efx_ToneOn
1648     .byt efx_NoiseOff
1649     .byt efx_EnvelopeOff
1650     .byt efx_Volume+7
1651     .byt efx_SetAbsoluteMode
1652     .byt efx_FilterFrequency+2
1653     .byt efx_Pause+3
1654     .byt efx_DecNote+26
1655     .byt efx_LoopRow+2 ;6
1656     EffectN ;9
1657     .byt efx_ToneOn
1658     .byt efx_NoiseOff
1659     .byt efx_EnvelopeOff
1660     .byt efx_Volume+7
1661     .byt efx_SetAbsoluteMode
1662     .byt efx_FilterFrequency+2
1663     .byt efx_Pause+1
1664     .byt efx_DecNote+27
1665     .byt efx_LoopRow+2 ;+6
1666     EffectO ;11
1667     .byt efx_ToneOn
1668     .byt efx_NoiseOn
1669     .byt efx_EnvelopeOff
1670     .byt efx_Volume+15
1671     .byt efx_Pause+1
1672     .byt efx_NoiseOff
1673     .byt efx_DecVolume
1674     .byt efx_Pause+3
1675     .byt efx_SkipZeroVolume
1676     .byt efx_LoopRow+3 ;6
1677     .byt efx_End
1678     EffectP ;11
1679     .byt efx_ToneOn
1680     .byt efx_NoiseOff
1681     .byt efx_EnvelopeOff
1682     .byt efx_SetCounter+3
1683     .byt efx_Volume+15
1684     .byt efx_Pause+9
1685     .byt efx_Volume+0
1686     .byt efx_Pause+9
1687     .byt efx_SkipZeroCount
1688     .byt efx_LoopRow+5 ;4
1689     .byt efx_End
1690     EffectQ ;9
1691     .byt efx_ToneOn
1692     .byt efx_NoiseOff
1693     .byt efx_EnvelopeOff
1694     .byt efx_Volume+15
1695     .byt efx_Pause+6
1696     .byt efx_DecNote+9
1697     .byt efx_Pause+9
1698     .byt efx_Volume+0
1699     .byt efx_End
1700     EffectR ;8
1701     .byt efx_NoiseOn
1702     .byt efx_ToneOn
1703     .byt efx_EnvelopeOff
1704     .byt efx_Volume+12
1705     .byt efx_SetNoiseRandom
1706     .byt efx_Pause+0
1707     .byt efx_Volume+0
1708     .byt efx_End
1709     EffectS ;13
1710     .byt efx_NoiseOff
1711     .byt efx_ToneOn
1712     .byt efx_EnvelopeOff
1713     .byt efx_Volume+10
1714     .byt efx_SetCounter+4
1715     .byt efx_SetAbsoluteMode
1716     .byt efx_DecNote+10
1717     .byt efx_Pause+3
1718     .byt efx_SkipZeroCount
1719     .byt efx_LoopRow+3 ;6
1720     .byt efx_Pause+1
1721     .byt efx_Volume+0
1722     .byt efx_End
1723     EffectT ;13
1724     .byt efx_NoiseOff
1725     .byt efx_ToneOn
1726     .byt efx_EnvelopeOff
1727     .byt efx_Volume+10
1728     .byt efx_SetCounter+4
1729     .byt efx_SetAbsoluteMode
1730     .byt efx_IncNote+10
1731     .byt efx_Pause+3
1732     .byt efx_SkipZeroCount
1733     .byt efx_LoopRow+3 ;6
1734     .byt efx_Pause+1
1735     .byt efx_Volume+0
1736     .byt efx_End
1737     EffectU ;14
1738     .byt efx_NoiseOn
1739     .byt efx_ToneOff
1740     .byt efx_EnvelopeOff
1741     .byt efx_Volume+0
1742     .byt efx_SetCounter+8
1743     .byt efx_Pause+2
1744     .byt efx_IncVolume
1745     .byt efx_SkipZeroCount
1746     .byt efx_LoopRow+3 ;5
1747     .byt efx_Volume+0
1748     .byt efx_End
1749     EffectV ;15
1750     .byt efx_NoiseOff
1751     .byt efx_EnvelopeOff
1752     .byt efx_ToneOn
1753     .byt efx_Volume+15
1754     .byt efx_Pause+1
1755     .byt efx_Volume+12
1756     .byt efx_Pause+1
1757     .byt efx_Volume+9
1758     .byt efx_Pause+1
1759     .byt efx_Volume+6
1760     .byt efx_Pause+1
1761     .byt efx_Volume+3
1762     .byt efx_Pause+1
1763     .byt efx_Volume+0
1764     .byt efx_End
1765     ;All Effects == 243 Bytes
1766    
1767     ToneMask
1768     .byt %11111110,%11111101,%11111011
1769     ToneBit
1770     .byt %00000001,%00000010,%00000100
1771     NoiseMask
1772     .byt %11110111,%11101111,%11011111
1773     NoiseBit
1774     .byt %00001000,%00010000,%00100000
1775     AbsoluteMode
1776     .byt 0,0,0
1777     EffectCounter
1778     .byt 0,0,0
1779     PauseDelay
1780     .byt 0,0,0
1781     EffectPitchLo
1782     .byt 0,0,0
1783     EffectPitchHi
1784     .byt 0,0,0
1785     EffectNote
1786     .byt 0,0,0
1787     EffectIndex
1788     .byt 0,0,0
1789     EffectNumber
1790     .byt 128,128,128
1791     SkipLoopFlag
1792     .byt 0,0,0
1793     PitchOffset
1794     NoteOffset .byt 0
1795     TempPitchLo .byt 0
1796     TempPitchHi .byt 0
1797     EGValue
1798     .byt 20,9,2
1799     EffectCodeThreshhold
1800     .byt 000 ;00
1801     .byt 001 ;01
1802     .byt 002 ;02
1803     .byt 003 ;03
1804     .byt 004 ;04
1805     .byt 005 ;05
1806     .byt 006 ;06
1807     .byt 007 ;07
1808     .byt 008 ;08
1809     .byt 040 ;09
1810     .byt 072 ;10
1811     .byt 104 ;11
1812     .byt 136 ;12
1813     .byt 137 ;13
1814     .byt 138 ;14
1815     .byt 139 ;15
1816     .byt 140 ;16
1817     .byt 141 ;17
1818     .byt 157 ;18
1819     .byt 158 ;19
1820     .byt 159 ;20
1821     .byt 163 ;21
1822     .byt 185 ;22
1823     .byt 205 ;23
1824     .byt 255 ;24
1825     EffectCodeVectorLo
1826     .byt <efxc_End
1827     .byt <efxc_ToneOn
1828     .byt <efxc_ToneOff
1829     .byt <efxc_NoiseOn
1830     .byt <efxc_NoiseOff
1831     .byt <efxc_EnvelopeOn
1832     .byt <efxc_EnvelopeOff
1833     .byt <efxc_SetAbsoluteMode
1834     .byt <efxc_IncPitch
1835     .byt <efxc_DecPitch
1836     .byt <efxc_IncNote
1837     .byt <efxc_DecNote
1838     .byt <efxc_SetNoiseRandom
1839     .byt <efxc_IncVolume
1840     .byt <efxc_DecVolume
1841     .byt <efxc_SkipZeroVolume
1842     .byt <efxc_SkipZeroCount
1843     .byt <efxc_Volume
1844     .byt <efxc_SetEnvTriangle
1845     .byt <efxc_SetEnvSawtooth
1846     .byt <efxc_FilterFrequency
1847     .byt <efxc_LoopRow
1848     .byt <efxc_SetCounter
1849     .byt <efxc_Pause
1850     .byt <efxc_SkipZeroPitch
1851     EffectCodeVectorHi
1852     .byt >efxc_End
1853     .byt >efxc_ToneOn
1854     .byt >efxc_ToneOff
1855     .byt >efxc_NoiseOn
1856     .byt >efxc_NoiseOff
1857     .byt >efxc_EnvelopeOn
1858     .byt >efxc_EnvelopeOff
1859     .byt >efxc_SetAbsoluteMode
1860     .byt >efxc_IncPitch
1861     .byt >efxc_DecPitch
1862     .byt >efxc_IncNote
1863     .byt >efxc_DecNote
1864     .byt >efxc_SetNoiseRandom
1865     .byt >efxc_IncVolume
1866     .byt >efxc_DecVolume
1867     .byt >efxc_SkipZeroVolume
1868     .byt >efxc_SkipZeroCount
1869     .byt >efxc_Volume
1870     .byt >efxc_SetEnvTriangle
1871     .byt >efxc_SetEnvSawtooth
1872     .byt >efxc_FilterFrequency
1873     .byt >efxc_LoopRow
1874     .byt >efxc_SetCounter
1875     .byt >efxc_Pause
1876     .byt >efxc_SkipZeroPitch
1877     FilterIndex
1878     .byt 0,0,0
1879     FilterMask
1880     .byt 7 ;1
1881     .byt 15 ;2
1882     .byt 31 ;3
1883     .byt 127 ;4
1884     EndOfAll
1885    
1886    
1887    
1888     #endif
1889    
1890    

  ViewVC Help
Powered by ViewVC 1.1.26