home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Fujiology Archive
/
fujiology_archive_v1_0.iso
/
!MAGS
/
!BONUS
/
COVERDSK
/
STFORMAT
/
STF34.ZIP
/
STF34A.MSA
/
INTRO
/
INTROPL5.LST
< prev
next >
Wrap
File List
|
1989-04-06
|
12KB
|
422 lines
On Break Gosub Break
On Error Gosub Break
@Main_program
Setcolor 0,1911
Procedure Break
Setcolor 0,1911
Setcolor 15,0
End !change to system or remove when compiling
Return
' ( ***** PROGRAM INTRODUCTION SEQUENCES ***** )
' written by Anthony Daniels. December 1991.
' ( ***** SECTION DISPLAY PROGRAM ***** )
' update on 22/2/1992 so samples can be played, & pics only use memory when loaded}
'
' var
' screen$(1 to 8)= picture
' screen_title$= current picture or samples name to be loaded
' screen_no%= no. of screen$(screen_no%) to be loaded or sput, or value for other commands
' p= pause time in 200th of a second
'
Procedure Initialise
Hidem
Dim Screen_title$(220)
Dim Com%(Total_commands%)
Dim Screen_no%(Total_commands%)
Free_memory%=Fre(O)
No_screens%=Trunc((Free_memory%-2000)/32066) !2k for variables etc
Print No_screens%
Dim Screen$(No_screens%)
@Load_sample_code
Fade!=False
Scroll%=0
Curtain%=0
Return
'
Procedure Load_sample_code
Dim A%(2000)
Code%=Varptr(A%(0))
Bload "BASCODE.EXE",Code%
Start%=Code%+28
Sample_speed%=4 ! ie default speed setting
Dim Sample_add%(No_screens%) ! initialise sample variables. This holds the address
Dim Sample_length%(No_screens%) ! length in bytes
Dim Sample$(No_screens%) ! the actual sample held in a string
Return
'
Procedure Load_screen !proc to carry out com%(com_no%)=1 ie loading
Local Add%
Screen$(Screen_no%(Com_no%))=Space$(32066) ! define some space for picture
Add%=Varptr(Screen$(Screen_no%(Com_no%)))
If Right$(Screen_title$(Com_no%),3)="PI1"
Bload Screen_title$(Com_no%),Add%
Else !ie its a pc1 screen - load and decompress screen
@Load_degas_compressed
Endif
Return
'
Procedure Load_degas_compressed
Pc1_file$=Space$(32066) !to hold a pc1 screen of up to 32k
Pc1_file%=Varptr(Pc1_file$)
' Print "loading Degas : "'Screen_title$(Com_no%)
Bload Screen_title$(Com_no%),Pc1_file%-34
Bmove Pc1_file%-34,Add%,34 !copy pallette to memory area for uncompressed screen
Add Add%,34
Ctr%=0
Repeat
Pic_line$=Space$(160) ! tempary storage for one line of pic
Line_add%=Varptr(Pic_line$) ! address of tempary line
Line_len%=0 ! length of tempary line
Repeat
Repeat
Dat%=Peek(Pc1_file%) !peek at data byte from compressed screen
Inc Pc1_file%
Until Dat%<>128
If Dat%<128
Inc Dat%
Add Line_len%,Dat%
For I%=1 To Dat%
Poke Line_add%,Peek(Pc1_file%)
Inc Line_add%
Inc Pc1_file%
Next I%
Else ! ie dat%>=128
Dat%=257-Dat%
Add Line_len%,Dat%
For I%=1 To Dat%
Poke Line_add%,Peek(Pc1_file%)
Inc Line_add%
Next I%
Inc Pc1_file%
Endif
Until Line_len%=160
Line_add%=Varptr(Pic_line$)
For I%=1 To 20
Dpoke Add%,Dpeek(Line_add%)
Dpoke Add%+2,Dpeek(Line_add%+40)
Dpoke Add%+4,Dpeek(Line_add%+80)
Dpoke Add%+6,Dpeek(Line_add%+120)
Add Add%,8
Add Line_add%,2
Next I%
'
Inc Ctr%
Until Ctr%=200
Showm
Return
'
Procedure Get_colours
Local Q%
For Q%=0 To 15
Colour%(Q%)=Xbios(7,Q%,-1)
Next Q%
Return
'
Procedure Restore_col
Local Q%
For Q%=0 To 15
' ==> ~XBIOS(7,q%,colour%(q%))
Next Q%
Return
'
Procedure Wait_key
Repeat
Until Inkey$<>""
Return
'
Procedure Sputing
Local Add%
Add%=34+Varptr(Screen$(Screen_no%(Com_no%))) !address of screen memory (1 to 7 on a 520 ST)
Bmove Add%-34,Xbios(3)-34,34
If Fade! Or Scroll_step%<>0 Or Curtain<>0
If Fade!
@Fade_out
Add%=34+Varptr(Screen$(Screen_no%(Com_no%))) !this seems to move so its reset here
Bmove Add%,Xbios(3),32000
' Void Xbios(6,L:Add%+2-34) ! set colours (first 2 bytes of file are resolution)
@Fade_in
Else
If Scroll_step%<>0
@Scroll_off
Add%=34+Varptr(Screen$(Screen_no%(Com_no%))) !address of screen memory (1 to 7 on a 520 ST)
Cls
Void Xbios(6,L:Add%+2-34) ! set colours (first 2 bytes of file are resolution)
@Scroll_on
Bmove Add%,Xbios(3),32000
Else
Endif
Endif
Else
Add%=34+Varptr(Screen$(Screen_no%(Com_no%))) !address of screen memory (1 to 7 on a 520 ST)
Void Xbios(6,L:Add%+2-34) ! set colours (first 2 bytes of file are resolution)
Bmove Add%,Xbios(3),32000 !first 34 bytes are resolution and colors in pallette
Endif
Return
'
Procedure Scroll_off
Local Y
If Scroll_step%>0
Y=0
Bmove Xbios(3)+(Y*160),Xbios(3)+((Y+Scroll_step%)*160),32000-(Y*160)
Deffill 0
Pbox 0,0,319,Scroll_step%
Repeat
Bmove Xbios(3)+(Y*160),Xbios(3)+((Y+Scroll_step%)*160),32000-(Y*160)
Y=Y+Scroll_step%
Until Y>=200-Scroll_step%
Endif
If Scroll_step%<0
Scroll_step%=Abs(Scroll_step%)
Y=Scroll_step%
Deffill 0
Pbox 0,199-Scroll_step%,319,199
Repeat
Bmove Xbios(3)+(Scroll_step%*160),Xbios(3),32000-(Y*160)
Y=Y+Scroll_step%
Until Y=>200-Scroll_step%
Endif
Return
'
Procedure Scroll_on
Local Y
If Scroll_step%>0
Y=1
Repeat
Bmove Add%+((199-Y)*160),Xbios(3),Y*160
Y=Y+Scroll_step%
Until Y=>200-Scroll_step%
Endif
If Scroll_step%<0
Y=1
Repeat
Bmove Add%,Xbios(3)+((199-Y)*160),Y*160
Y=Y+Scroll_step%
Until Y=>200-Scroll_step%
Endif
Return
' Setcolor 0,1911
' Setcolor 15,0
' '''Fileselect "\autoplay\*.pi1","thund1.pi1",Filename$
' Bload Filename$,Xbios(3)-34
' '@Get_pallette(Xbios(3))
' Repeat
' Until Inkey$<>""
Procedure Get_pallette(Scrn_address%)
Local A%
Erase Col%()
Dim Col%(15)
For A%=0 To 15
Col%(A%)=Dpeek(Scrn_address%-32+(2*A%))
If Col%(A%)>1911 ! if the pallette uses extra STE colors
W=Col%(A%) ! the STFM can not handle the extended pallette of the STe thus colors are rounded
Erase Bit_flag!()
Dim Bit_flag!(15)
For Bit_no%=15 Downto 0
Bit=W/(2^Bit_no%)
If Bit=>1
Bit_flag!(Bit_no%)=True
Else
Bit_flag!(Bit_no%)=False
Endif
W=(Frac(Bit))*(2^Bit_no%)
Next Bit_no%
For Count%=15 Downto 11
Bit_flag!(Count%)=0
Next Count%
Bit_flag!(7)=0
Bit_flag!(3)=0
Word=0
For Count%=0 To 15
If Bit_flag!(Count%)
Word=Word+(2^Count%)
Endif
Next Count%
Col%(A%)=Word
Endif
' Print "color ";A%;" = ";Hex$(Col%(A%))
Next A%
Return
'
Procedure Set_pallette
Local F%
For F%=0 To 15
Setcolor F%,Col%(F%)
Next F%
Return
'
Procedure Fade_out
' Local Q%,K%
' Fade_speed=100
@Get_pallette(Xbios(3)) !into col%(1..15)
@Set_pallette
Fading!=True
While Fading!
Fading!=False
For U%=0 To 15
If Col%(U%)>0 !if this color is not yet black
@Get_rgb(Col%(U%),*Red,*Green,*Blue)
If Red>0
Red=Trunc(Red)-1 !lower red component of color
Endif
If Green>0
Green=Trunc(Green)-1
Endif
If Blue>0
Blue=Trunc(Blue)-1
Endif
Col%(U%)=(Red*256)+(Green*16)+Blue ! work out new color value
Setcolor U%,Col%(U%)
Fading!=True
For K%=0 To Fade_speed !loop to slow down fading
Next K%
Endif
Next U%
Wend
Return
'
Procedure Fade_in
@Get_pallette(Xbios(3))
Erase Scrn_col%()
Dim Scrn_col%(15)
Swap Col%(),Scrn_col%()
@Get_pallette(Xbios(3))
For U%=0 To 15
Col%(U%)=0
Setcolor U%,0
Next U%
Fading!=True
While Fading!
Fading!=False
For U%=0 To 15
' Scrn_col%=Dpeek(Xbios(3)-32+(2*U%))
Scrn_col%=Scrn_col%(U%)
@Get_rgb(Scrn_col%,*Scrn_red%,*Scrn_green%,*Scrn_blue%) !find out screens r,g,b
@Get_rgb(Col%(U%),*Current_red%,*Current_green%,*Current_blue%)
If Current_red%<Scrn_red% Or Current_green%<Scrn_green% Or Current_blue%<Scrn_blue%
If Current_red%<Scrn_red%
Inc Current_red%
Endif
If Current_green%<Scrn_green%
Inc Current_green%
Endif
If Current_blue%<Scrn_blue%
Inc Current_blue%
Endif
Col%(U%)=(Current_red%*256)+(Current_green%*16)+Current_blue%
' Setcolor 0,1911
' Setcolor 15,0
' Print "previously, color ";U%;" = ";Scrn_col%;" now = ";Col%(U%)
' Repeat
' Until Inkey$<>""
Setcolor U%,Col%(U%)
Fading!=True
For K%=0 To Fade_speed !loop to slow down fading
Next K%
Endif
Next U%
Wend
Return
'
Procedure Get_rgb(Color%,R%,G%,B%) ! ie address of color components red, green & blue
Local Red_value,Green_value,Blue_value
Red_value=Color%/256
Green_value=Frac(Red_value)*16
Blue_value=Frac(Green_value)*16
*R%=Trunc(Red_value)
*G%=Trunc(Green_value)
*B%=Trunc(Blue_value)
Return
'
Procedure Pausing
Pause Screen_no%(Com_no%)
Return
'
Procedure Gotoing
Com_no%=Screen_no%(Com_no%)-1
Return
'
Procedure Clsing
Cls
Setcolor 0,Screen_no%(Com_no%)
Return
'
Procedure Scrolling
Scroll_step%=Screen_no%(Com_no%)
Return
'
Procedure Fading
If Screen_no%(Com_no%)=0
Fade!=False
Else
Fade!=True
Fade_speed=Screen_no%(Com_no%)
Endif
Return
'
Procedure Loading_sequence
Print "press mouse to select introduction" !erase this if you do not ever want to select a file to load
For N=1 To 700
If Mousek=1
Fileselect "*.itr","",Load_seq$
N=700
Else
Load_seq$="introseq.itr" !this is the default setting for the intro sequence file name
Endif
Next N
Print "Loading"'Load_seq$
Open "i",#1,Load_seq$
Input #1,Total_commands%
' Input #1,No_loadscrn%
@Initialise ! to dimention variables
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
Cls
Return
'
Procedure N !nil proc
Return
'
Procedure Main_program
@Loading_sequence
Screen_title%=1
For Com_no%=1 To Total_commands%
' Print Com_no%
On Com%(Com_no%) Gosub Load_screen,Sputing,Pausing,Gotoing,Clsing,Scrolling,Fading,N,N,N,N,N,Load_samples,Play_sample,Set_speed
' 1 2 3 4 5 6 7 8 910 11 12 13
Next Com_no%
Setcolor 0,1911
Setcolor 15,0
Edit
Return
'
Procedure Load_samples
Sample_title$=Screen_title$(Com_no%)
Sample_no%=Screen_no%(Com_no%)
' Print "Loading sample : "'Sample_title$
Open "i",#1,Sample_title$
Sample_length%(Sample_no%)=Lof(#1)
' Print "Sample length : "'Sample_length%(Sample_no%)
Close #1
Sample$(Sample_no%)=Space$(Sample_length%(Sample_no%))
Sample_add%(Sample_no%)=Varptr(Sample$(Sample_no%))
Bload Sample_title$,Sample_add%(Sample_no%)
Return
'
Procedure Play_sample
Sample_no%=Screen_no%(Com_no%)
Lpoke Start%+2,Sample_add%(Sample_no%)
Lpoke Start%+6,Sample_length%(Sample_no%)
Lpoke Start%+10,Sample_speed% !0 is slowest, 7 is fastest
Call Start%
Return
'
Procedure Set_speed
Sample_speed%=Screen_no%(Com_no%)
Return