home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ARM Club 3
/
TheARMClub_PDCD3.iso
/
hensa
/
filemanager
/
winsave_1
/
!WinSave
/
Resources
/
!Intro
(
.txt
)
next >
Wrap
RISC OS BBC BASIC V Source
|
1995-11-11
|
5KB
|
184 lines
WinSave Intro
(c) 1995 Ian Clark
This program is not to be distributed seperatly
from the WinSave application
Although you may use it as a welcome screen for your
own programs if you want (You will need to change the templates
and sprites)
If you use it then you must leave the copyright messages in
Although you may copyright your templates and sprites
by adding another REM line
Remember, wealth is just a state of mind....
Therefore send all your money to me!!
Well, it was worth a try!
0,"Intro error: "+
$+" at line "+
<wimpslot%=64 :
Set this variable to the wimpslot reqd.
block% 256
"Wimp_SlotSize",-1,-1
,next%,free%
wimpslot%=wimpslot%*1024
next%>free% next%=free%
free%>next% next%=free%
next%<wimpslot%
0,"Application needs at least "+
(wimpslot%/1024)+"k to start up."
The following few lines load the sprites
local to the program
"Wimp_ReadSysInfo",2
String(sp%)
#1spfile$="<WinSave$Dir>.Resources.Sprites"+sp$
"OS_File",17,spfile$
found%
found%<>1
spfile$="<WinSave$Dir>.Resources.Sprites"
size%=FNUnsquash(spfile$)
spfile$="<WinSave$Scrap>"
"OS_File",17,spfile$
,,,,size%
size%+=4
"OS_Module",6,,,size%
,,sprite%
!sprite%=size%:sprite%!8=16
"OS_SpriteOp",&209,sprite%
"OS_SpriteOp",&20A,sprite%,spfile$
./msgpath$="<WinSave$Dir>.Resources.Messages"
"MessageTrans_FileInfo",,msgpath$
,,msgsize%
"OS_Module",6,,,20+
msgpath$
,,msg%
$(msg%+16)=msgpath$
"OS_Module",6,,,msgsize%
,,msblk%
"MessageTrans_OpenFile",msg%,msg%+16,msblk%
!block%=0
"Wimp_Initialise",310,&4B534154,"WinSave intro",block%
,id%
"Wimp_OpenTemplate",,"<WinSave$Dir>.Resources.Templates"
"Wimp_LoadTemplate",,-1,-1,,-1,"Splash",0
,b%,i%,,,,ptr%
win% b%
indir% i%
font% 256 :
byte array for fonts
Must init to zero!!!
x%=0
256
font%!x%=0
"Wimp_LoadTemplate",,win%,indir%,indir%+i%,font%,"Splash",0
win%!64=sprite%
"Wimp_CreateWindow",,win%
mainw%
quit%=
Seticontext(mainw%,4,
Gm("VER"),4),0)
Centrew(mainw%)
"Wimp_Poll",,block%
code%
code%=2
"Wimp_OpenWindow",,block%
code%=0
"Wimp_SlotSize",-1,-1
,next%,free%
"Wimp_SlotSize",-1,wimpslot%
"Wimp_StartTask","Run <WinSave$Dir>.!RunImage"
"Wimp_SlotSize",-1,next%
"Wimp_Poll",,block%
code%
code%
2 :
"Wimp_OpenWindow",,block%
3 :
"Wimp_CloseWindow",,block%
17,18
block%!16=0 quit%=
block%!16=&400C2
block%!4<>id% quit%=
-t%>150
quit%
x%=0
font%?x%>0
font%?x%-=1
"Wimp_CloseDown"
SYS"OS_Module",7,,sprite%
"OS_Module",7,,msblk%
"OS_Module",7,,msg%
"XOS_CLI","Wipe <WinSave$Scrap> ~C~vRF"
String(ptr%)
t$<255
?ptr%>31
(?ptr%)
ptr%+=1
Centrew(whandle%)
x%,y%,scrx%,scry%,dx%,dy%,w%,h%
block%!0=4:block%!4=5
block%!8=11:block%!12=12
block%!16=-1
"OS_ReadVduVariables",block%,block%+20
dx%=1<<(block%!20)
dy%=1<<(block%!24)
scrx%=(block%!28+1)*dx%
scry%=(block%!32+1)*dy%
block%!0=whandle%
"Wimp_GetWindowState",,block%
w%=block%!12-block%!4
h%=block%!16-block%!8
x%=(scrx%-w%)/2
y%=(scry%-h%)/2
block%!4=x%
block%!8=y%
block%!12=x%+w%
block%!16=y%+h%
block%!28=-1
"Wimp_OpenWindow",,block%
Seticontext(w%,i%,t$,d%)
d% is set to true (-1) if it is a 3d bordered icon and we don't want
flicker when we update it, if d% is true the size of the area redrawn
is reduced so the border isn't redrawn
with some icons this may cut some of the text off
more%
!block%=w%:block%!4=i%
"Wimp_GetIconState",,block%
$(block%!28)=t$
(block%!4=block%!8:block%!8=block%!12
+block%!12=block%!16:block%!16=block%!20
block%!4+=5
block%!8+=5
block%!12-=5
block%!16-=5
"Wimp_UpdateWindow",,block%
more%
more%
"Wimp_GetRectangle",,block%
more%
Gm(tok$)
out$
"MessageTrans_Lookup",msg%,tok$,msblk%,256
,,out$
=out$
Unsquash(in$)
size%,in%,ws%,out%,work%
"OS_File",17,in$
,,,,size%
DIM in% size%+4
"OS_Module",6,,,size%+4
,,in%
"OS_File",16,in$,in%,0
"Squash_Decompress",1<<3
DIM out% !in%
"OS_Module",6,,,!in%
,,out%
DIM work% ws%
"OS_Module",6,,,ws%
,,work%
"Squash_Decompress",1<<2,work%,in%+4,size%-4,out%,!in%
,,,,ptr%
"OS_File",10,"<WinSave$Scrap>",&FFD,,out%,ptr%
size%=!in%
"OS_Module",7,,in%
"OS_Module",7,,out%
"OS_Module",7,,work%
=size%