home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fresh Fish 5
/
FreshFish_July-August1994.bin
/
bbs
/
mus
/
delitracker-2.01.lha
/
DeliTracker
/
Files
/
developer.lha
/
Developer
/
Examples
/
FC1.3.s
next >
Wrap
Text File
|
1994-04-15
|
21KB
|
922 lines
incdir "Includes:"
include "misc/DeliPlayer.i"
;
;
SECTION Player,Code
;
;
PLAYERHEADER PlayerTagArray
dc.b '$VER: Future Composer 1.0-1.3 player module V2.2 (15 Mar 94)',0
even
PlayerTagArray
dc.l DTP_RequestDTVersion,16
dc.l DTP_PlayerVersion,02<<16+20
dc.l DTP_PlayerName,PName
dc.l DTP_Creator,CName
dc.l DTP_Check2,Chk
dc.l DTP_CheckLen,ChkLen
dc.l DTP_Flags,PLYF_SONGEND
dc.l DTP_Interrupt,Int
dc.l DTP_InitPlayer,InitPlay
dc.l DTP_EndPlayer,EndPlay
dc.l DTP_InitSound,InitSnd
dc.l DTP_EndSound,RemSnd
dc.l DTP_Volume,SetVol
dc.l DTP_Balance,SetVol
dc.l TAG_DONE
*-----------------------------------------------------------------------*
;
; Player/Creatorname und lokale Daten
PName dc.b 'FutureComposer_1.3',0
CName dc.b 'SuperSero of the Superions,',10
dc.b 'adapted by Delirium',0
even
MODULE dc.l 0
fc_songend dc.l 0
fc_SndLVol dc.w 0
fc_SndRVol dc.w 0
*-----------------------------------------------------------------------*
;
;Interrupt für Replay
Int
movem.l d2-d7/a2-a6,-(sp)
jsr PLAY ; DudelDiDum
movem.l (sp)+,d2-d7/a2-a6
rts
*-----------------------------------------------------------------------*
;
; Testet auf Modul
Chk ; FC 1.3 ?
move.l dtg_ChkData(a5),a0
move.l (a0),d0
subi.l #"SMOD",d0
rts
ChkLen = *-Chk
*-----------------------------------------------------------------------*
;
; Init Player
InitPlay
moveq #0,d0
move.l dtg_GetListData(a5),a0 ; Function
jsr (a0)
move.l a0,MODULE
move.l dtg_SongEnd(a5),fc_songend ; store Songend FunctionPtr
move.l dtg_AudioAlloc(a5),a0 ; Function
jsr (a0) ; returncode is already set !
rts
*-----------------------------------------------------------------------*
;
; End Player
EndPlay
move.l dtg_AudioFree(a5),a0 ; Function
jsr (a0)
rts
*-----------------------------------------------------------------------*
;
; Init Sound
InitSnd
jsr INIT_MUSIC ; Init Sound
rts
*-----------------------------------------------------------------------*
;
; Remove Sound
RemSnd
jsr END_MUSIC ; End Sound
rts
*-----------------------------------------------------------------------*
;
; Copy Volume and Balance Data to internal buffer
SetVol
move.w dtg_SndLBal(a5),d0
mulu dtg_SndVol(a5),d0
lsr.w #6,d0
move.w d0,fc_SndLVol ; Left Volume
move.w dtg_SndRBal(a5),d0
mulu dtg_SndVol(a5),d0
lsr.w #6,d0
move.w d0,fc_SndRVol ; Right Volume
rts
*-----------------------------------------------------------------------*
;
; FUTURE COMPOSER-Replay 1.0-1.3
;
;
SECTION Replay,Code_C
;
;
***************************************************************
** Amiga FUTURE COMPOSER V1.0 / 1.2 / 1.3 Replay routine **
***************************************************************
END_MUSIC:
clr.w onoff
clr.l $dff0a6
clr.l $dff0b6
clr.l $dff0c6
clr.l $dff0d6
move.w #$000f,$dff096
; bclr #1,$bfe001
rts
INIT_MUSIC:
move.w #1,onoff
; bset #1,$bfe001
move.l MODULE,a0
lea 100(a0),a1
move.l a1,SEQpoint
move.l a0,a1
add.l 8(a0),a1
move.l a1,PATpoint
move.l a0,a1
add.l 16(a0),a1
move.l a1,FRQpoint
move.l a0,a1
add.l 24(a0),a1
move.l a1,VOLpoint
move.l 4(a0),d0
divu #13,d0
lea 40(a0),a1
lea SOUNDINFO+4(pc),a2
moveq #10-1,d1
initloop:
move.w (a1)+,(a2)+
move.l (a1)+,(a2)+
addq.w #4,a2
dbf d1,initloop
moveq #0,d2
move.l a0,d1
add.l 32(a0),d1
sub.l #WAVEFORMS,d1
lea SOUNDINFO(pc),a0
move.l d1,(a0)+
moveq #9-1,d3
initloop1:
move.w (a0),d2
add.l d2,d1
add.l d2,d1
addq.w #6,a0
move.l d1,(a0)+
dbf d3,initloop1
move.l SEQpoint(pc),a0
moveq #0,d2
move.b 12(a0),d2 ;Get replay speed
bne.s speedok
move.b #3,d2 ;Set default speed
speedok:
move.w d2,respcnt ;Init repspeed counter
move.w d2,repspd
INIT2:
clr.w audtemp
clr.w spdtemp
move.w #$000f,$dff096 ;Disable audio DMA
move.w #$0780,$dff09a ;Disable audio IRQ
moveq #0,d7
mulu #13,d0
moveq #4-1,d6 ;Number of soundchannels-1
lea V1data(pc),a0 ;Point to 1st voice data area
lea SILENT(pc),a1
lea o4a0c8(pc),a2
initloop2:
move.l a1,10(a0)
move.l a1,18(a0)
clr.l 14(a0)
clr.b 45(a0)
clr.b 47(a0)
clr.w 8(a0)
clr.l 48(a0)
move.b #$01,23(a0)
move.b #$01,24(a0)
clr.b 25(a0)
clr.l 26(a0)
clr.w 30(a0)
moveq #$00,d3
move.w (a2)+,d1
move.w (a2)+,d3
divu #$0003,d3
move.b d3,32(a0)
mulu #$0003,d3
andi.l #$00ff,d3
andi.l #$00ff,d1
addi.l #$dff0a0,d1
move.l d1,a6
move.l #$0000,(a6)
move.w #$0100,4(a6)
move.w #$0000,6(a6)
move.w #$0000,8(a6)
move.l d1,60(a0)
clr.w 64(a0)
move.l SEQpoint(pc),(a0)
move.l SEQpoint(pc),52(a0)
add.l d0,52(a0)
add.l d3,52(a0)
add.l d7,(a0)
add.l d3,(a0)
move.w #$000d,6(a0)
move.l (a0),a3
move.b (a3),d1
andi.l #$00ff,d1
lsl.w #6,d1
move.l PATpoint(pc),a4
adda.w d1,a4
move.l a4,34(a0)
clr.l 38(a0)
move.b #$01,33(a0)
move.b #$02,42(a0)
move.b 1(a3),44(a0)
move.b 2(a3),22(a0)
clr.b 43(a0)
clr.b 45(a0)
clr.w 56(a0)
adda.w #$004a,a0 ;Point to next voice's data area
dbf d6,initloop2
rts
PLAY:
lea pervol(pc),a6
tst.w onoff
bne.s music_on
rts
music_on:
subq.w #1,respcnt ;Decrease replayspeed counter
bne.s nonewnote
move.w repspd(pc),respcnt ;Restore replayspeed counter
lea V1data(pc),a0 ;Point to voice1 data area
bsr new_note
lea V2data(pc),a0 ;Point to voice2 data area
bsr new_note
lea V3data(pc),a0 ;Point to voice3 data area
bsr new_note
lea V4data(pc),a0 ;Point to voice4 data area
bsr new_note
nonewnote:
clr.w audtemp
lea V1data(pc),a0
bsr effects
move.w d0,(a6)+
move.w d1,(a6)+
lea V2data(pc),a0
bsr effects
move.w d0,(a6)+
move.w d1,(a6)+
lea V3data(pc),a0
bsr effects
move.w d0,(a6)+
move.w d1,(a6)+
lea V4data(pc),a0
bsr effects
move.w d0,(a6)+
move.w d1,(a6)+
lea pervol(pc),a6
move.w audtemp(pc),d0
ori.w #$8000,d0 ;Set/clr bit = 1
move.w d0,-(a7)
moveq #0,d1
move.l start1(pc),d2 ;Get samplepointers
move.w offset1(pc),d1 ;Get offset
add.l d1,d2 ;Add offset
move.l start2(pc),d3
move.w offset2(pc),d1
add.l d1,d3
move.l start3(pc),d4
move.w offset3(pc),d1
add.l d1,d4
move.l start4(pc),d5
move.w offset4(pc),d1
add.l d1,d5
move.w ssize1(pc),d0 ;Get sound lengths
move.w ssize2(pc),d1
move.w ssize3(pc),d6
move.w ssize4(pc),d7
move.w (a7)+,$dff096 ;Enable audio DMA
chan1:
lea V1data(pc),a0
tst.w 72(a0)
beq.s chan2
subq.w #1,72(a0)
cmpi.w #1,72(a0)
bne.s chan2
clr.w 72(a0)
move.l d2,$dff0a0 ;Set soundstart
move.w d0,$dff0a4 ;Set soundlength
chan2:
lea V2data(pc),a0
tst.w 72(a0)
beq.s chan3
subq.w #1,72(a0)
cmpi.w #1,72(a0)
bne.s chan3
clr.w 72(a0)
move.l d3,$dff0b0
move.w d1,$dff0b4
chan3:
lea V3data(pc),a0
tst.w 72(a0)
beq.s chan4
subq.w #1,72(a0)
cmpi.w #1,72(a0)
bne.s chan4
clr.w 72(a0)
move.l d4,$dff0c0
move.w d6,$dff0c4
chan4:
lea V4data(pc),a0
tst.w 72(a0)
beq.s setpervol
subq.w #1,72(a0)
cmpi.w #1,72(a0)
bne.s setpervol
clr.w 72(a0)
move.l d5,$dff0d0
move.w d7,$dff0d4
setpervol:
lea $dff0a6,a5
move.w (a6)+,(a5) ;Set period
move.w (a6)+,d0 ; added
mulu fc_SndLVol,d0 ; by
lsr.w #6,d0 ; Delirium
move.w d0,2(a5) ;Set volume
move.w (a6)+,16(a5) ;Set period
move.w (a6)+,d0 ; added
mulu fc_SndRVol,d0 ; by
lsr.w #6,d0 ; Delirium
move.w d0,18(a5) ;Set volume
move.w (a6)+,32(a5) ;Set period
move.w (a6)+,d0 ; added
mulu fc_SndRVol,d0 ; by
lsr.w #6,d0 ; Delirium
move.w d0,34(a5) ;Set volume
move.w (a6)+,48(a5) ;Set period
move.w (a6)+,d0 ; added
mulu fc_SndLVol,d0 ; by
lsr.w #6,d0 ; Delirium
move.w d0,50(a5) ;Set volume
rts
new_note:
moveq #0,d5
move.l 34(a0),a1
adda.w 40(a0),a1
cmp.w #64,40(a0)
bne samepat
move.l (a0),a2
adda.w 6(a0),a2 ;Point to next sequence row
cmpa.l 52(a0),a2 ;Is it the end?
bne.s notend
move.l fc_songend,a2
jsr (a2) ; signal songend to DeliTracker
move.w d5,6(a0) ;yes!
move.l (a0),a2 ;Point to first sequence
notend:
moveq #1,d1
addq.b #1,spdtemp
cmpi.b #5,spdtemp
bne.s nonewspd
move.b d1,spdtemp
move.b 12(a2),d1 ;Get new replay speed
beq.s nonewspd
move.w d1,respcnt ;store in counter
move.w d1,repspd
nonewspd:
move.b (a2),d1 ;Pattern to play
move.b 1(a2),44(a0) ;Transpose value
move.b 2(a2),22(a0) ;Soundtranspose value
move.w d5,40(a0)
lsl.w #6,d1
add.l PATpoint(pc),d1 ;Get pattern pointer
move.