Skip to content

Commit b0c4750

Browse files
committed
Initial commit
0 parents  commit b0c4750

File tree

263 files changed

+463464
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

263 files changed

+463464
-0
lines changed

.gitignore

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
CMDLINE
2+
INSTALL
3+
Makefile
4+
Makefile.in
5+
TAGS
6+
aclocal.m4
7+
autom4te.cache
8+
autotools
9+
bin
10+
config.hin
11+
config.log
12+
config.status
13+
configure
14+
lib
15+
obj
16+
rpm.spec
17+
stamp-h
18+
stamp-h.in
19+
stamp-h1
20+
tags
21+
\#*\#
22+
DOOM*.png
23+
HTIC*.png
24+
HEXEN*.png
25+
STRIFE*.png
26+
DOOM*.pcx
27+
HTIC*.pcx
28+
HEXEN*.pcx
29+
STRIFE*.pcx
30+
31+
# These are the default patterns globally ignored by Subversion:
32+
*.o
33+
*.lo
34+
*.la
35+
*.al
36+
.libs
37+
*.so
38+
*.so.[0-9]*
39+
*.a
40+
*.pyc
41+
*.pyo
42+
*.rej
43+
*~
44+
.#*
45+
.*.swp
46+
.DS_store
47+
48+
*.bc
49+
*.wasm
50+
doom.*
51+
*.log
52+
*.wad
53+
*.flac
54+
*.ogg
55+
*.mp3

AUTHORS

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
Simon Howard <[email protected]>
2+
James Haley <[email protected]>
3+
Samuel Villarreal <[email protected]>
4+
Fabian Greffrath <[email protected]>
5+
Jonathan Dowland <[email protected]>
6+
Alexey Khokholov <[email protected]>
7+
Viktor Lázár <[email protected]>

COPYING.md

+361
Large diffs are not rendered by default.

README.md

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# WebAssembly DOOM
2+
3+
DOOM® is a registered trademark of ZeniMax Media Inc. in the US and/or
4+
other countries. Id Software® is a registered trademark of ZeniMax Media
5+
Inc. in the US and/or other countries. WebAssembly DOOM is in no way affiliated
6+
with ZeniMax Media Inc. or id Software LLC and is not approved by ZeniMax
7+
Media Inc. or id Software.
8+
9+
Doom is © 1993-1996 Id Software, Inc.; Boom 2.02 is © 1999 id Software,
10+
Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty Halderman; PrBoom+ is
11+
© 1999 id Software, Chi Hoang, Lee Killough, Jim Flynn, Rand Phares, Ty
12+
Halderman, © 1999-2000 Jess Haas, Nicolas Kalkhof, Colin Phipps, Florian
13+
Schulze, © 2005-2006 Florian Schulze, Colin Phipps, Neil Stevens, Andrey
14+
Budko; Chocolate Doom is © 1993-1996 Id Software, Inc., © 2005 Simon
15+
Howard; Strawberry Doom is © 1993-1996 Id Software, Inc., © 2005 Simon
16+
Howard, © 2008-2010 GhostlyDeath; Crispy Doom is © 2014-2018 Fabian
17+
Greffrath.
18+
19+
SDL 2.0, SDL_mixer 2.0 and SDL_net 2.0 are © 1997-2016 Sam Lantinga.
20+
21+
Secret Rabbit Code (libsamplerate) is © 2002-2011 Erik de Castro Lopo;
22+
Libpng is © 1998-2014 Glenn Randers-Pehrson, © 1996-1997 Andreas Dilger, ©
23+
1995-1996 Guy Eric Schalnat, Group 42, Inc.; Zlib is © 1995-2013 Jean-loup
24+
Gailly and Mark Adler.
25+
26+
Emscripten is © 2010-2018 Emscripten authors, see [AUTHORS](https://raw.githubusercontent.com/emscripten-core/emscripten/incoming/AUTHORS) file.

build.sh

+234
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,234 @@
1+
#!/usr/bin/env bash
2+
3+
CC=emcc
4+
5+
if [[ $# -eq 0 ]]; then
6+
echo "Usage: $0 {libsamplerate|sdl_mixer|opl|chocolate|doom}"
7+
fi
8+
9+
build_libsamplerate() {
10+
echo "Building libsamplerate.bc..."
11+
(cd "$(dirname "$0")/libsamplerate" && $CC \
12+
src_sinc.c \
13+
src_zoh.c \
14+
src_linear.c \
15+
samplerate.c \
16+
-Oz \
17+
-Wall \
18+
-o libsamplerate.bc)
19+
}
20+
21+
build_sdl_mixer() {
22+
echo "Building sdl_mixer.bc..."
23+
(cd "$(dirname "$0")/sdl_mixer" && $CC \
24+
effect_position.c \
25+
effect_stereoreverse.c \
26+
effects_internal.c \
27+
mixer.c \
28+
music.c \
29+
-Oz \
30+
-Wall \
31+
-s USE_SDL=2 \
32+
-o sdl_mixer.bc)
33+
}
34+
35+
build_opl() {
36+
echo "Building opl.bc..."
37+
(cd "$(dirname "$0")/opl" && $CC \
38+
opl_queue.c \
39+
opl_sdl.c \
40+
opl.c \
41+
opl3.c \
42+
-I../src \
43+
-Oz \
44+
-Wall \
45+
-o opl.bc)
46+
}
47+
48+
build_system() {
49+
echo "Building system.bc..."
50+
(cd "$(dirname "$0")/src" && $CC \
51+
../opl/opl.bc \
52+
../sdl_mixer/sdl_mixer.bc \
53+
i_endoom.c \
54+
i_gif.c \
55+
i_input.c \
56+
i_joystick.c \
57+
i_main.c \
58+
i_oplmusic.c \
59+
i_sdlsound.c \
60+
i_sound.c \
61+
i_system.c \
62+
i_timer.c \
63+
i_txt.c \
64+
i_video.c \
65+
i_webmusic.c \
66+
sha1.c \
67+
tables.c \
68+
memio.c \
69+
midifile.c \
70+
mus2mid.c \
71+
d_event.c \
72+
d_iwad.c \
73+
d_loop.c \
74+
d_mode.c \
75+
m_argv.c \
76+
m_bbox.c \
77+
m_cheat.c \
78+
m_config.c \
79+
m_controls.c \
80+
m_fixed.c \
81+
m_misc.c \
82+
z_zone.c \
83+
v_diskicon.c \
84+
v_video.c \
85+
v_trans.c \
86+
w_checksum.c \
87+
w_file.c \
88+
w_file_stdc.c \
89+
w_main.c \
90+
w_merge.c \
91+
w_wad.c \
92+
deh_io.c \
93+
deh_main.c \
94+
deh_mapping.c \
95+
deh_str.c \
96+
deh_text.c \
97+
../gifenc/gifenc.c \
98+
-Oz \
99+
-Wall \
100+
-I. \
101+
-I../sdl_mixer \
102+
-I../libsamplerate \
103+
-I../opl \
104+
-I../gifenc \
105+
-s USE_SDL=2 \
106+
-s USE_LIBPNG=1 \
107+
-o system.bc)
108+
}
109+
110+
build_doom() {
111+
echo "Building doom.{js,wasm}..."
112+
(cd "$(dirname "$0")/src/doom" && $CC \
113+
../system.bc \
114+
doomdef.c \
115+
doomstat.c \
116+
dstrings.c \
117+
info.c \
118+
sounds.c \
119+
statdump.c \
120+
am_map.c \
121+
d_items.c \
122+
d_main.c \
123+
deh_ammo.c \
124+
deh_bexincl.c \
125+
deh_bexpars.c \
126+
deh_bexptr.c \
127+
deh_bexstr.c \
128+
deh_cheat.c \
129+
deh_doom.c \
130+
deh_frame.c \
131+
deh_misc.c \
132+
deh_ptr.c \
133+
deh_sound.c \
134+
deh_thing.c \
135+
deh_weapon.c \
136+
f_finale.c \
137+
f_wipe.c \
138+
g_game.c \
139+
hu_lib.c \
140+
hu_stuff.c \
141+
m_menu.c \
142+
m_random.c \
143+
p_bexptr.c \
144+
p_blockmap.c \
145+
p_ceilng.c \
146+
p_doors.c \
147+
p_enemy.c \
148+
p_extnodes.c \
149+
p_floor.c \
150+
p_inter.c \
151+
p_lights.c \
152+
p_map.c \
153+
p_maputl.c \
154+
p_mobj.c \
155+
p_plats.c \
156+
p_pspr.c \
157+
p_saveg.c \
158+
p_setup.c \
159+
p_sight.c \
160+
p_spec.c \
161+
p_switch.c \
162+
p_telept.c \
163+
p_tick.c \
164+
p_user.c \
165+
r_bmaps.c \
166+
r_bsp.c \
167+
r_data.c \
168+
r_draw.c \
169+
r_main.c \
170+
r_plane.c \
171+
r_segs.c \
172+
r_sky.c \
173+
r_things.c \
174+
s_sound.c \
175+
st_lib.c \
176+
st_stuff.c \
177+
wi_stuff.c \
178+
-Oz \
179+
-Wall \
180+
-I. \
181+
-I.. \
182+
-I../gifenc \
183+
-s WASM=1 \
184+
-s USE_SDL=2 \
185+
-s USE_LIBPNG=1 \
186+
-s MODULARIZE=1 \
187+
-s ASSERTIONS=0 \
188+
-s ALLOW_MEMORY_GROWTH=1 \
189+
-s NO_EXIT_RUNTIME=0 \
190+
-s EXTRA_EXPORTED_RUNTIME_METHODS=['FS'] \
191+
--no-heap-copy \
192+
-o ../../doom.js)
193+
}
194+
195+
for arg in $@; do
196+
case "$arg" in
197+
-libsamplerate)
198+
build_libsamplerate
199+
;;
200+
201+
-sdl_mixer)
202+
build_sdl_mixer
203+
;;
204+
205+
-opl)
206+
build_opl
207+
;;
208+
209+
-system)
210+
build_system
211+
;;
212+
213+
-doom)
214+
build_doom
215+
;;
216+
217+
-all)
218+
build_libsamplerate
219+
build_sdl_mixer
220+
build_opl
221+
build_system
222+
build_doom
223+
;;
224+
225+
-system_doom)
226+
build_system
227+
build_doom
228+
;;
229+
230+
*)
231+
echo "Usage: $0 {libsamplerate|sdl_mixer|opl|chocolate|doom}"
232+
;;
233+
esac
234+
done

0 commit comments

Comments
 (0)