From 6bf7a1341a38bf5e93eee2851a2142ac035027d6 Mon Sep 17 00:00:00 2001 From: Peter Ferrie Date: Wed, 13 Oct 2021 17:37:41 -0700 Subject: [PATCH] makefile sync --- bin/buildhelp.js | 6 ++--- bin/buildpre.js | 61 +++++++++++++++++++++++++++++++++++++++++++++ bin/buildpreall.bat | 4 +++ winmake.bat | 8 +++--- 4 files changed, 70 insertions(+), 9 deletions(-) create mode 100644 bin/buildpre.js create mode 100644 bin/buildpreall.bat diff --git a/bin/buildhelp.js b/bin/buildhelp.js index a92f65a65..c05df9c77 100644 --- a/bin/buildhelp.js +++ b/bin/buildhelp.js @@ -41,9 +41,8 @@ help_off = entry.length osize = help_off groups = "*=0\n" + "!le16 " + entries.length.toString() + ", 0\n" -i = 0 -while (i < entries.length) +for (i = 0; i < entries.length; i++) { c = 0 size = osize @@ -52,15 +51,14 @@ while (i < entries.length) { c = help_off f.write(entry = a.opentextfile(y + entries[i]).readall().replace(/\r\n/g, "\n")) - help_off += entry.length size = entry.length + help_off += size } groups += "!byte " + (1 + 1 + entries[i].length + 5).toString() + "\n" + "!byte " + entries[i].length + "\n" + "!text \"" + entries[i] + "\"\n" + "!be24 " + c + "\n" // if offset+size does not cross a block boundary, use the size // otherwise adjust size until it ends at the next block boundary to avoid a partial copy on the last block groups += "!le16 " + ((Math.floor(c / 512) == Math.floor((c + size) / 512)) ? size : (((c + size + 511) & -512) - c)).toString() + "\n" - ++i } f = a.createtextfile(WScript.Arguments(1)) diff --git a/bin/buildpre.js b/bin/buildpre.js new file mode 100644 index 000000000..8e7c7538d --- /dev/null +++ b/bin/buildpre.js @@ -0,0 +1,61 @@ +a = new ActiveXObject("scripting.filesystemobject") +b = a.opentextfile("res\\GAMES.CONF") + +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.sort() +y = "build\\PRELAUNCH\\" +pre_off = a.getfile(y + "STANDARD").size +osize = pre_off + +groups = "*=0\n" + "!le16 " + entries.length.toString() + ", 0\n" + +for (i = 0; i < entries.length; i++) +{ + c = 0 + size = osize + + if (a.fileexists(y + entries[i])) + { + c = pre_off + size = a.getfile(y + entries[i]).size + pre_off += size + } + + groups += "!byte " + (1 + 1 + entries[i].length + 5).toString() + "\n" + "!byte " + entries[i].length.toString() + "\n" + "!text \"" + entries[i] + "\"\n" + "!be24 " + c + "\n" + "!le16 " + size + "\n" +} + +f = a.createtextfile(WScript.Arguments(1)) +f.write(groups) +f.close() +new ActiveXObject("wscript.shell").run('cmd /c %acme% -o ' + WScript.Arguments(2) + " " + WScript.Arguments(1)) diff --git a/bin/buildpreall.bat b/bin/buildpreall.bat new file mode 100644 index 000000000..3d7dd1582 --- /dev/null +++ b/bin/buildpreall.bat @@ -0,0 +1,4 @@ +@echo off +1>nul copy /y %1\STANDARD %2 +rem requires sorted file-system +for %%a in (%1\*) do if %%a neq STANDARD 1>nul copy /b /y %2+%%a %2 diff --git a/winmake.bat b/winmake.bat index d847a57d8..5b3c4bb20 100644 --- a/winmake.bat +++ b/winmake.bat @@ -48,18 +48,20 @@ call :compress %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\LAUNCHER.SYSTEM" >>build\log cscript /nologo bin\rsync.js "res\PREFS.CONF" "build\" >>build\log cscript /nologo bin\padto.js 512 build\PREFS.CONF -cscript /nologo bin\buildhelp.js "build\GAMEHELP.ALL" "build\help.inc" "build\GAMEHELP.IDX" >>build\log cscript /nologo bin\buildokvs.js "res\ATTRACT.CONF" "build\ATTRACT.IDX" >>build\log call bin\buildfxful.bat res\FX.CONF "build\FX.ALL" >>build\log call bin\buildfxful.bat res\DFX.CONF "build\DFX.ALL" >>build\log cscript /nologo bin\buildfx.js "res\FX.CONF" "build\fx.inc" "build\FX.IDX" >>build\log cscript /nologo bin\buildfx.js "res\DFX.CONF" "build\dfx.inc" "build\DFX.IDX" >>build\log +cscript /nologo bin\buildhelp.js "build\GAMEHELP.ALL" "build\help.inc" "build\GAMEHELP.IDX" >>build\log for %%q in (res\SS\*) do cscript /nologo bin\buildokvs.js "%%q" "build\SS\%%~nxq" >>build\log call bin\buildssall.bat build\SS build\SLIDESHOW.ALL >>build\log cscript /nologo bin\buildss.js "build\SS" "build\ss.inc" "build\SLIDESHOW.IDX" >>build\log for %%q in (res\ATTRACT\*) do cscript /nologo bin\buildokvs.js "%%q" "build\ATTRACT\%%~nxq" >>build\log call bin\buildssall.bat build\ATTRACT build\MINIATTRACT.ALL>>build\log cscript /nologo bin\buildss.js "build\ATTRACT" "build\attract.inc" "build\MINIATTRACT.IDX" >>build\log +call bin\buildpreall.bat build\PRELAUNCH build\PRELAUNCH.ALL>>build\log +cscript /nologo bin\buildpre.js "build\PRELAUNCH" "build\prelaunch.inc" "build\PRELAUNCH.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 @@ -107,8 +109,6 @@ for %%q in (res\dsk\*.po) do %CADIUS% EXTRACTVOLUME "%%q" build\X\ >>build\log 1>nul 2>nul del /s build\X\.DS_Store build\X\PRODOS build\X\LOADER.SYSTEM %CADIUS% CREATEFOLDER "build\%DISK%" "/%VOLUME%/X/" >>build\log %CADIUS% ADDFOLDER "build\%DISK%" "/%VOLUME%/X" "build\X" >>build\log -cscript /nologo bin\buildfileinfo.js build\PRELAUNCH "06" "0106" >>build\log -%CADIUS% ADDFOLDER "build\%DISK%" "/%VOLUME%/PRELAUNCH" "build\PRELAUNCH" >>build\log cscript /nologo bin\changebootloader.js "build\%DISK%" build\proboothd goto :EOF ) @@ -153,8 +153,6 @@ for %%q in (src\prelaunch\*.a) do ( set _to=!_to:~0,1! if !_to!==t %ACME% %%q ) -for %%q in (res\title.hgr\*) do if not exist build\PRELAUNCH\%%~nxq 1>nul copy build\PRELAUNCH\STANDARD build\PRELAUNCH\%%~nxq -for %%q in (res\title.dhgr\*) do if not exist build\PRELAUNCH\%%~nxq 1>nul copy build\PRELAUNCH\STANDARD build\PRELAUNCH\%%~nxq goto :EOF :asmproboot