home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
No Fragments Archive 10: Diskmags
/
nf_archive_10.iso
/
MAGS
/
STFORMAT
/
STF34A.MSA
/
INTRO
/
INTRODE6.LST
< prev
next >
Wrap
File List
|
1989-04-06
|
21KB
|
652 lines
' ** Program intro_designer ** Design section of introduction sequences
' ** WRITTEN BY ANTHONY DANIELS IN DECEMBER 1991 FOR ST FORMAT. ADDRESS :- 83 RIVERVIEW, MELTON, WOODBRIDGE, SUFFOLK, IP12 IQU.
On Break Gosub Quit_com
On Error Gosub Error_message
@Initialise
@Main_program
'
Procedure Quit_com
Message$="Are you sure you want to QUIT without saving ?"
@Yes_no(Message$)
If Yes!=-1
Setcolor 0,4,4,4
Setcolor 15,0
Edit !(end) this should be changed to system or quit before compiling
Endif
Return
' -----------------------------------------------------------------------------
Procedure Initialise
Setcolor 15,4,4,4 !sets text color (ie. color 1)
Setcolor 0,0,1,1 !sets background color
Setcolor 1,1792 !sets highlighted text color (ie. color 2)
Dim Com(220) !commands
Dim Screen_no%(220) !number values (eg. no. of screen to load/show, pause length etc.).
Dim Screen_title$(220) !name ofpicture files on disk
No_screens%=Fre(O)/35066 !checks computers memory and calculates no. of screens which may be held in memory
Print No_screens%
Com_selected=1 !command number currently being edited
Com_pos=10 !ie. showing commands 1 to 20. (eg. when com_pos=40 commands 31 to 50 are shown).
Com_line=1 !no. of lines down screen to com_selected
'
' const ie the following values are constant and do not change
V=-2 ! adjustment to v(n) values so text in the right position
H=2 ! "" h(n) "" "" ""
Dim H(7)
Data 26,145,195,245,295,171,221
' h 1 2 3 4 5 6 7
For N=1 To 7
Read Horiz
H(N)=Horiz
Next N
Dim V(30)
'
For N=1 To 200
Com(N)=0 !reset commands
Next N
Return
' --------------------------------------------------------------------------
Procedure B !clears input area at the bottom of the screen
Deffill 0
Pbox 0,177,319,199
Return
' -----------------------------------------------------------------------------
Procedure Set_up_display
Cls
For N=1 To 25
V(N)=N*8 !sets verticle text positions
Draw 0,V(N) To 319,V(N) !draws parrallel lines
Next N
Color 0
Draw 0,V(1) To 319,V(1) !erase a line
Color 1
@B
Box 0,0,319,200-8*3 !boarder
For N=1 To 5
Draw H(N),0 To H(N),V(22) !verticle lines
Next N
Draw H(6),V(14) To H(6),V(22)
Draw H(7),V(10) To H(7),V(14)
Deftext 1,0,0,6
Text H(1)+8,12,"COMMANDS LIST"
Deftext 1,0,0,4
Text 0+H,V(1)+V,"COM-"
Text 0+H,V(2)+V,"MAND"
Text H(5)+2,V(1)+V,22,"SEC-"
Text H(5)+2,V(2)+V,22,"TION"
'
Text H(2)+H+2,V(1)+V,42,"PICTURE"
Text H(2)+H+2,V(2)+V,42,"OPTIONS"
Text H(3)+H+2,V(1)+V,42,"SAMPLE"
Text H(3)+H+2,V(2)+V,42,"OPTIONS"
Text H(4)+H,V(1)+V,46,"SEQUENCE"
Text H(4)+H+2,V(2)+V,42,"OPTIONS"
Deftext 1,1,0,4 !bold
Restore Coloum_titles !ie restore data from here onwards
Coloum_titles:
Data LOAD,SHOW,PAUSE,GOTO,CLS,SCROLL,FADE
For N=1 To 7
Read Lable$
Text H(2)+H+1,V(2+N)+V,45,Lable$ !PRINT PICTURE OPTIONS LIST
Next N
Data LOAD,PLAY,SPEED
For N=1 To 3
Read Lable$
Text H(3)+H+1,V(2+N)+V,45,Lable$ !PRINT SAMPLE OPTIONS LIST
Next N
Data LOAD,SAVE,MERGE,CLEAR ALL,MEMORY?,INSERT,DELETE,PRINT,,,,QUIT
For N=1 To 12
Read Lable$
Text H(4)+H+1,V(2+N)+V,45,Lable$ !PRINT SEQUENCE OPTIONS LIST
Next N
For N=1 To 8
Text H(2)+H+8,V(14+N)+V,N !print 1 to 8 by miniscreen
Next N
Pbox H(6)+1,V(14)+1,H(5)-1,V(22)-1 !clear miniscreen
Deftext 1,0,0,4
Sget Display$
Return
' -----------------------------------------------------------------------------
Procedure Com_text !(needs to be faster!)
Local Line
For Line=1 To 20 !ie. lines down screen for coms
Com_no=Com_pos-10+Line !the com number for the line
If Com_no=Com_selected
Deftext 2,0,0,4 !so text is printed in red (or color 2)
Else
Deftext 1,0,0,4 !normal color
Endif
H=2
Text H+2,V((Line)+2)-2,"000" !}
If Com_no<10 !} adjust so number like 4 appear as 004
H=H+6 !}
Endif !}
If Com_no<100 !}
H=H+6 !}
Endif
Text H+2,V(Line+2)+V,Com_no ! PRINT THE COM NUMBERS DOWN THE LEFT EDGE
Text H(1)+1,V(Line+2)+V,Space$(19) !erase previous text
Text H(1)+113,V(Line+2)+V," "
H=2
Screen_no$=Str$(Screen_no%(Com_no))
Com_text$=""
If Com(Com_no)=1 Or Com(Com_no)=1+12 !load pic or sample
Com_text$="LOAD "+Screen_title$(Com_no)+Space$(13-Len(Screen_title$(Com_no)))+Str$(Screen_no%(Com_no))
' Text H(1)+H+111,V(Line+2)+V,Screen_no%(Com_no)
Endif
If Com(Com_no)=2 !ie show
Name$=""
For Q=Com_no Downto 1
If Com(Q)=1 ! load a picture
If Screen_no%(Q)=Screen_no%(Com_no)
Name$=Screen_title$(Q)
Q=1
Endif
Endif
Next Q
Com_text$="SHOW "+Name$+Space$(13-Len(Name$))+Str$(Screen_no%(Com_no))
' Text H(1)+H+111,V(Line+2)+V,Screen_no%(Com_no)
Endif
If Com(Com_no)=2+12 !ie play
Name$=""
For Q=Com_no Downto 1
If Com(Q)=1+12 !ie load a sample
If Screen_no%(Q)=Screen_no%(Com_no)
Name$=Screen_title$(Q)
Q=1
Endif
Endif
Next Q
Com_text$="PLAY "+Name$+Space$(13-Len(Name$))+Str$(Screen_no%(Com_no))
' Text H(1)+H+111,V(Line+2)+V,Screen_no%(Com_no)
Endif
If Com(Com_no)=3
Screen_no$=Str$(Screen_no%(Com_no))
Seconds$=Str$(Trunc(Screen_no%(Com_no)/50)+0.5)
Com_text$="PAUSE "+Screen_no$+" ("+Seconds$+"s)"
Endif
If Com(Com_no)=4
Com_text$="GOTO "+Screen_no$
Endif
If Com(Com_no)=5
Red=Screen_no%(Com_no)/256
Green=Frac(Red)*16
Blue=Frac(Green)*16
Red$=Str$(Trunc(Red))
Green$=Str$(Trunc(Green))
Blue$=Str$(Trunc(Blue))
Rgb$=" ("+Red$+", "+Green$+", "+Blue$+")."
Com_text$="CLS "+Screen_no$+Rgb$
Endif
If Com(Com_no)=6
If Screen_no%(Com_no)=0
Com_text$="Scroll OFF."
Else
Com_text$="Scroll ON. Step="+Str$(Screen_no%(Com_no))
Endif
Endif
If Com(Com_no)=7
If Screen_no%(Com_no)=0
Com_text$="Fade OFF."
Else
Com_text$="Fade ON. Speed="+Str$(Screen_no%(Com_no))
Endif
Endif
If Com(Com_no)=15
Com_text$="Sample speed = "+Str$(Screen_no%(Com_no))
Endif
'
Text H(1)+H,V(Line+2)+V,Com_text$ !print the command text
If Print_coms!=True
Lprint Com_no'
Lprint Com_text$
Endif
If Line*10=Com_pos
Deftext 2,0,0,4
Else
Deftext 1,0,0,4
Endif
Text 299,V((Line)+2)-2,Line*10 !print positions down right
Next Line
H=2
Deftext 1,0,0,4
Return
' -----------------------------------------------------------------------------
Procedure Com_select
If Mousex<H(2) And Mousey>V(2) And Mousey<V(22)
@Line
Com_line=Line
Com_selected=Com_pos-10+Com_line
Endif
Return
' -----------------------------------------------------------------------------
Procedure Com_load_pic
Local Name$
Repeat
Text H,V(23)+V,"Return to get fileselect box. Enter pic name :-"
Repeat
Valid!=-1
Print At(1,24); !position cursor for input
Input Name$
@B !(clear input area)
If Name$="" !ie if return pressed
Fileselect "*.p?1","",Name$
Endif
If Len(Name$)>12
Text H,V(23)+V,"Name too long. Must be 8 characters + . + extension."
Valid!=0 !ie not valid
Endif
' Spaces!=0
For N=1 To 12
If Mid$(Name$,N,1)=" "
Text H,V(23)+V,"Spaces not allowed in a filename. Please re-enter :-"
Valid!=0
' Spaces!=-1
Endif
Next N
Until Valid!=-1 !Len(Name$)=<12 And Spaces!=0
Until Len(Name$)>0 !(=name$<>"") this repeat loop is so cancel of fileselect can be used
Text H,V(23)+V,"Load into which screen memory (1 to "
Text H+216,V(23)+V,No_screens%
Text H+234,V(23)+V,") :-"
Screen_title$(Com_selected)=Name$
Min=1 !minimum number for screen_no%(memory_bank)
Max=No_screens% !max ""
Return
' -----------------------------------------------------------------------------
Procedure Com_show
Text H,V(23)+V,"Enter the pictures number, 1 to"
Text H+33*6,V(23)+V,No_screens%
Text H+39*6,V(23)+V,":- "
Min=1
Max=No_screens%
Return
' -----------------------------------------------------------------------------
Procedure Com_pause
Text H,V(23)+V,"Enter the pause length in 50 th's of a second :-"
Min=0
Max=180000 !ie 1 hour
Return
' -----------------------------------------------------------------------------
Procedure Com_goto
Text H,V(23)+V,"Enter the command number to goto :-"
Min=1
Max=210
Return
' -----------------------------------------------------------------------------
Procedure Com_cls
Min=0
Max=7
Text H,V(23)+V,"Enter the red value of the color to clear screen to :-"
' Print At(1,24);
@Read_num(Min,Max)
Red=Read_number
Text H,V(23)+V,"Enter the green value of the color to clear screen to :-"
' Print At(1,24);
@Read_num(Min,Max)
Green=Read_number
Text H,V(23)+V,"Enter the blue value of the color to clear screen to :-"
' Print At(1,24);
@Read_num(Min,Max)
Blue=Read_number
Screen_no%(Com_selected)=Red*256+Green*16+Blue !calculate color as one number (as screen_no% stores it)
Return
' -----------------------------------------------------------------------------
Procedure Com_scroll
Text H,V(23)+V,"Enter the step value for the scrolling (0 for off) :-"
Min=-300
Max=300
Return
' -----------------------------------------------------------------------------
Procedure Com_fade
Text H,V(23)+V,"Enter speed for fading [1=fast] (0 for off) :-"
Min=0
Max=100000
Return
' -----------------------------------------------------------------------------
Procedure Line
Line=(Mousey-16)/8
Line=Trunc(Line)+1
Return
' -----------------------------------------------------------------------------
Procedure Picture_options
If Mousex>H(2) And Mousex<H(3) And Mousey>V(2) And Mousey<V(9)
@Line
Com(Com_selected)=Line
On Line Gosub Com_load_pic,Com_show,Com_pause,Com_goto,Com_cls,Com_scroll,Com_fade
If Com(Com_selected)<>5 !as color has already been entered for com(5) in cls
@Read_num(Min,Max)
Screen_no%(Com_selected)=Read_number
@B
Endif
Inc Com_selected !move down to next com
Endif
Return
' -----------------------------------------------------------------------------
Procedure Com_load_sample
Local Name$
Repeat
Text H,V(23)+V,"Return to get fileselect box. Enter sample name :-"
Repeat
Valid!=-1
Print At(1,24); !position cursor for input
Input Name$
@B !(clear input area)
If Name$="" !ie if return pressed
Fileselect "*.spl","",Name$
Endif
If Len(Name$)>12
Text H,V(23)+V,"Name too long. Must be 8 characters + . + extension."
Valid!=0 !ie not valid
Endif
For N=1 To 12
If Mid$(Name$,N,1)=" "
Text H,V(23)+V,"Spaces not allowed in a filename. Please re-enter :-"
Valid!=0
Endif
Next N
Until Valid!=-1 !Len(Name$)=<12 And Spaces!=0
Until Len(Name$)>0 !(=name$<>"") this repeat loop is so cancel of fileselect can be used
Text H,V(23)+V,"Load into which sample memory (1 to "
Text H+216,V(23)+V,No_screens%
Text H+234,V(23)+V,") :-"
Screen_title$(Com_selected)=Name$
Min=1 !minimum number for screen_no%(memory_bank)
Max=No_screens% !max ""
Return
' -----------------------------------------------------------------------------
Procedure Com_play
Text H,V(23)+V,"Enter the samples number, 1 to"
Text H+33*6,V(23)+V,No_screens%
Text H+39*6,V(23)+V,":- "
Min=1
Max=No_screens%
Return
' -----------------------------------------------------------------------------
Procedure Com_set_speed
Text H,V(23)+V,"Enter speed setting for sample playback, 0 to 7 : "
Min=0
Max=7
Return
' -----------------------------------------------------------------------------
Procedure Sample_options
If Mousex>H(3) And Mousex<H(4) And Mousey>V(2) And Mousey<V(5)
' Text H,V(24)+V,"Currently unavailable. Wait for next version!"
@Line
Com(Com_selected)=Line+12 !ie there are 12 pic options
On Line Gosub Com_load_sample,Com_play,Com_set_speed
@Read_num(Min,Max)
Screen_no%(Com_selected)=Read_number
@B
Inc Com_selected
Endif
Return
' -----------------------------------------------------------------------------
Procedure Sequence_options
If Mousex>H(4) And Mousex<H(5) And Mousey>V(2) And Mousey<V(15)
@Line
On Line Gosub Loading_sequence,Saving_sequence,Merge_sequence,Clear_all,Check_memory,Insert_com,Delete_com,Print_com,B,B,B,Quit_com
Endif
Return
' -----------------------------------------------------------------------------
Procedure Highest_com !finds the highest_com number you've used. ie total number of coms
For N=210 Downto 1
If Com(N)<>0
Highest_com=N
N=1 !finish searching as highest found
Endif
Next N
Return
' -----------------------------------------------------------------------------
Procedure Saving_sequence
Com_selected=1
@Highest_com
Fileselect "*.itr","",Sav_me$
Message$="Save current sequence as "+Sav_me$+" (y if yes)?"
@Yes_no(Message$)
If Yes!=0
Sav_me$=""
Endif
If Sav_me$<>""
Open "o",#1,Sav_me$
Total_commands%=Highest_com
' No_loadscrn%=8
Write #1,Total_commands%
' Write #1,No_loadscrn%
For Com_no%=1 To Total_commands%
Write #1,Com(Com_no%)
Write #1,Screen_no%(Com_no%)
If Com(Com_no%)=1 Or Com(Com_no%)=12+1 !if load_pic or load_sample
Write #1,Screen_title$(Com_no%)
Endif
Next Com_no%
Close #1
Endif
Return
' -----------------------------------------------------------------------------
Procedure Loading_sequence
Local E%
Fileselect "*.itr","",Lod_me$
Message$="Load sequence called "+Lod_me$+" (y if yes)?"
@Yes_no(Message$)
If Yes!=0
Lod_me$=""
Endif
If Lod_me$<>""
For E%=0 To 210
Com(E%)=0
Next E%
Highest_com=0
Open "i",#1,Lod_me$ !"a:exampl2.itr"
Input #1,Total_commands%
' Input #1,No_loadscrn%
For Com_no%=1 To Total_commands%
Input #1,Com(Com_no%)
Input #1,Screen_no%(Com_no%)
If Com(Com_no%)=1 Or Com(Com_no%)=12+1
Input #1,Screen_title$(Com_no%)
Endif
Next Com_no%
Close #1
Endif
Return
'
Procedure Merge_sequence !can also be used to cut, copy, paste, move etc.
Local Merge_pos,Lod_me$,Total_commands%,Counter,N
Text 0,V(23)+V,319,"Enter position where you want to insert (merge) a file"
@Read_num(1,199)
Merge_pos=Read_number
Fileselect "*.itr","",Lod_me$
@B
Merge_pos$=Str$(Merge_pos)
Message$="Merge sequence called "+Lod_me$+" at "+Merge_pos$+" (y if yes)?"
@Yes_no(Message$)
If Yes!=0
Lod_me$=""
Endif
@B
Text H,V(23)+V,"Please wait...."
If Lod_me$<>""
Open "i",#1,Lod_me$
Input #1,Total_commands%
For Counter=1 To Total_commands%
@Highest_com
For N=Highest_com Downto Merge_pos
Com(N+1)=Com(N)
Screen_no%(N+1)=Screen_no%(N)
Screen_title$(N+1)=Screen_title$(N)
Next N
Next Counter
' Input #1,No_loadscrn%
For Com_no%=Merge_pos To Total_commands%+Merge_pos-1
Input #1,Com(Com_no%)
Input #1,Screen_no%(Com_no%)
If Com(Com_no%)=1 Or Com(Com_no%)=12+1
Input #1,Screen_title$(Com_no%)
Endif
Next Com_no%
Close #1
Endif
' @Highest_com
Return
' -----------------------------------------------------------------------------
Procedure Clear_all
Message$="Completely clear current sequence from memory (yes) ?"
Text H,V(23)+V,"Completely clear current sequence from memory (yes) ?"
@Yes_no(Message$)
If Yes!=-1
For N=1 To 200
Com(N)=0
Next N
Endif
Return
'
Procedure Check_memory
Local Mem,Com_no
Memory_used%=0
Erase Screen_memory!()
Dim Screen_memory!(No_screens%)
For Mem=1 To No_screens%
Screen_memory!(Mem)=False
Next Mem
For Com_no=210 Downto 1
If Com(Com_no)=1 !command is load
Screen_memory!(Screen_no%(Com_no))=True
Endif
Next Com_no
For N=1 To No_screens%
If Screen_memory!(N)=True
Memory_used%=Memory_used%+32066
Endif
Next N
Text H,V(23)+V,"MEMORY USED (FOR PICS) : "+Str$(Memory_used%)
Text H,V(24)+V,"MEMORY FREE (bytes) : "+Str$(Fre(O)-Memory_used%)
Repeat
Until Inkey$<>"" Or Mousek<>0
Return
' -----------------------------------------------------------------------------
Procedure Insert_com
Text H,V(23)+V,"Enter position where you want to insert a command :-"
Print At(1,24);
@Read_num(1,199)
Insert_pos=Read_number
For N=199 Downto Insert_pos
Com(N+1)=Com(N) !shift commands down
Screen_no%(N+1)=Screen_no%(N)
Screen_title$(N+1)=Screen_title$(N)
Next N
Com(Insert_pos)=0 !clear this com
' @Com_text
Return
' -----------------------------------------------------------------------------
Procedure Delete_com
Text H,V(23)+V,"Enter position where you want to delete a command"
Print At(1,24);
@Read_num(1,200)
Delete_pos=Read_number
For N=Delete_pos To 199
Com(N)=Com(N+1) !shift commands back one
Screen_no%(N)=Screen_no%(N+1)
Screen_title$(N)=Screen_title$(N+1)
Next N
@Com_text
Return
' -----------------------------------------------------------------------------
Procedure Print_com
Print_coms!=True
@Com_text
Print_coms!=False
Return
' -----------------------------------------------------------------------------
Procedure Com_position
Line=(Mousey-16)/8
Line=Trunc(Line)+1
Com_pos=Line*10
Com_selected=Com_pos+Com_line-10
Return
' -----------------------------------------------------------------------------
Procedure Main_program
@Set_up_display
@Com_text
' Deftext 1,0,0,4
Text 46,V(24)+V,228,"RIGHT CLICK TO RE-DRAW SCREEN DISPLAY!"
Do
If Mousek=2 !right click
Sput Display$ !re-draw display
@Com_text
Text 46,V(24)+V,228,"RIGHT CLICK TO RE-DRAW SCREEN DISPLAY!"
Endif
If Mousek=1 !left click
@B
If Mousex<H(2)
@Com_select
Else
If Mousex<H(3)
@Picture_options
Else
If Mousex<H(4)
@Sample_options
Else
If Mousex<H(5)
@Sequence_options
Else
@Com_position !ie mousex>=h(5)
Endif
Endif
Endif
Endif
@Com_text
@B
Text 46,V(24)+V,228,"RIGHT CLICK TO RE-DRAW SCREEN DISPLAY!"
Endif
Loop
Return
' -----------------------------------------------------------------------------
Procedure Read_num(Minimum,Maximum)
Repeat
Print At(1,24);
Input Number$
Read_number=Val(Number$)
If Read_number<Minimum Or Read_number>Maximum
@B
Text H,V(23)+V,"Number out of range ("
Text H+28*6,V(23)+V,Minimum
Text H+31*6,V(23)+V,"to"
Text H+38*6,V(23)+V,Maximum
Text H+45*6,V(23)+V,") :-"
Endif
Until Read_number>=Minimum And Read_number=<Maximum
Return
'
Procedure Error_message
For N=1 To 50
Col=Trunc(Rnd*1911)
Setcolor 0,Col
Next N
Setcolor 0,0
@B
Cls
Text H,V(1)+V,"An error has occured."
Text H,V(2)+V,"If you have found a bug please contact :-"
Text H,V(4)+V,"Anthony Daniels, 83 Riverview, Melton, Woodbridge,"
Text H,V(5)+V,"Suffolk, IP12 1QU."
Text H,V(7)+V,"Send a disk and S.A.E. for upgrade."
Text H,V(9)+V,"Press a key to continue"
Repeat
Until Inkey$<>""
Sput Display$
@Com_text
Return
' -----------------------------------------------------------------------------
Procedure Yes_no(Info$)
@B
Text H,V(23)+V,Info$
Yes!=0
Print At(1,24);
Input Yes_no$
Yes_no$=Upper$(Yes_no$)
If Yes_no$="Y" Or Yes_no$="YES" Or Yes_no$="Y "
Yes!=-1
Endif
Return
' -----------------------------------------------------------------------------