;*********************************************************************** ;*********** *********** ;*********** *********** ;*********** Amiga DSP Replay *********** ;*********** DSP Amiga Replay *********** ;*********** with P56 Loader *********** ;*********** *********** ;*********** *********** ;*********** By Simplet / FATAL DESIGN *********** ;*********** *********** ;*********************************************************************** ; The circular sample buffer must begin to an address multiple ; of the the first power of 2 greater than its size ; If you want an 50Hz VBL/Timer as maximum frequency, ; The size must be greater than : ; 2*984 for 49.1Khz, 2*656 for 32.8KHz, 2*492 for 24.5KHz, etc... PBC equ $ffe0 ; Port B Control Register PCC equ $ffe1 ; Port C Control register HCR equ $ffe8 ; Host Control Register HSR equ $ffe9 ; Host Status Register HRX equ $ffeb ; Host Receive Register HTX equ $ffeb ; Host Transmit Register CRA equ $ffec ; SSI Control Register A CRB equ $ffed ; SSI Control Register B SSISR equ $ffee ; SSI Status Register TX equ $ffef ; SSI Serial Transmit data/shift register BCR equ $fffe ; Port A Bus Control Register IPR equ $ffff ; Interrupt Priority Register ; Host Control Register Bit Flags HCIE equ 2 ; Host Command Interrupt Enable ; Host Status Register Bit Flags HRDF equ 0 ; Host Receive Data Full HTDE equ 1 ; Host Transmit Data Empty org p:$0 jmp >Start org p:$10 jsr >Spl_Out org p:$12 jsr >Spl_Out org p:$24 jmp >P56_Loader org p:$26 jsr >SoundTrack_Rout org p:$28 jsr >Clear_Sample_Buffer ; Interrupt Routine that plays the sound with the SSI org p:$40 Spl_Out jset #<2,X:<2048,x0 ; Warning Modulo ! add x0,a Length_Ok move a,X:(r0)+ ; Sample Length Get_MVolL jclr #2,a addr a,b #>1,a ; 2*b = Nb Voies + 4 voies FX andi #<$fe,ccr ; Cancel Carry Bit Rep #<24 div y0,a ; a0 = 1 / Nb Voices move a0,X:(r0) ; Clears the sample-buffer before mixing clr a X:Calc_Adr,r6 move X:Length,x0 Do x0,Clear_Sample move a,L:(r6)+ Clear_Sample ; Mix All Voices move #Voices_Frac,r1 Do b,Mix_All_Voices_Loop jsr 2,y0 move X:2,x0 move X:$ff0000,x1 move #>$000080,y0 move #>$008000,y1 move #>1,a addr a,b Do b,Receive_X_Loop_8 Receive_X_Sample_8 jclr #$ff0000,x1 move #>$000080,y0 move #>$008000,y1 move #>1,a addr a,b Do b,Receive_Y_Loop_8 Receive_Y_Sample_8 jclr #