From f2b769a251be1391b531c58819a806bdda5604aa Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Fri, 12 Nov 2021 22:07:42 -0800 Subject: [PATCH] sync --- bin/addfile.js | 5 +++++ winmake.bat | 30 ++++++++++++++++++++---------- 2 files changed, 25 insertions(+), 10 deletions(-) create mode 100644 bin/addfile.js diff --git a/bin/addfile.js b/bin/addfile.js new file mode 100644 index 000000000..68df94ff3 --- /dev/null +++ b/bin/addfile.js @@ -0,0 +1,5 @@ +a=new ActiveXObject("scripting.filesystemobject") +offset=a.getfile("BUILD\\TOTAL.IDX").size +new ActiveXObject("wscript.shell").run('cmd /c copy /b /y BUILD\\TOTAL.IDX + ' + WScript.Arguments(0) + ' BUILD\\TOTAL.IDX', 0, 1) +size=a.getfile(WScript.Arguments(0)).size +a.createtextfile(WScript.Arguments(1)).write(";\n; Index record for " + WScript.Arguments(0).replace(/\\/, "/") + "\n;\n; This file is automatically generated\n;\n !byte 0\n !be24 " + " ".substr(0, 8 - offset.toString().length) + offset + "\n !le16 " + " ".substr(0, 8 - size.toString().length) + size + "\n") diff --git a/winmake.bat b/winmake.bat index 240ecb3ff..00aeae534 100644 --- a/winmake.bat +++ b/winmake.bat @@ -44,13 +44,13 @@ rem add everything to the disk rem echo|set/p="adding files..." %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\TOTAL.DATA" >>build\log +%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\TOTAL.IDX" >>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 %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\PREFS.CONF" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\CREDITS" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\HELPTEXT" >>build\log -%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\ATTRACT.IDX" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\SEARCH00.IDX" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\SEARCH01.IDX" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\SEARCH10.IDX" >>build\log @@ -59,13 +59,6 @@ echo|set/p="adding files..." %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\CACHE01.IDX" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\CACHE10.IDX" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\CACHE11.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\GAMEHELP.IDX" >>build\log -%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\SLIDESHOW.IDX" >>build\log -%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\MINIATTRACT.IDX" >>build\log -%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\PRELAUNCH.IDX" >>build\log -%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build/ARTWORK.IDX" >>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 @@ -196,7 +189,7 @@ rem rem precompute indexed files for HGR & DHGR action screenshots rem note: these can not be padded because they are compressed and the decompressor needs the exact size rem -echo|set/p="indexing (D)HGR action..." +echo|set/p="indexing (d)hgr action..." 1>nul copy /y nul build\ACTIONHGR0 1>nul copy /y nul build\ACTIONHGR1 1>nul copy /y nul build\ACTIONHGR2 @@ -225,7 +218,7 @@ echo done rem precompute indexed files for GR action screenshots rem note: these can be padded because they are not compressed rem -echo|set/p="indexing GR action..." +echo|set/p="indexing gr action..." 1>nul copy /y nul build\ACTIONGR for %%q in (res\ACTION.GR\*) do 1>nul >>build\ACTIONGR echo %%q cscript /nologo bin\buildss.js build\ACTIONGR* build\GR.IDX build\TOTAL.DATA build\TOTAL.DATA pad >>build\log @@ -237,6 +230,23 @@ rem echo|set/p="indexing shr..." cscript /nologo bin\buildss.js res\ARTWORK.SHR build\ARTWORK.IDX build\TOTAL.DATA nul >>build\log echo done +rem +rem add IDX files to the combined index file and generate +rem the index records that callers use to reference them +rem +echo|set/p="preparing index file..." +1>nul copy /y nul build\TOTAL.IDX +cscript /nologo bin\addfile.js build\PRELAUNCH.IDX src\index\prelaunch.idx.a +cscript /nologo bin\addfile.js build\ATTRACT.IDX src\index\attract.idx.a +cscript /nologo bin\addfile.js build\FX.IDX src\index\fx.idx.a +cscript /nologo bin\addfile.js build\DFX.IDX src\index\dfx.idx.a +cscript /nologo bin\addfile.js build\GAMEHELP.IDX src\index\gamehelp.idx.a +cscript /nologo bin\addfile.js build\SLIDESHOW.IDX src\index\slideshow.idx.a +cscript /nologo bin\addfile.js build\MINIATTRACT.IDX src\index\miniattract.idx.a +cscript /nologo bin\addfile.js build\DHGR.IDX src\index\dhgr.idx.a +cscript /nologo bin\addfile.js build\GR.IDX src\index\gr.idx.a +cscript /nologo bin\addfile.js build\ARTWORK.IDX src\index\artwork.idx.a +echo done goto :EOF :md