This commit is contained in:
Peter Ferrie 2021-11-03 10:02:52 -07:00
parent 093abe294d
commit cf976b5984
3 changed files with 60 additions and 7 deletions

View File

@ -36,16 +36,19 @@ if (!a.fileexists(WScript.Arguments(1)) || a.getfile(WScript.Arguments(1)).datel
{ {
val = entries[i].indexOf("=") val = entries[i].indexOf("=")
name = ((val >= 0) ? entries[i].substr(val + 1) : entries[i]) name = ((val >= 0) ? entries[i].substr(val + 1) : entries[i])
pos = q.indexOf("," + name) + 1 bits = q.indexOf("," + name) + 1
name = q.substr(pos + name.length + 1) name = q.substr(bits + name.length + 1)
name = name.substr(0, name.indexOf("\n")) name = name.substr(0, name.indexOf("\n"))
source.writeline("!byte " + (entries[i].length - ((val >= 0) ? 1 : 0) + name.length + 4)) needsjoystick = q.substr(bits - 5, 1)
needs128k = q.substr(bits - 4, 1)
source.writeline("!byte " + (entries[i].length - ((val >= 0) ? 1 : 0) + name.length + 5))
source.writeline("!byte " + ((val >= 0) ? val : entries[i].length)) source.writeline("!byte " + ((val >= 0) ? val : entries[i].length))
source.writeline("!text \"" + ((val >= 0) ? entries[i].substr(0, val) : entries[i]) + "\"") 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("!byte " + ((val >= 0) ? (entries[i].length - (val + 1)) : 0))
source.writeline("!text \"" + ((val >= 0) ? (entries[i].substr(val + 1)) : "") + "\"") source.writeline("!text \"" + ((val >= 0) ? (entries[i].substr(val + 1)) : "") + "\"")
source.writeline("!byte " + name.length) source.writeline("!byte " + name.length)
source.writeline("!text \"" + name + "\"") source.writeline("!text \"" + name + "\"")
source.writeline("!byte " + ((needsjoystick * 128) + (Number(needs128k) * 64)))
} }
source.close() source.close()

52
bin/buildtitle.js Normal file
View File

@ -0,0 +1,52 @@
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])
bits = q.indexOf("," + name) + 1
name = q.substr(bits + name.length + 1)
name = name.substr(0, name.indexOf("\n"))
needsjoystick = q.substr(bits - 5, 1)
needs128k = q.substr(bits - 4, 1)
source.writeline("!byte " + (entries[i].length - ((val >= 0) ? 1 : 0) + 3))
source.writeline("!byte " + ((val >= 0) ? val : entries[i].length))
source.writeline("!text \"" + ((val >= 0) ? entries[i].substr(0, val) : entries[i]) + "\"")
source.writeline("!byte " + ((needsjoystick * 128) + (Number(needs128k) * 64)))
}
source.close()
new ActiveXObject("wscript.shell").run('cmd /c %acme% -o ' + WScript.Arguments(1) + ' build\\okvs.tmp', 0, 1)
}

View File

@ -46,7 +46,6 @@ rem
%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
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\GAMES.CONF" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\PREFS.CONF" >>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\CREDITS" >>build\log
%CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\HELPTEXT" >>build\log %CADIUS% ADDFILE "build\%DISK%" "/%VOLUME%/" "build\HELPTEXT" >>build\log
@ -134,12 +133,11 @@ cscript /nologo bin\converthelp.js res\HELPTEXT build\HELPTEXT >>build\log
cscript /nologo bin\converthelp.js res\CREDITS build\CREDITS >>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 for %%q in (res\GAMEHELP\*) do cscript /nologo bin\converthelp.js %%q build\GAMEHELP\%%~nxq >>build\log
rem 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 rem create a sorted list of game filenames, without metadata or display names
rem rem
cscript /nologo bin\makesorted.js cscript /nologo bin\makesorted.js
rem rem
rem create search indexes rem create search indexes: (game-requires-joystick) X (game-requires-128K)
rem rem
cscript /nologo bin\builddisplaynames.js cscript /nologo bin\builddisplaynames.js
cscript /nologo bin\buildsearch.js "00" build\SEARCH00.IDX cscript /nologo bin\buildsearch.js "00" build\SEARCH00.IDX
@ -166,7 +164,7 @@ for %%q in (res\SS\*) do (
if !_ss!==ACT ( if !_ss!==ACT (
cscript /nologo bin\buildaction.js %%q build\SS\%%~nxq >>build\log cscript /nologo bin\buildaction.js %%q build\SS\%%~nxq >>build\log
) else ( ) else (
cscript /nologo bin\buildokvs.js %%q build\SS\%%~nxq >>build\log cscript /nologo bin\buildtitle.js %%q build\SS\%%~nxq >>build\log
) )
) )
cscript /nologo bin\buildss.js build\SS build\SLIDESHOW.IDX build\TOTAL.DATA nul pad >>build\log cscript /nologo bin\buildss.js build\SS build\SLIDESHOW.IDX build\TOTAL.DATA nul pad >>build\log