From d361a5fb8f6f8993310df0143e2b37c29bb8bc0e Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 27 Oct 2021 21:10:19 -0700 Subject: [PATCH] sync --- bin/buildaction.js | 53 ++++++++++++++++++++++++++++++++ bin/checkdate.js | 2 ++ bin/{subst.js => converthelp.js} | 0 winmake.bat | 18 ++++++++--- 4 files changed, 69 insertions(+), 4 deletions(-) create mode 100644 bin/buildaction.js create mode 100644 bin/checkdate.js rename bin/{subst.js => converthelp.js} (100%) diff --git a/bin/buildaction.js b/bin/buildaction.js new file mode 100644 index 000000000..826f05860 --- /dev/null +++ b/bin/buildaction.js @@ -0,0 +1,53 @@ +a = new ActiveXObject("scripting.filesystemobject") + +if (!a.fileexists(WScript.Arguments(1)) || a.getfile(WScript.Arguments(1)).datelastmodified < a.getFile(WScript.Arguments(0)).datelastmodified) +{ + b = a.opentextfile(WScript.Arguments(0)) + + entries = [] + + while (!b.atendofstream) + { + c = b.readline() + d = c.indexOf("#") + + if (d >= 0) + { + c = c.substr(0, d) + } + + if (c.indexOf("[eof]") >= 0) + { + break + } + + if (c.length > 0) + { + entries.push(c) + } + } + + source = a.createtextfile("build\\okvs.tmp") + source.writeline("*=0") + source.writeline("!le16 " + entries.length + ", 0") + q = a.opentextfile("build\\DISPLAY.CONF").readall().replace(/\r\n/g, "\n") + + for (i = 0; i < entries.length; i++) + { + val = entries[i].indexOf("=") + name = ((val >= 0) ? entries[i].substr(val + 1) : entries[i]) + pos = q.indexOf("," + name) + 1 + name = q.substr(pos + name.length + 1) + name = name.substr(0, name.indexOf("\n")) + source.writeline("!byte " + (entries[i].length - ((val >= 0) ? 1 : 0) + name.length + 4)) + source.writeline("!byte " + ((val >= 0) ? val : entries[i].length)) + source.writeline("!text \"" + ((val >= 0) ? entries[i].substr(0, val) : entries[i]) + "\"") + source.writeline("!byte " + ((val >= 0) ? (entries[i].length - (val + 1)) : 0)) + source.writeline("!text \"" + ((val >= 0) ? (entries[i].substr(val + 1)) : "") + "\"") + source.writeline("!byte " + name.length) + source.writeline("!text \"" + name + "\"") + } + + source.close() + new ActiveXObject("wscript.shell").run('cmd /c %acme% -o ' + WScript.Arguments(1) + ' build\\okvs.tmp', 0, 1) +} diff --git a/bin/checkdate.js b/bin/checkdate.js new file mode 100644 index 000000000..4e85417c4 --- /dev/null +++ b/bin/checkdate.js @@ -0,0 +1,2 @@ +a = new ActiveXObject("scripting.filesystemobject") +WScript.quit(Math.abs(!a.fileexists(WScript.Arguments(0)) || a.getfile(WScript.Arguments(0)).datelastmodified < a.getFile(WScript.Arguments(1)).datelastmodified)) diff --git a/bin/subst.js b/bin/converthelp.js similarity index 100% rename from bin/subst.js rename to bin/converthelp.js diff --git a/winmake.bat b/winmake.bat index f493293cc..99536aeb4 100644 --- a/winmake.bat +++ b/winmake.bat @@ -120,6 +120,8 @@ goto :EOF :index call :md +call :asmfx +call :asmprelaunch rem rem precompute binary data structure for mega-attract mode configuration file rem @@ -128,9 +130,9 @@ rem 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 +cscript /nologo bin\converthelp.js res\HELPTEXT build\HELPTEXT >>build\log +cscript /nologo bin\converthelp.js res\CREDITS build\CREDITS >>build\log +for %%q in (res\GAMEHELP\*) do cscript /nologo bin\converthelp.js %%q build\GAMEHELP\%%~nxq >>build\log rem rem create distribution version of GAMES.CONF without comments or blank lines rem create a sorted list of game filenames, without metadata or display names @@ -158,7 +160,15 @@ cscript /nologo bin\buildpre.js build\GAMEHELP build\GAMEHELP.IDX build\TOTAL.DA rem rem precompute indexed files for slideshows rem -for %%q in (res\SS\*) do cscript /nologo bin\buildokvs.js %%q build\SS\%%~nxq >>build\log +for %%q in (res\SS\*) do ( + set _ss=%%~nxq + set _ss=!_ss:~0,3! + if !_ss!==ACT ( + cscript /nologo bin\buildaction.js %%q build\SS\%%~nxq >>build\log + ) else ( + cscript /nologo bin\buildokvs.js %%q build\SS\%%~nxq >>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\TOTAL.DATA nul pad >>build\log