makefile sync

This commit is contained in:
Peter Ferrie 2021-10-13 17:37:41 -07:00
parent afebdec78b
commit 6bf7a1341a
4 changed files with 70 additions and 9 deletions

View File

@ -41,9 +41,8 @@ help_off = entry.length
osize = help_off osize = help_off
groups = "*=0\n" + "!le16 " + entries.length.toString() + ", 0\n" groups = "*=0\n" + "!le16 " + entries.length.toString() + ", 0\n"
i = 0
while (i < entries.length) for (i = 0; i < entries.length; i++)
{ {
c = 0 c = 0
size = osize size = osize
@ -52,15 +51,14 @@ while (i < entries.length)
{ {
c = help_off c = help_off
f.write(entry = a.opentextfile(y + entries[i]).readall().replace(/\r\n/g, "\n")) f.write(entry = a.opentextfile(y + entries[i]).readall().replace(/\r\n/g, "\n"))
help_off += entry.length
size = 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" 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 // 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 // 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" 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)) f = a.createtextfile(WScript.Arguments(1))

61
bin/buildpre.js Normal file
View File

@ -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))

4
bin/buildpreall.bat Normal file
View File

@ -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

View File

@ -48,18 +48,20 @@ call :compress
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\LAUNCHER.SYSTEM" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\LAUNCHER.SYSTEM" >>build\log
cscript /nologo bin\rsync.js "res\PREFS.CONF" "build\" >>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\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 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\FX.CONF "build\FX.ALL" >>build\log
call bin\buildfxful.bat res\DFX.CONF "build\DFX.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\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\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 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 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 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 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 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 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\TITLE" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "res\COVER" >>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%/" "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 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% CREATEFOLDER "build\%DISK%" "/%VOLUME%/X/" >>build\log
%CADIUS% ADDFOLDER "build\%DISK%" "/%VOLUME%/X" "build\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 cscript /nologo bin\changebootloader.js "build\%DISK%" build\proboothd
goto :EOF goto :EOF
) )
@ -153,8 +153,6 @@ for %%q in (src\prelaunch\*.a) do (
set _to=!_to:~0,1! set _to=!_to:~0,1!
if !_to!==t %ACME% %%q 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 goto :EOF
:asmproboot :asmproboot