' 2021 11 21 adding and testing procedure to copy original files from source path to destination path
' 2021 11 13, Modifications to Installation menu
' 3 choices: install game, install mods, exit from installation
DECLARE SUB UpdateOp
(oplist$
, num%
, opval$
, length%
)
Const Spath
= "A:\", Dpath
= "C:\STUNTS", Source
= 1, Destination
= 2 Const MainWin
= 1, InstallWin
= 2, MsgWin
= 7 Dim Shared videoid$
(1 To 5), soundid$
(1 To 6), curvideo%
, cursound%
, Mpath$
(1 To 5, 1 To 2) Dim Shared runfile$
, SourcePath$
, DestPath$
, DummyCurpath%
, DefaultSourcePath$
, DefaultDestinationpath$
runfile$ = "STUNTS.BAT"
Defaultsourcepat$ = Spath
DefaultDestinationpath$ = Dpath
SourcePath$ = ".\"
DestPath$ = ".\cs11"
DummyCurpath% = 1
videoid$(1) = "MCGA"
videoid$(2) = "EGA"
videoid$(3) = "Tandy"
videoid$(4) = "Hercules"
videoid$(5) = "CGA"
curvideo% = 1
soundid$(1) = "No sound"
soundid$(2) = "PC Speaker"
soundid$(3) = "Tandy"
soundid$(4) = "Ad Lib"
soundid$(5) = "Sound Blaster"
soundid$(6) = "MT-32"
cursound% = 1
header
men(1).x = 4
men(1).y = 7
men(1).w = 40
men(1).c1 = 7
men(1).c2 = 4
ment$(1) = "Video display`Sound option`Install game to ...`Exit"
men(2).x = 13
men(2).y = 12
men(2).w = 27
men(2).c1 = 0
men(2).c2 = 2
ment$(2) = "MGCA/VGA graphics`EGA graphics`Tandy graphics`Hercules graphics`CGA graphics"
men(3).x = 11
men(3).y = 12
men(3).w = 34
men(3).c1 = 0
men(3).c2 = 2
ment$(3) = "No music or sound effects`Internal PC speaker`Tandy sound`Ad Lib card`Sound Blaster card`Roland MT-32"
men(4).x = 11
men(4).y = 12
men(4).w = 40
men(4).c1 = 0
men(4).c2 = 1
ment$(4) = "Install game`Install mods`Exit"
men(5).x = 67
men(5).y = 15
men(5).w = 10
men(5).c1 = 0
men(5).c2 = 4
ment$(5) = "Yes`No`Cancel"
ErrMsg$(1) = "Error: file of configuration not found"
ErrMsg$(2) = "Error: file of list of installation not found"
ErrMsg$(3) = "Error: file of original installation not found"
ErrMsg$(4) = "Error: file of Mods installation not found"
CurErr% = 0
Mpath$(1, Source) = "Caution you are changing default source path!"
Mpath$(2, Source) = "Type here source path: "
Mpath$(3, Source) = "This is the new source path: "
Mpath$(1, Destination) = "Caution you are changing default destination path!"
Mpath$(2, Destination) = "Type here destination path: "
Mpath$(3, Destination) = "This is the new destination path: "
LoadConfig
' loading list file installation
CurErr% = 2
z = 0
z = z + 1
'Print InstFile(z), z
'If z Mod 20 = 0 Then Sleep
CurErr% = 0
UpdateOp ment$(1), 1, videoid$(curvideo%), men(1).w - 2
UpdateOp ment$(1), 2, soundid$(cursound%), men(1).w - 2
curmain% = 1
a% = Menu%(men(1), ment$(1), curmain%)
If a%
<> -1 Then curmain%
= a%
Case -1 ' exiting by EScape key from menu Case 4 'saving configuration SaveConfig
UpdateRunFile
Print "Configuration saved." Case 1 'video display settings a% = Menu%(men(2), ment$(2), curvideo%)
If a%
<> -1 Then curvideo%
= a%
UpdateOp ment$(1), 1, videoid$(curvideo%), men(1).w - 2
a% = Menu%(men(3), ment$(3), cursound%)
If a%
<> -1 Then cursound%
= a%
UpdateOp ment$(1), 2, soundid$(cursound%), men(1).w - 2
Case 3 'install options.... ' here user can choose installation of original game
' adding mods
' after doing this he can choose destination folder, source folder
b% = Menu%(men(4), ment$(4), DummyCurpath%)
Case 1 ' game standard installation ChangePath Source
ChangePath Destination
CurErr% = 3
nameFile$
= SourcePath$
+ Slash$
+ LTrim$(InstFile
(w
)) namefile2$
= DestPath$
+ Slash2$
+ LTrim$(InstFile
(w
)) MkDir DestPath$
+ Slash2$
tmp$ = ""
CurErr% = 0
Case 2 ' mods installation ChangePath Source
ChangePath Destination
CurErr% = 4
' Open "filen" For Input As #1
CurErr% = 0
Case 3 ' return to option menu
Fileok:
If CurErr%
= 0 Then CurErr%
= 1
nofile:
ShowMessage 14, 0, 16, 19, 20, 50 + k, 0, 3, ErrMsg$(CurErr%)
If tmp$
= "" Then Filename$
= nameFile$
Else Filename$
= namefile2$
ShowMessage 14, 0, 16, 19, 20, 50, 0, 3, "File error: " + Filename$
Apath$ = SourcePath$
k = 0
Apath$ = DestPath$
k = 4
ShowMessage 14, 0, 16, 19, 15, 56 + k, 0, 3, Mpath$(1, Mtype)
Input "Type here source path: ", a$
Input "Type here destination path: ", a$
c% = Menu%(men(5), ment$(5), DummyCurpath%)
Apath$ = a$
If Mtype
= Source
Then SourcePath$
= Apath$
Else DestPath$
= Apath$
' nothing is changed
Sub ShowMessage
(Fcol
, Bcol
, Urow
, Brow
, FstCo
, WidthMsg
, sFcol
, sBcol
, Msg$
) 'Subroutine to show a message on the ASCII screen and restore
' the previous screen after message has been shown
' Usage: SHOWMESSAGE Forwardcolor, Backgroundcolor, UpRow, BottomRow,FirstColumn, WidthMessagge,shadowForwardColor,shadowBackgroundColor, Message$
'Make sure the file exists
' Open "setup.cfg" For Binary As 1: Close 1
curvideo% = i%
cursound% = i%
mt$ = mm$
mops = mops + 1
mop$
(mops
) = Left$(mt$
, n%
- 1) mop$(mops) = mt$
mt$ = ""
For i%
= m.y
+ 1 To m.y
+ mops
Print "³ " + mop$
(i%
- m.y
) + Space$(m.w
- Len(mop$
(i%
- m.y
)) - 1) + "³";
For i%
= m.y
+ 1 To m.y
+ mops
+ 1
cur% = ini%
ex% = 1
Update% = -1
ex% = cur%
Update% = 0
cur% = cur% - 1
cur% = mops
Update% = -1
cur% = cur% + 1
cur% = 1
Update% = -1
cur% = -1
Menu% = cur%
Print #1, "video=" + videoid$
(curvideo%
) Print #1, "sound=" + soundid$
(cursound%
) Print #1, "runfile=" + runfile$
Sub UpdateOp
(oplist$
, num%
, opval$
, length%
)
o$ = oplist$ ' oplist$ is a string of name of items of menu separated by ' except the last one
ops% = ops% + 1
op$
(ops%
) = Left$(o$
, n%
- 1) op$(ops%) = o$
o$ = ""
op$
(num%
) = op$
(num%
) + Space$(length%
- Len(op$
(num%
)) - Len(opval$
) - 2) op$(num%) = op$(num%) + "(" + opval$ + ")"
o$ = ""
o$ = o$ + op$(i%)
If i%
<> ops%
Then o$
= o$
+ "`"
oplist$ = o$
If videoid$
(curvideo%
) = "Tandy" Then v$ = "TDY"
v$ = "HERC"
v$ = videoid$(curvideo%)
Print #1, "@SKID" + v$
+ ".EXE";
'Color 15, 7
Print Space$(4) + Chr$(24) + " " + Chr$(25) + " to move highlight, ENTER to select option, ESC to exit, F1 for help" + Space$(5);
Locate 4, 18:
Print "Copyright (c) 2021 Stunts Online Community";