home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AMOS PD CD
/
amospdcd.iso
/
sourcecode
/
subroutines
/
sonix_player_source.amos
/
sonix_player_source.amosSourceCode
Wrap
AMOS Source Code
|
1993-07-31
|
3KB
|
115 lines
GO
Procedure GO
Screen Open 0,640,256,2,Hires
Palette 0,$FFF
Print "Please type in your full name ";
Pen 0
Input NAME$
Pen 1
NAME$=Upper$(NAME$)
CC=0
For FF=1 To Len(NAME$)
CC=CC+Asc(Mid$(NAME$,FF,1))
Next FF
If CC<>717 Then Print "Nice Try Hacker" : Wait 200 : Call 12345
GREETS
Reserve As Work 12,1024
A$="df1:instruments"
B$=Chr$(34)+Fsel$("*.smus","","Choose a Sonix File")+Chr$(34)
A$=A$+Chr$(255)
B$=B$+Chr$(254)
BSTART=Start(12)
BEND=BSTART+Length(12)
For F=1 To Len(A$)
Poke(BSTART-1)+F,Asc(Mid$(A$,F,1))
Next F
For F=1 To Len(B$)
Poke(BSTART-1)+F+Len(A$),Asc(Mid$(B$,F,1))
Next F
SONIX_PLAY
REPORT
End Proc
Procedure REPORT
Print "Running ";
Repeat
Wait 50
Print ".";
Until Exist("sys:errorfile")
Print
Open In 1,"sys:errorfile"
Do
Exit If Eof(1)
ERR$=ERR$+Input$(1,1)
Loop
Print ERR$
Print
Close 1
Open Out 1,"sys:errorfile"
Print #1,"No Errors reported"
Close 1
End Proc
Procedure SONIX_PLAY
Reserve As Work 11,10000
BSTART=Start(12)
BEND=BSTART+Length(12)
FIN=Hunt(BSTART To BEND,Chr$(0))
For F=BSTART To FIN
LOOK=Peek(F)
LOOK$=Chr$(LOOK)
If LOOK$=Chr$(255) Then Exit
INSDIR$=INSDIR$+LOOK$
Next F
For G=F+1 To FIN
LOOK=Peek(G)
LOOK$=Chr$(LOOK)
If LOOK$=Chr$(254) Then Exit
TUNE$=TUNE$+LOOK$
Next G
TUNE$=TUNE$-".smus"
SONIX[INSDIR$,TUNE$]
End Proc
Procedure SONIX[PATH_FOR_INSTRUMENTS$,PATH_TO_TUNE$]
COMMAND$="df0:c/run > nil: df0:c/play > errorfile i="+PATH_FOR_INSTRUMENTS$+" "+PATH_TO_TUNE$
EXECUTE[COMMAND$]
Led Off
End Proc
Procedure EXECUTE[COM$]
Rem *********************************************
Rem * DOS CALL PROCEDURE *
Rem * Written By D.Eckersley for TF Software *
Rem *********************************************
COM$=COM$+Chr$(0)
Dreg(1)=Varptr(COM$)
Dreg(2)=0
Dreg(3)=Start(11)
A=Doscall(-222)
End Proc
Procedure GREETS
Print "Access Granted ...."
Wait 50
Print "Hi there, you answered that last question correctly"
Print "Simple enough when you know your own name"
Print "For security, I have not printed your name om screen here as"
Print "that would mean that your name would be part of the ASCII of the program"
Print "Making it easy for Hackers to hack"
Print "What a ucrel tbsaard (anagram in case any kids are watching)"
Print "I can be to hackers eh ?"
Print "How about that for an idea for keeping out unauthourised people ?"
Print "To see what I mean, try giving another name instead !"
Print "This should give you an idea of what I am up to"
Print "Of course the version for release will have to have a decent front end"
Print "but this should give you some idea of what's possible"
Print
Print "Also I notice that it somtimes refuses to play certain scores, "
Print "The problem seems to be with the Play routine itself (Not my program!)"
Print "As it doesn't work when typed directly into CLI either"
Print "I will of course try to solve it for the proper release"
Print
Print "Hope you like what can be done so far"
Print "and thanks for the help and Ideas, and making me realize the potential "
Print "of this thing (the program I mean ,oo-er)"
Print
Print "Press RETURN"
Repeat
Until Inkey$=Chr$(13)
End Proc