home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
401-425
/
apd410
/
modplayerv1.2.amos.pp
/
modplayerv1.2.amos
/
modplayerv1.2.amosSourceCode
< prev
next >
Wrap
AMOS Source Code
|
1994-01-01
|
8KB
|
370 lines
'
'Soundtracker module player v1.2
'Relase version 1.1
'Read rems for more info!
'
'Needs AMOS v1.34 or higher to run!!!!!!!!
'
' STORM 1992
'
A#=0.0
Screen Open 0,640,256,8,Hires
Curs Off : Pen 2 : Paper 0 :
Colour 17,$FFF : Colour 18,$1AA
Cls 0
'
Break Off
Amos Lock
'
Dim DLIST$(25),NPT(128),CMP$(25),VUM(5)
Global DLIST$(),NPT(),DF$,JEN,DAW,TAW,CMP$(),VUM()
Shared JEN,DAW,TAW,DF$
'
'Best to reserve memory if you have a lot to spare!
'Can work without crashes on compiled version!
'
'Reserve As Work 5,180000
'
Flash 1,"(011,4)(022,4)(044,4)(066,4)(088,4)(0aa,4)(0cc,4)(0ee,4)(0cc,4)(0aa,4)(088,4)(066,4)(044,4)(022,4)"
Pen 1
Centre "SOUNDTRACKER MUSIC PLAYER V1.2 BY EJBER OZKAN @1992" : Print
Pen 2
Set Rainbow 1,0,280,"","",""
Rainbow 1,0,0,280
For C=0 To 279
Rain(1,C)=0
Next C
Rain(1,12)=$A0A
Rain(1,180)=$A0A
View
Change Mouse 4
Limit Mouse
Do
LIST
CHOOSE
JEN=0 : DAW=0 : TAW=0 : JAY=0
For I=0 To 25 : DLIST$(I)="" : Next I
Screen 0
Cls 0 : Home
Pen 1
Centre "SOUNDTRACKER MUSIC PLAYER V1.2 BY EJBER OZKAN @1992" : Print
Pen 2
Loop
'
Procedure LIST
'
'get directory list
'
Flash 3,"(000,4)"
SCUM:
On Error Goto PISS
Pen 2
Print "Select a path (i.e DF1: or DF0: or DF1:MODULES/ ect.)"
Pen 1
Input "PATHNAME:";DF$
If DF$="" Then Goto SCUM
If DF$="QUIT" Then Print : Print "BYE BYE!!" : Wait 90 : End
If DF$="quit" Then Print : Print "BYE BYE!!" : Wait 90 : End
If Exist(DF$)=False Then Goto SCUM
'
'search for mod files only (change to suite!)
'
Pen 2
Print "Searching for all 'mod.' files!"
S$=Dir First$(DF$+"mod.*")
If Left$(S$,4)=" mod" Then SNAKE=1
If Left$(S$,4)=" MOD" Then SNAKE=1
If SNAKE=1 Then JEN=1 : DLIST$(JEN)=S$ : Add JEN,1
'
'Build directory of files in ram .leave out sub dirs
'
While S$<>""
S$=Dir Next$
If Left$(S$,1)="*" Then Goto SUM2 Else Add JEN,1 : DLIST$(JEN)=S$
DLIST$(JEN)=S$
SUM2:
Wend
'
'Check to see if there are any mod files!
'
For U=0 To JEN-1
If Left$(DLIST$(U),4)=" mod" Then NHS=1
If Left$(DLIST$(U),4)=" MOD" Then NHS=1
Next U
If NHS=>1 Then Pop Proc Else Goto RIP
'
'Error file not found!
'
PISS:
If Errn=81 Then Print "Nope could not find path!" : Resume SCUM
'
'No mod files found!
'
RIP:
Print "Oh no !I couldnt find any files with 'mod.' in it!"
Goto SCUM
End Proc
Procedure CHOOSE
'
'Reserve zones for mods!
'
Reserve Zone JEN
Cls 0 : Home : JAY=0 : Curs Off
Print "click on the modulename of the song you wish to here"
'
'Construct on screen zones!
'
For I=1 To JEN-1 :
Add JAY,1
Locate 1,JAY : Print Zone$(DLIST$(I),I)
Next I
Locate 1,JAY+1 : Inverse On : Print Zone$(" select another path",JEN) : Inverse Off
'
'Wait for user input!
'
Do
If Key State(80)=True Then Gosub PROGM
DAW=Mouse Zone
For TAW=1 To JEN-1
If DAW=TAW and Mouse Key=1 Then Locate 1,TAW : Pen 1 : Print DLIST$(TAW) : JINGLE : Pen 2 : Locate 1,TAW : Print DLIST$(TAW)
Next TAW
If DAW=JEN and Mouse Key=1 Then Pop Proc
Loop
'
'program mode on!
'
PROGM:
Clear Key : JAKE=0
Locate 1,JEN+1
Print "Programming mode ON (Press F2 once completed choices)"
Do
PAW=Mouse Zone
For EAW=1 To JEN-1
If PAW=EAW and Mouse Key=1 Then Gosub KLL
FARM:
Next EAW
If Key State(81)=True and JAKE=>1 Then Gosub PLG : Gosub CLEAN : Return
Loop
'
KLL:
If CMP$(JAKE)=DLIST$(EAW) Then Return
Locate 1,EAW
Pen 1
CMP$(JAKE)=DLIST$(EAW)
Print CMP$(JAKE);" Play No:";JAKE
Add JAKE,1
Wait 20
Return
'
' play tunes in selected order!
'
PLG:
CV=0 : CLIS=0
Repeat
Screen Open 1,640,100,4,Hires
Screen Display 1,140,200,640,100
Palette $0,$111,$444,$888,$333
Curs Off : Pen 3 : Cls 0 : Paper 0 : CLI=0
Flash 3,"(110,4)(220,4)(440,4)(660,4)(880,4)(aa0,4)(cc0,4)(ee0,4)(cc0,4)(aa0,4)(880,4)(660,4)(440,4)(220,4)"
Rain(1,180)=$A0A
TEMP1$=CMP$(CV)
TEMP2$=Mid$(TEMP1$,2,30)
F=Instr(TEMP2$," ")
TEMP3$=Mid$(TEMP2$,1,F-1)
TEMP4$=DF$+TEMP3$
Centre "Now playing file:"+TEMP4$
Track Load TEMP4$,5
Track Play 5,0
Track Loop Of
Repeat
Wait 40
If Key State(69)=True Then Gosub PRICE
If Key State(89)=True Then Screen Close 1 : Track Stop : Return
For TCC=0 To 3
VUM(TCC)=Vumeter(TCC)
Next TCC
Wait 40
If Key State(69)=True Then Gosub PRICE
If Key State(89)=True Then Screen Close 1 : Track Stop : Return
If VUM(0)=<0 and VUM(1)=<0 and VUM(2)=<0 and VUM(3)=<0 Then CMPA=1
Until CMPA=1
Add CV,1 : CMPA=0
Screen Close 1
Until CMP$(CV)=""
Return
'
PRICE:
If CLIS=0 Then CLIS=1 : Amos To Back : Return
If CLIS=1 Then CLIS=0 : Amos To Front : Return
Return
'
'clean up mess again!
'
CLEAN:
Screen 0 : Cls 0 : Home : JAY=0 : Curs Off : Pen 2
Print "click on the modulename of the song you wish to here"
For I=1 To JEN-1 :
Add JAY,1
Locate 1,JAY : Print DLIST$(I)
Next I
Locate 1,JAY+1 : Inverse On : Print " select another path" : Inverse Off
For I=0 To 25
CMP$(I)=""
Next I
Return
End Proc
Procedure JINGLE
'
'Play jingle
'
On Error Goto FISH
Screen Open 1,640,100,4,Hires
Screen Display 1,140,200,640,100
Palette $0,$111,$444,$888,$333
Curs Off : Pen 3 : Cls 0 : Paper 0 : CLI=0
Flash 3,"(110,4)(220,4)(440,4)(660,4)(880,4)(aa0,4)(cc0,4)(ee0,4)(cc0,4)(aa0,4)(880,4)(660,4)(440,4)(220,4)"
Rain(1,180)=$A0A
'
'Construct REAL filename from original in memory
'
TEMP1$=DLIST$(TAW)
TEMP2$=Mid$(TEMP1$,2,30)
F=Instr(TEMP2$," ")
TEMP3$=Mid$(TEMP2$,1,F-1)
TEMP4$=DF$+TEMP3$
'
'load and play!
'
Centre "Now playing file:"+TEMP4$
Track Load TEMP4$,5
Track Play 5,0
Track Loop On
'
'Show scanlines and wait fro possible mouse or F1 key!
'
Repeat
VURAIN
If Key State(89)=True Then TRACKER_DETAIL
VURAIN
If Key State(69)=True Then Gosub PRIMEA
VURAIN
VURAIN
VURAIN
If Key State(89)=True Then TRACKER_DETAIL
VURAIN
If Key State(69)=True Then Gosub PRIMEA
VURAIN
VURAIN
VURAIN
Until Mouse Key=1
Track Stop
Erase 5
JIF:
Screen Close 1
Screen 0
CLEAN
Pop Proc
FISH:
If Errn=94 Then Print : Print "Sorry couldnt load file!" : Wait 65 : Resume JIF
If Errn=24 Then Print : Print "Not enough memory sorry!" : Wait 65 : Resume JIF
PRIMEA:
If CLI=0 Then Amos To Back : CLI=1 : Return
If CLI=1 Then CLI=0 : Amos To Front : Return
Return
End Proc
Procedure VURAIN
'
'Straight forward VU show!
'A bit slow though!
'
'V1=Vumeter(1) : V0=Vumeter(0) : V2=Vumeter(2) : V3=Vumeter(3)
If Vumeter(0)>=1 Then Rain(1,200)=$48 : Rain(1,201)=$48 : Else Rain(1,200)=$3 : Rain(1,201)=$2 : View
If Vumeter(1)>=1 Then Rain(1,210)=$48 : Rain(1,211)=$48 : Else Rain(1,210)=$3 : Rain(1,211)=$2 : View
If Vumeter(2)>=1 Then Rain(1,220)=$48 : Rain(1,221)=$48 : Else Rain(1,220)=$3 : Rain(1,221)=$2 : View
If Vumeter(3)>=1 Then Rain(1,230)=$48 : Rain(1,231)=$48 : Else Rain(1,230)=$3 : Rain(1,231)=$2 : View
End Proc
Procedure CLEAN
For I=180 To 240 : Rain(1,I)=$0 : Next I
View
End Proc
Procedure P0INTER
'
'a nice pointer grabber!
'
Screen Open 0,640,256,4,Hires
Cls 0 : Flash Off
Ink 2
Draw 1,1 To 16,1
Draw 16,1 To 10,4
Draw 10,4 To 16,10
Draw 16,10 To 10,10
Draw 10,10 To 6,6
Draw 6,6 To 1,7
Draw 1,7 To 1,1
Ink 1
Paint 2,2
Get Bob 0,1,1,1 To 16,11
Change Mouse 4
End
End Proc
Procedure TRACKER_DETAIL
On Error Goto NOPE
Screen Open 2,640,286,4,Hires
Screen Display 2,140,40,640,256
Pen 2 : Paper 0 : Curs Off : Flash Off
Cls 0 : NO=0
Paper 0 : Pen 2
CLEAN
ST=Start(5)
'702
Print
Print "Songname :";
For I=0 To 19
AW=Peek(ST+I)
If AW=0 Then Print "."; : Else Print Chr$(AW);
Next I
Print
For I=20 To 440 Step 30
Add NO,1
Locate 0, : Print "instrNo";Hex$(NO);" :";
For U=0 To 21
AW=Peek(ST+I+U)
If AW=0 Then Print "."; : Else Print Chr$(AW);
Next U
Print
Next I
Home : Print
For I=470 To 940 Step 30
Add NO,1
Locate 35, : Print "instrNo";Hex$(NO);" :";
For U=0 To 21
AW=Peek(ST+I+U)
Locate 50+U,
If AW=0 Then Print "."; : Else Print Chr$(AW);
Next U
Print
Next I
STL=Peek(ST+950) : Print
Print "Position length : ";Hex$(STL)
For T=0 To STL
PT=Peek(ST+952+T)
NPT(T)=PT
Next T
Sort NPT(0)
BIGPT=NPT(128)
Print "Amount of Patterns :";Hex$(BIGPT)
Print "Press mouse button to continue - STORM 1992 -"
Repeat
Until Mouse Key=1
Screen Close 2
Screen 0
For T=0 To 128 : NPT(T)=0 : Next T
Rain(1,180)=$A0A
View
Pop Proc
NOPE:
If Errn=24 Then Screen 1 : Print "Not enough memory!"
Resume GOAT
'
GOAT:
End Proc