home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
17 Bit Software 4: Phase Four
/
17Bit_Phase_Four.iso
/
files
/
2986.dms
/
2986.adf
/
Effects
/
Delay.s
< prev
next >
Wrap
Text File
|
1993-12-04
|
4KB
|
181 lines
;
; TREG II Effect Structure
;
HEADER: dc.b 'TREG' ; Header
dc.l 24975,2 ; TREG 2
SLIDE1: dc.b 'SLDR'
dc.l VALS1-NAME1 ; Sliders Name Length
NAME1: dc.b 'Left Offset',0 ; Sliders Name
even
VALS1: dc.l 0 ; Data Register
dc.l 0 ; Min Value
dc.l 29000 ; Max Value
dc.l 0 ; Set Value
SLIDE2:
dc.l VALS2-NAME2 ; Sliders Name Length
NAME2: dc.b 'Right Offset',0 ; Sliders Name
even
VALS2: dc.l 1 ; Data Register
dc.l 0 ; Min Value
dc.l 29000 ; Max Value
dc.l 1000 ; Set Value
SLIDE3:
dc.l VALS3-NAME3 ; Sliders Name Length
NAME3: dc.b 'Left Volume',0 ; Sliders Name
even
VALS3: dc.l 2 ; Data Register
dc.l 0 ; Min Value
dc.l 64 ; Max Value
dc.l 64 ; Set Value
SLIDE4:
dc.l VALS4-NAME4 ; Sliders Name Length
NAME4: dc.b 'Right Volume',0 ; Sliders Name
even
VALS4: dc.l 3 ; Data Register
dc.l 0 ; Min Value
dc.l 64 ; Max Value
dc.l 64 ; Set Value
CODE:
dc.l LEFT-START ; Left Offset From Start
dc.l RIGHT-START ; Right Offset From Start
dc.l -1 ; Stereo Offset From Start
even
START: ; Marks Code Start
LEFT: ; Left Channel Code
MOVE.B #0,$BFE301
MOVE.B #3,$BFE201
MOVE.B #6,$BFD200
MOVE.B #2,$BFD000
BRA.S Delay
RIGHT: ; Right Channel Code
MOVE.B #0,$BFE301
MOVE.B #3,$BFE201
MOVE.B #6,$BFD200
MOVE.B #4,$BFD000
Delay:
Move.w #$4000,$dff09a
Move.w #%0111111111111111,$dff096
Movem.l D0-D7/A0-A6,-(sp)
Sub.l #30000,D0
Sub.l #30000,D1
Neg.l D0
Neg.l D1
Move.l D0,D4
Move.l D0,D7
Move.l D1,D5
Move.l D1,D6
Move.l D2,D0
Move.l D3,D1
Move.l D3,D2
Move.l D0,D3
Move.w D0,$dff0a8
Move.w D1,$dff0b8
Move.w D2,$dff0c8
Move.w D3,$dff0d8
Lea Storeage(pc),A6
Move.l A6,D0
Lea StoreEnd(pc),A6
Move.l A6,D1
Bsr REFClear
Move.w #$20,$dff0a6
Move.w #$20,$dff0b6
Move.w #$20,$dff0c6
Move.w #$20,$dff0d6
Move.w #$1,$dff0a4
Move.w #$1,$dff0b4
Move.w #$1,$dff0c4
Move.w #$1,$dff0d4
Move.l D0,A5
Move.l D1,A6
Move.l A5,A0
Move.l A5,A1
Move.l A5,A2
Move.l A5,A3
Move.l A5,A4
Add.l D4,A0
Add.l D5,A1
Add.l D6,A2
Add.l D7,A3
REFReverbLoop:
Move.b $bfe101,D0
Add.b #$80,D0
Move.b D0,(A4)+
Cmp.l A6,A0
Blt.s REFOk1
Move.l A5,A0
REFOk1:
Cmp.l A6,A1
Blt.s REFOk2
Move.l A5,A1
REFOk2:
Cmp.l A6,A2
Blt.s REFOk3
Move.l A5,A2
REFOk3:
Cmp.l A6,A3
Blt.s REFOk4
Move.l A5,A3
REFOk4:
Cmp.l A6,A4
Blt.s REFOk5
Move.l A5,A4
REFOk5:
Move.w #$780,$dff09c
Move.b (A0)+,$dff0aa
Move.b (A1)+,$dff0ba
Move.b (A2)+,$dff0ca
Move.b (A3)+,$dff0da
REFUnFinished:
Btst #$1,$dff01e
Beq REFUnFinished
Btst #$6,$bfe001
Beq.s REFQuit
Bra REFReverbLoop
REFQuit:
Movem.l (sp)+,D0-D7/A0-A6
Move.w #%1000001111110000,$dff096
Move.w #$c000,$dff09a
Rts
REFClear:
Move.l D0,A0
Move.l D1,A1
REFCLoop:
Move.b #0,(A0)+
Cmp.l A0,A1
Bhi REFCLoop
Rts
Clear: Dc.l 0,0,0
Storeage: Dcb.b 30000
StoreEnd: dc.b 0,0
END ; Program END
NOTES
-----
If (0) Is Placed As The Offset Then TREG Will Disable The
Button To Select That Piece Of Code.
E.g - If You Place (0) In STEREO Then TREG Will
Disable The "S" Button On The Main Screen.
If (-1) Is Placed As The Data Register Then That Slider
Will Be Disabled.
The Code MUST Be (PC) Relative As Hunks Will Be Removed!
The Code MUST Handle All Its Own Memory!
The Code MUST Store ALL Registers On The Stack And Return Them!
The Code MUST Handle Its Own Errors And Return A Code In D0
Error Codes (D0)
----- ----- ----
0 - Everything Worked Fine! (NO ERROR)
1 - Out Of Free Memory!
2 - Settings Error!
3 - Stack Error!
4 - Unknown Error!