total.sync

This commit is contained in:
Peter Ferrie 2021-10-21 16:27:11 -07:00
parent d056ef5a56
commit 75dab27f9b
5 changed files with 80 additions and 70 deletions

View File

@ -1,41 +1,14 @@
a = new ActiveXObject("scripting.filesystemobject")
b = a.opentextfile("res\\GAMES.CONF")
b = a.opentextfile("build\\GAMES.SORTED")
entries = []
while (!b.atendofstream)
{
c = b.readline()
d = c.indexOf("#")
if (d >= 0)
{
c = c.substr(0, d)
}
d = c.indexOf("=")
if (d >= 0)
{
c = c.substr(0, d)
}
if (c.indexOf("[") >= 0)
{
break
}
c = c.substr(c.indexOf(",") + 1)
if (c.length > 0)
{
entries.push(c)
}
entries.push(b.readline())
}
entries.sort()
a.createtextfile("build\\games.lst").write(entries.toString().replace(/,/g, "\n"))
pre_off = a.getfile(WScript.Arguments(0) + "\\STANDARD").size
pre_off = a.getfile(WScript.Arguments(2)).size + a.getfile(WScript.Arguments(0) + "\\STANDARD").size
osize = pre_off
groups = "*=0\n" + "!le16 " + entries.length + ", 0\n"
@ -67,4 +40,4 @@ f.write(groups)
f.close()
x = new ActiveXObject("wscript.shell")
x.run('cmd /c %acme% -o ' + WScript.Arguments(1) + ' build\\pre.tmp', 0, 1)
x.run('cmd /c bin\\buildpreall.bat ' + WScript.Arguments(0) + ' ' + WScript.Arguments(2) + ' ' + WScript.Arguments(3), 0, 1)
x.run('cmd /c bin\\buildpreall.bat ' + WScript.Arguments(0) + ' ' + WScript.Arguments(2) + ' ' + WScript.Arguments(0) + '\\STANDARD', 0, 1)

View File

@ -1,3 +1,3 @@
@echo off
1>nul copy /y %3 %2
for /f "tokens=*" %%a in (build\games.lst) do 1>nul copy /b /y %2+%1\%%a %2
1>nul copy /y /b %2+%3 %2
for /f "tokens=*" %%a in (build\GAMES.SORTED) do 1>nul copy /b /y %2+%1\%%a %2

View File

@ -25,7 +25,7 @@ else
entries.sort()
a.createtextfile("build\\games.lst").write(entries.toString().replace(/,/g, "\n"))
a.createtextfile("build\\GAMES.SORTED").write(entries.toString().replace(/,/g, "\n"))
ss_off = a.fileexists(WScript.Arguments(2)) ? a.getFile(WScript.Arguments(2)).size : 0
groups = "*=0\n" + "!le16 " + entries.length + ", 0\n"

36
bin/makesorted.js Normal file
View File

@ -0,0 +1,36 @@
a = new ActiveXObject("scripting.filesystemobject")
b = a.opentextfile("res\\GAMES.CONF")
c = []
while (!b.atendofstream)
{
d = b.readline()
e = d.indexOf("#")
if (e >= 0)
{
d = d.substr(0, e)
}
e = d.indexOf("[eof]")
if (e > -1)
{
break
}
e = d.indexOf("=")
if (e == -1)
{
e = d.length
}
if (d.length > 0)
{
f = d.indexOf(",") + 1
c.push(d.substr(f, e - f))
}
}
a.createtextfile("build\\GAMES.SORTED").write(c.sort().toString().replace(/,/g, "\n"))

View File

@ -49,35 +49,46 @@ call :compress
1>nul copy /y "res\PREFS.CONF" "build" >>build\log
cscript /nologo bin\padto.js 512 build\PREFS.CONF
rem
rem precompute OKVS data structure for mega-attract mode configuration file
rem precompute binary data structure for mega-attract mode configuration file
rem
cscript /nologo bin\buildokvs.js res\ATTRACT.CONF build\ATTRACT.IDX >>build\log
rem
rem precompute FX and DFX indexes and merged data files containing multiple
rem graphic effects in a single file (loaded at runtime by LoadIndexedFile())
rem
1>nul copy /y nul build\FX.ALL
cscript /nologo bin\buildfx.js res\FX.CONF build\FX.IDX build\FX.ALL build\FX.INDEXED >>build\log
cscript /nologo bin\buildfx.js res\DFX.CONF build\DFX.IDX build\FX.ALL build\FX.INDEXED >>build\log
rem
rem substitute special characters in help text and other pages that will be
rem drawn with DrawPage()
rem precompute binary data structure and substitute special characters
rem in game help and other all-text pages
rem
cscript /nologo bin\subst.js res\HELPTEXT build\HELPTEXT >>build\log
cscript /nologo bin\subst.js res\CREDITS build\CREDITS >>build\log
for %%q in (res\GAMEHELP\*) do cscript /nologo bin\subst.js %%q build\GAMEHELP\%%~nxq >>build\log
rem
rem precompute indexed files for game help, slideshow configuration,
rem mini-attract mode configuration, and prelaunch files
rem create a sorted list of game filenames, without metadata or display names
rem
cscript /nologo bin\makesorted.js
rem
rem precompute indexed files for prelaunch
rem note: prelaunch must be first in TOTAL.DATA due to a hack in LoadStandardPrelaunch
rem note 2: these can not be padded because they are loaded at $0106 and padding would clobber the stack
rem
1>nul copy /y nul build\TOTAL.DATA
cscript /nologo bin\buildpre.js build\PRELAUNCH.INDEXED build\PRELAUNCH.IDX build\TOTAL.DATA >>build\log
rem
rem precompute indexed files for game help
rem
cscript /nologo bin\buildpre.js build\GAMEHELP build\GAMEHELP.IDX build\TOTAL.DATA pad >>build\log
rem
rem precompute indexed files for slideshows
rem
cscript /nologo bin\buildpre.js build\GAMEHELP build\GAMEHELP.IDX build\GAMEHELP.ALL build\GAMEHELP\STANDARD pad >>build\log
for %%q in (res\SS\*) do cscript /nologo bin\buildokvs.js %%q build\SS\%%~nxq >>build\log
cscript /nologo bin\buildss.js build\SS build\SLIDESHOW.IDX build\SLIDESHOW.ALL nul pad >>build\log
cscript /nologo bin\buildss.js build\SS build\SLIDESHOW.IDX build\TOTAL.DATA nul pad >>build\log
for %%q in (res\ATTRACT\*) do cscript /nologo bin\buildokvs.js %%q build\ATTRACT\%%~nxq >>build\log
cscript /nologo bin\buildss.js build\ATTRACT build\MINIATTRACT.IDX build\MINIATTRACT.ALL nul pad >>build\log
cscript /nologo bin\buildpre.js build\PRELAUNCH.INDEXED build\PRELAUNCH.IDX build\PRELAUNCH.ALL build\PRELAUNCH.INDEXED\STANDARD >>build\log
cscript /nologo bin\buildss.js build\ATTRACT build\MINIATTRACT.IDX build\TOTAL.DATA nul pad >>build\log
rem
rem precompute indexed files for graphic effects
rem
cscript /nologo bin\buildfx.js res\FX.CONF build\FX.IDX build\TOTAL.DATA build\FX.INDEXED >>build\log
cscript /nologo bin\buildfx.js res\DFX.CONF build\DFX.IDX build\TOTAL.DATA build\FX.INDEXED >>build\log
rem
rem precompute indexed files for HGR action screenshots
rem note: these can not be padded because they are compressed and the decompressor needs the exact size
rem
1>nul copy /y nul build\ACTIONHGR0
1>nul copy /y nul build\ACTIONHGR1
@ -93,17 +104,18 @@ for %%q in (res\ACTION.HGR\M* res\ACTION.HGR\N* res\ACTION.HGR\O* res\ACTION.HGR
for %%q in (res\ACTION.HGR\Q* res\ACTION.HGR\R* res\ACTION.HGR\S* res\ACTION.HGR\T*) do 1>nul >>build\ACTIONHGR4 echo %%q
for %%q in (res\ACTION.HGR\U* res\ACTION.HGR\V* res\ACTION.HGR\W* res\ACTION.HGR\X*) do 1>nul >>build\ACTIONHGR5 echo %%q
for %%q in (res\ACTION.HGR\Y* res\ACTION.HGR\Z*) do 1>nul >>build\ACTIONHGR6 echo %%q
cscript /nologo bin\buildss.js build\ACTIONHGR0* build\HGR0.IDX build\HGR.ALL nul >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR1* build\HGR1.IDX build\HGR.ALL build\HGR.ALL >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR2* build\HGR2.IDX build\HGR.ALL build\HGR.ALL >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR3* build\HGR3.IDX build\HGR.ALL build\HGR.ALL >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR4* build\HGR4.IDX build\HGR.ALL build\HGR.ALL >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR5* build\HGR5.IDX build\HGR.ALL build\HGR.ALL >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR6* build\HGR6.IDX build\HGR.ALL build\HGR.ALL >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR0* build\HGR0.IDX build\TOTAL.DATA nul >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR1* build\HGR1.IDX build\TOTAL.DATA build\TOTAL.DATA >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR2* build\HGR2.IDX build\TOTAL.DATA build\TOTAL.DATA >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR3* build\HGR3.IDX build\TOTAL.DATA build\TOTAL.DATA >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR4* build\HGR4.IDX build\TOTAL.DATA build\TOTAL.DATA >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR5* build\HGR5.IDX build\TOTAL.DATA build\TOTAL.DATA >>build\log
cscript /nologo bin\buildss.js build\ACTIONHGR6* build\HGR6.IDX build\TOTAL.DATA build\TOTAL.DATA >>build\log
rem
rem precompute indexed files for SHR artwork
rem note: these can not be padded because they are compressed and the decompressor needs the exact size
rem
cscript /nologo bin\buildss.js res\ARTWORK.SHR build\ARTWORK.IDX build\ARTWORK.ALL nul >>build\log
cscript /nologo bin\buildss.js res\ARTWORK.SHR build\ARTWORK.IDX build\TOTAL.DATA nul >>build\log
rem
rem create _FileInformation.txt files for subdirectories
rem
@ -117,6 +129,7 @@ cscript /nologo bin\buildfileinfo.js build\PRELAUNCH "06" "0106" >>build/log
rem
rem add everything to the disk
rem
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\TOTAL.DATA" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\TITLE" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\COVER" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\HELP" >>build\log
@ -127,17 +140,11 @@ rem
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\ATTRACT.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\FX.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\DFX.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\FX.ALL" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\GAMEHELP.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\GAMEHELP.ALL" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\SLIDESHOW.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\SLIDESHOW.ALL" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\MINIATTRACT.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\MINIATTRACT.ALL" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\PRELAUNCH.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\PRELAUNCH.ALL" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build/ARTWORK.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build/ARTWORK.ALL" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build/HGR0.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build/HGR1.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build/HGR2.IDX" >>build\log
@ -145,7 +152,6 @@ rem
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build/HGR4.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build/HGR5.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build/HGR6.IDX" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build/HGR.ALL" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\DECRUNCH" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\JOYSTICK" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\Finder.Data" >>build\log
@ -173,11 +179,6 @@ cscript /nologo bin\changebootloader.js "build\%DISK%" build\proboothd
goto :EOF
)
if "%1" equ "demo" (
for %%q in (src\demo\*) do %acme% %%q
goto :EOF
)
echo usage: %0 clean / asm / dsk
goto :EOF