restore [eof] for compatibility with helptext

This commit is contained in:
Peter Ferrie 2021-10-14 20:01:39 -07:00
parent 8c04fde996
commit 00c723412a
216 changed files with 271 additions and 310 deletions

View File

@ -1,67 +0,0 @@
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 = "res\\GAMEHELP\\"
f = a.createtextfile(WScript.Arguments(0))
f.write(entry = a.opentextfile(y + "STANDARD").readall().replace(/\r\n/g, "\n"))
help_off = entry.length
osize = help_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 = help_off
f.write(entry = a.opentextfile(y + entries[i]).readall().replace(/\r\n/g, "\n"))
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"
}
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))

View File

@ -35,8 +35,7 @@ while (!b.atendofstream)
entries.sort()
a.createtextfile("build\\games.lst").write(entries.toString().replace(/,/g, "\n"))
y = "build\\PRELAUNCH\\"
pre_off = a.getfile(y + "STANDARD").size
pre_off = a.getfile(WScript.Arguments(0) + "\\STANDARD").size
osize = pre_off
groups = "*=0\n" + "!le16 " + entries.length.toString() + ", 0\n"
@ -46,10 +45,10 @@ for (i = 0; i < entries.length; i++)
c = 0
size = osize
if (a.fileexists(y + entries[i]))
if (a.fileexists(WScript.Arguments(0) + "\\" + entries[i]))
{
c = pre_off
size = a.getfile(y + entries[i]).size
size = a.getfile(WScript.Arguments(0) + "\\" + entries[i]).size
pre_off += size
}

View File

@ -1,4 +1,4 @@
@echo off
setlocal enabledelayedexpansion
1>nul copy /y build\PRELAUNCH\STANDARD %1
for /f "tokens=*" %%a in (build\games.lst) do 1>nul copy /b /y %1+build\PRELAUNCH\%%a %1
1>nul copy /y %1\STANDARD %2
for /f "tokens=*" %%a in (build\games.lst) do 1>nul copy /b /y %2+%1\%%a %2

View File

@ -1,17 +0,0 @@
a = new ActiveXObject("scripting.filesystemobject")
b = WScript.Arguments(0).lastIndexOf('\\') + 1
c = WScript.Arguments(0).substr(0, b)
d = WScript.Arguments(0).substr(b)
if (d.substr(0, 2) == '*.')
{
d = d.substr(2)
}
for (b = new Enumerator(a.GetFolder(c).files); !b.atEnd(); b.moveNext())
{
if ((d == '*') || (d == b.item().name) || (d == a.getextensionname(b.item().name)))
{
e = a.opentextfile(c + b.item().name).readall()
e = e.replace(/\r\n/g, "\n")
a.createtextfile(c + b.item().name).write(e)
}
}

47
bin/subst.js Normal file
View File

@ -0,0 +1,47 @@
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)).readall().replace(/\r\n/g, "\n")
c = b.search(/\[eof\]/)
if (c > -1)
{
b = b.substr(0, c) + String.fromCharCode(0)
}
String.prototype.replaceWith = function(q)
{
return this.substr(0, c) + String.fromCharCode(q) + this.substr(c + 1)
}
for (c = 0; c < b.length; c++)
{
if (b.charAt(c) == '*')
{
b = b.replaceWith(16)
}
else if (b.charAt(c) == '~')
{
b = b.replaceWith(17)
}
else if (b.charAt(c) == '<')
{
b = b.replaceWith(8)
}
else if (b.charAt(c) == '>')
{
b = b.replaceWith(21)
}
else if (b.charAt(c) == '$')
{
b = b.replaceWith(14)
}
else if (b.charAt(c) == '%')
{
b = b.replaceWith(15)
}
}
a.createtextfile(WScript.Arguments(1)).write(b)
}

View File

@ -21,4 +21,4 @@ Ctrl-R * * * * * * * * * * * * * restart
(space bar skips intro)
[
[eof]

View File

@ -20,4 +20,4 @@ Tip: worms can only be eaten from behind
K / J* * * * * * * * * keyboard/joystick
Esc* * * * * * * * * * * * * * * * pause
[
[eof]

View File

@ -20,4 +20,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
Ctrl-D * * * * * * * * * * * * * * *demo
[
[eof]

View File

@ -21,4 +21,4 @@ Ctrl-X * * flip X Ctrl-Y* * * *flip Y
Ctrl-E * swap X/Y Ctrl-B*swap buttons
Ctrl-N * * * * *normal joystick settings
[
[eof]

View File

@ -22,4 +22,4 @@ Space* * * * * * * * * * * * * * * pause
M* * * * * * * * * * * * * *toggle music
Q* * * * * * * * * * * * * * * * restart
[
[eof]

View File

@ -18,4 +18,4 @@
S* * * * * * * * * * * * * * * * * sound
Esc* * * * * * * * * * * * * * * * pause
[
[eof]

View File

@ -18,4 +18,4 @@
P* * * * * * * * * * * * * * * * * pause
[
[eof]

View File

@ -17,4 +17,4 @@
A* * * * * * * * * * * * * * * * *advice
I* * * * * * * * * * * * *inquire status
[
[eof]

View File

@ -22,4 +22,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -21,4 +21,4 @@
K* * * * * * * * * * * * * * * *keyboard
P* * * * * * * * * * * * * * * *joystick
[
[eof]

View File

@ -22,4 +22,4 @@ Esc* * * * * * * * * * * * * * * * pause
Tips: Shoot X objects, avoid collisions
Short guided tour > http://a2.click/ankh
[
[eof]

View File

@ -17,5 +17,4 @@
T * * * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -15,4 +15,4 @@
< joystick to move >
button 0 to fire
[
[eof]

View File

@ -22,4 +22,4 @@ S* * * * *fill hole / knock through hole
Kill green butterfly with 2 level drop
Kill blue mask of death with 3 levels
[
[eof]

View File

@ -20,4 +20,4 @@ fire button F
Ctrl-S * * * *sound Esc* * * * *pause
Return * begin game Ctrl-R * end game
[
[eof]

View File

@ -20,4 +20,4 @@ Options screen * * * * *I J K M & Space
Ctrl-S * * * *sound Esc* * * * *pause
Return * begin game Ctrl-R * end game
[
[eof]

View File

@ -21,4 +21,4 @@ E* * * * drop mine D * * * * * *dig in
Space* * * * shoot Esc * * * * * pause
Ctrl-S * * * sound Ctrl-R* end mission
[
[eof]

View File

@ -17,4 +17,4 @@
Esc* * * * * * * * * * * * * * * * pause
S* * * * * * * * * * * * * * * * * sound
[
[eof]

View File

@ -17,4 +17,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-R * * * * * * * * * * * * * restart
Ctrl-S * * * * * * * * * * * * * * sound
[
[eof]

View File

@ -21,4 +21,4 @@
Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
[
[eof]

View File

@ -15,4 +15,4 @@
Space to teleport randomly
any other key to fire
[
[eof]

View File

@ -21,4 +21,4 @@ Ctrl-R * * * * * * * * * * * * * restart
Ctrl-D * * * * * * * * * * practice mode
Ctrl-H * * * * * * * * *high score table
[
[eof]

View File

@ -21,4 +21,4 @@ F* * * * * * *fight L * * * * * * lunge
G* * * * * * * *gun M * * * * *aim down
Space* * * * *shoot Esc * * * * * *help
[
[eof]

View File

@ -21,4 +21,4 @@
Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-S, -* * * * * toggle sound / effect
: from title * * * * * * * * * * * *demo
Esc from title or pause* * * *setup game
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-V * * * * * * * * * * * * * *volume
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -21,4 +21,4 @@ Destroy Penguin's computer, rescue Robin
drop / use an object, restart
Hints: Preserve food, duck bullets
[
[eof]

View File

@ -22,4 +22,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -21,4 +21,4 @@ S* * * * * * * * * * * * * * * * * sound
Ctrl-Q * * * * * * * * * * * * * restart
Ctrl-O * * * * * * * * * * * * * options
[
[eof]

View File

@ -16,4 +16,4 @@
Ctrl-S * * * * * * * * * * * * * * sound
Tab* * * * * * * * * * * * * * * restart
[
[eof]

View File

@ -22,4 +22,4 @@
R* * * * * * * * * * * * * *restart game
Esc* * * * * * * * * * * * * * * * *quit
[
[eof]

View File

@ -20,4 +20,4 @@
Esc* * * * * * * * * * * * * * * * pause
[
[eof]

View File

@ -21,4 +21,4 @@ Catch beers, ride elevators, drain kegs
200 bonus for blimp rope first time
bonuses for getting close to artesians
[
[eof]

View File

@ -21,4 +21,4 @@ Esc / Q* * * * * * * * * * * * * * *quit
R* * * * * * * * * * * * * * * * restart
O* * * * * * * * * * * * * * * * options
[
[eof]

View File

@ -18,4 +18,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-T * * * * * * * * * * * *title page
Ctrl-C * * * * * * * * * change hardware
Ctrl-Z * * * * * * * * clear high scores
[
[eof]

View File

@ -22,4 +22,4 @@ Space* * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -16,4 +16,4 @@
Esc* * * * * * * * * * * * * * * * pause
Return * * * * * * * * * * * * * restart
[
[eof]

View File

@ -20,4 +20,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -20,4 +20,4 @@ Space* * * * * * * * * * * * * * * *fire
Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
[
[eof]

View File

@ -17,4 +17,4 @@ Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
Esc* * * * * * * * * new life (if stuck)
[
[eof]

View File

@ -17,4 +17,4 @@ Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
Esc* * * * * * * * * new life (if stuck)
[
[eof]

View File

@ -18,4 +18,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -20,4 +20,4 @@ Ctrl-Q * * * * * * * * * * *quit to menu
"MAY ALL YOUR SYNC BYTES BE INVALID"
[
[eof]

View File

@ -17,4 +17,4 @@
1 & 2* * * * * * * * * * * * * * players
Space* * * * * * * * * * * * * * * pause
[
[eof]

View File

@ -22,4 +22,4 @@ Patty drops further if enemies are on it
Throw pepper at enemies to freeze them
Collect treats for more pepper
[
[eof]

View File

@ -17,4 +17,4 @@ Trap enemies in bubbles, then burst them
Esc* * * * * * * * * * * * * * * * pause
[
[eof]

View File

@ -20,4 +20,4 @@ Esc* * * * * * * * * * * * * * * * pause
K* * * * * * * * * * * * * * * *keyboard
S* * * * * * * * * * * * * * * * * sound
[
[eof]

View File

@ -18,4 +18,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -19,4 +19,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
[
[eof]

View File

@ -21,4 +21,4 @@ Space* *search body F * * * * first aid
B* * * get/put bomb R * * * *reset bomb
Return * *inventory Esc * * * save/quit
[
[eof]

View File

@ -19,4 +19,4 @@
Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * *toggle sound
[
[eof]

View File

@ -22,4 +22,4 @@ D* * * * * * * * * * * * * * define keys
Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
[
[eof]

View File

@ -16,4 +16,4 @@
Esc* * * * * * * * * * * * * * * * pause
[
[eof]

View File

@ -11,4 +11,4 @@
joystick to move
button 0 to fire
[
[eof]

View File

@ -17,4 +17,4 @@
Esc* * * * * * * * * * * * * * * * pause
Return * * * * * * * * * * * * * restart
[
[eof]

View File

@ -22,4 +22,4 @@ T* * * * * * * * * * * * * * * time left
Doomsday Codes have been patched out
You're welcome :)
[
[eof]

View File

@ -18,4 +18,4 @@
Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * save game
[
[eof]

View File

@ -21,4 +21,4 @@ Ctrl-S * * * * * * * * * * *toggle sound
Ctrl-V * * * * * * * * * reverse up/down
Ctrl-A * * * * * * * *reverse left/right
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-K / Ctrl-J* * * keyboard / joystick
Ctrl-X / Ctrl-Y* * * *flip joystick axis
Return * * * * * * * * *show high scores
[
[eof]

View File

@ -20,4 +20,4 @@ vertically, horizontally, or diagonally
Esc* * * * * * * * * * * * * * * * pause
Q* * * * * * * * * * * * * * * * * *quit
[
[eof]

View File

@ -22,4 +22,4 @@ button 0 fires * button 1 throws grenade
Esc* * * * * * * * * * * * * * * * pause
S* * * * * * * * * * * * * * * * * sound
[
[eof]

View File

@ -22,4 +22,4 @@ Button 0 at title screen to use joystick
Esc* * * * * * * * * * * * * * * * pause
S* * * * * * * * * * * * * * * * * sound
[
[eof]

View File

@ -14,4 +14,4 @@
I
move J K move
M
[
[eof]

View File

@ -22,4 +22,4 @@
Esc* * * * * * * * * * * * * * * * pause
[
[eof]

View File

@ -15,4 +15,4 @@
P* * * * * * * * * * * * * * * * *pause
[
[eof]

View File

@ -11,4 +11,4 @@
joystick to move
button 0 to fire
[
[eof]

View File

@ -22,4 +22,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
(Speed 7 is slow)
[
[eof]

View File

@ -21,4 +21,4 @@ S* * * * * * * * * * * * * * * * * sound
Ctrl-Q * * * * * * * * * * * * * restart
Ctrl-O * * * * * * * * * * * * * options
[
[eof]

View File

@ -18,4 +18,4 @@
Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
[
[eof]

View File

@ -20,4 +20,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-Q * * * * * * * * * * * * * restart
Ctrl-O * * * * * * * * * * * * * * *quit
[
[eof]

View File

@ -22,4 +22,4 @@ U* * * * * * * * * use contents of chest
T* * * * * * * throw grenade towards aim
Return * *inventory Esc * * * save/quit
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
Ctrl-F * * * * * * show financial status
[
[eof]

View File

@ -22,4 +22,4 @@ U* * * * * * * * * use contents of chest
T* * * * * * * throw grenade towards aim
Return * *inventory Esc * * * save/quit
[
[eof]

View File

@ -22,4 +22,4 @@ S* * * * * * * * * * * * *toggle shields
B* * * * * * * * * * * * * base approach
Space* * * * * * * *cancel base approach
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-C * * * * * * * * * * * define keys
Ctrl-K, Ctrl-P * * * keyboard / joystick
H, V * * * reverse horizontal / vertical
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-S * * * * * * * * * * *toggle sound
Ctrl-C * * * * *toggle keyboard/joystick
Ctrl-Q * * * * * * * * * * * * * * *quit
[
[eof]

View File

@ -22,4 +22,4 @@ Q* * * * * * * * * * * * * * * * * *demo
Ctrl-R * * * * * * * * * * * * * restart
Ctrl-V * * * * * * * * * * * * * version
[
[eof]

View File

@ -19,4 +19,4 @@ Esc* * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * sound
Ctrl-Q * * * * * * * * * * * *end game
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
Ctrl-M * * * * * * * * * * * * * restart
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * * * * restart
Ctrl-M * * * * * * * * * * * * * restart
[
[eof]

View File

@ -21,4 +21,4 @@ K* * * * * * * * * * * * * * * * * brake
1 2 3 4* * * * * * * * * * switch screen
Esc* * * * * * * * * * * * * * * * pause
[
[eof]

View File

@ -21,4 +21,4 @@ Esc* * * * * * * * * * * * * * * * pause
Ctrl-S * * * * * * * * * * * * * * sound
Ctrl-R * * * * * * * * * * *restart game
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-E * * * * *enable pause during game
Ctrl-R * * * * * * * * * * * * * restart
Ctrl-I * * * * * * * * * * * * * options
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-S * * * * * * * * * * *toggle sound
Ctrl-J * * * * * * * * * select joystick
Ctrl-K * * * * * * * * * select keyboard
[
[eof]

View File

@ -17,4 +17,4 @@ Space* * * * * * * * * * * * * * * pause
S* * * * * * * * * * * * * * * * * sound
Return * * * * * * * * * * * * * restart
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-V * * * * * * * * * * * * * *volume
Ctrl-R * * * * * * * * * * * * * restart
Ctrl-K / Ctrl-J* * * keyboard / joystick
[
[eof]

View File

@ -22,4 +22,4 @@ Ctrl-R * * * * * * * * * * * flip Y axis
Tip: dung beetles follow red dot trail
[
[eof]

View File

@ -17,4 +17,4 @@
Esc* * * * * * * * * * * * * * * * pause
[
[eof]

View File

@ -22,4 +22,4 @@ S* * * * * * * score table & key summary
Tip: Forward aliens become eggs & evolve
Evolved aliens are worth more points
[
[eof]

View File

@ -22,4 +22,4 @@ button 0+1 or space * * * * * * * *fire
Esc* * * * * * * * * * * * * * * * pause
S* * * * * * * * * * * * * * * * * sound
[
[eof]

View File

@ -18,4 +18,4 @@ Esc / button 1 * * * *protective shield
Protective shield lasts 4 seconds but
does not operate again for 5 seconds.
[
[eof]

View File

@ -20,4 +20,4 @@
Button 0 / Return* * * * * * * * pick up
Button 1 / Space * * * * * * * * * *drop
[
[eof]

View File

@ -21,4 +21,4 @@ Esc* * * * * * * * * * * * * * * * pause
t (while paused) * * * *secret text mode
T* * * * * * * * *restore graphical mode
[
[eof]

Some files were not shown because too many files have changed in this diff Show More