Full Code of maximevince/fbDOOM for AI

master 17280163bc95 cached
215 files
1.8 MB
603.3k tokens
1477 symbols
1 requests
Download .txt
Showing preview only (1,888K chars total). Download the full file or copy to clipboard to get everything.
Repository: maximevince/fbDOOM
Branch: master
Commit: 17280163bc95
Files: 215
Total size: 1.8 MB

Directory structure:
gitextract_f8lk69kj/

├── README.TXT
├── fbdoom/
│   ├── Makefile
│   ├── am_map.c
│   ├── am_map.h
│   ├── config.h
│   ├── d_englsh.h
│   ├── d_event.c
│   ├── d_event.h
│   ├── d_items.c
│   ├── d_items.h
│   ├── d_iwad.c
│   ├── d_iwad.h
│   ├── d_loop.c
│   ├── d_loop.h
│   ├── d_main.c
│   ├── d_main.h
│   ├── d_mode.c
│   ├── d_mode.h
│   ├── d_net.c
│   ├── d_player.h
│   ├── d_textur.h
│   ├── d_think.h
│   ├── d_ticcmd.h
│   ├── deh_main.h
│   ├── deh_misc.h
│   ├── deh_str.h
│   ├── doom.h
│   ├── doomdata.h
│   ├── doomdef.c
│   ├── doomdef.h
│   ├── doomfeatures.h
│   ├── doomkeys.h
│   ├── doomstat.c
│   ├── doomstat.h
│   ├── doomtype.h
│   ├── dstrings.c
│   ├── dstrings.h
│   ├── dummy.c
│   ├── f_finale.c
│   ├── f_finale.h
│   ├── f_wipe.c
│   ├── f_wipe.h
│   ├── g_game.c
│   ├── g_game.h
│   ├── gusconf.c
│   ├── gusconf.h
│   ├── hu_lib.c
│   ├── hu_lib.h
│   ├── hu_stuff.c
│   ├── hu_stuff.h
│   ├── i_cdmus.c
│   ├── i_cdmus.h
│   ├── i_endoom.c
│   ├── i_endoom.h
│   ├── i_input_sdl.c
│   ├── i_input_tty.c
│   ├── i_input_tty.h
│   ├── i_joystick.c
│   ├── i_joystick.h
│   ├── i_main.c
│   ├── i_oplmusic.c
│   ├── i_pcsound.c
│   ├── i_scale.c
│   ├── i_scale.h
│   ├── i_sdlmusic.c
│   ├── i_sdlsound.c
│   ├── i_sound.c
│   ├── i_sound.h
│   ├── i_sound_dummy.c
│   ├── i_swap.h
│   ├── i_system.c
│   ├── i_system.h
│   ├── i_timer.c
│   ├── i_timer.h
│   ├── i_video.c
│   ├── i_video.h
│   ├── i_video_fbdev.c
│   ├── icon.c
│   ├── info.c
│   ├── info.h
│   ├── m_argv.c
│   ├── m_argv.h
│   ├── m_bbox.c
│   ├── m_bbox.h
│   ├── m_cheat.c
│   ├── m_cheat.h
│   ├── m_config.c
│   ├── m_config.h
│   ├── m_controls.c
│   ├── m_controls.h
│   ├── m_fixed.c
│   ├── m_fixed.h
│   ├── m_menu.c
│   ├── m_menu.h
│   ├── m_misc.c
│   ├── m_misc.h
│   ├── m_random.c
│   ├── m_random.h
│   ├── memio.c
│   ├── memio.h
│   ├── net_client.h
│   ├── net_dedicated.h
│   ├── net_defs.h
│   ├── net_gui.h
│   ├── net_io.h
│   ├── net_loop.h
│   ├── net_packet.h
│   ├── net_query.h
│   ├── net_sdl.h
│   ├── net_server.h
│   ├── p_ceilng.c
│   ├── p_doors.c
│   ├── p_enemy.c
│   ├── p_floor.c
│   ├── p_inter.c
│   ├── p_inter.h
│   ├── p_lights.c
│   ├── p_local.h
│   ├── p_map.c
│   ├── p_maputl.c
│   ├── p_mobj.c
│   ├── p_mobj.h
│   ├── p_plats.c
│   ├── p_pspr.c
│   ├── p_pspr.h
│   ├── p_saveg.c
│   ├── p_saveg.h
│   ├── p_setup.c
│   ├── p_setup.h
│   ├── p_sight.c
│   ├── p_spec.c
│   ├── p_spec.h
│   ├── p_switch.c
│   ├── p_telept.c
│   ├── p_tick.c
│   ├── p_tick.h
│   ├── p_user.c
│   ├── r_bsp.c
│   ├── r_bsp.h
│   ├── r_data.c
│   ├── r_data.h
│   ├── r_defs.h
│   ├── r_draw.c
│   ├── r_draw.h
│   ├── r_local.h
│   ├── r_main.c
│   ├── r_main.h
│   ├── r_plane.c
│   ├── r_plane.h
│   ├── r_segs.c
│   ├── r_segs.h
│   ├── r_sky.c
│   ├── r_sky.h
│   ├── r_state.h
│   ├── r_things.c
│   ├── r_things.h
│   ├── s_sound.c
│   ├── s_sound.h
│   ├── sha1.c
│   ├── sha1.h
│   ├── sounds.c
│   ├── sounds.h
│   ├── st_lib.c
│   ├── st_lib.h
│   ├── st_stuff.c
│   ├── st_stuff.h
│   ├── statdump.c
│   ├── statdump.h
│   ├── stubs.c
│   ├── tables.c
│   ├── tables.h
│   ├── v_patch.h
│   ├── v_video.c
│   ├── v_video.h
│   ├── w_checksum.c
│   ├── w_checksum.h
│   ├── w_file.c
│   ├── w_file.h
│   ├── w_file_stdc.c
│   ├── w_file_stdc_unbuffered.c
│   ├── w_main.c
│   ├── w_main.h
│   ├── w_merge.h
│   ├── w_wad.c
│   ├── w_wad.h
│   ├── wi_stuff.c
│   ├── wi_stuff.h
│   ├── z_zone.c
│   └── z_zone.h
├── ipx/
│   ├── DOOMNET.C
│   ├── DOOMNET.H
│   ├── IPXNET.C
│   ├── IPXNET.H
│   ├── IPXSETUP.C
│   ├── IPXSTR.H
│   ├── IPX_FRCH.H
│   └── README
├── sersrc/
│   ├── DOOMNET.C
│   ├── DOOMNET.H
│   ├── PORT.C
│   ├── README.TXT
│   ├── SERSETUP.C
│   ├── SERSETUP.H
│   ├── SERSTR.H
│   └── SER_FRCH.H
└── sndserv/
    ├── Makefile
    ├── README.sndserv
    ├── linux.c
    ├── sounds.c
    ├── sounds.h
    ├── soundsrv.c
    ├── soundsrv.h
    ├── soundst.h
    ├── wadread.c
    └── wadread.h

================================================
FILE CONTENTS
================================================

================================================
FILE: README.TXT
================================================
================
= fbDOOM =
================

Adaptation of the original DOOM
to be easily portable to framebuffer devices with minimal depenencies.
Runs on:
* Plain desktop Linux framebuffer,
* Siglent SSA 3021X Spectrum Analyzer,
* Frosted OS

To build (example):
* cd fbdoom
* make CROSS_COMPILE=arm-linux-gnueabihf-


Original readme
===============

Here it is, at long last.  The DOOM source code is released for your
non-profit use.  You still need real DOOM data to work with this code.
If you don't actually own a real copy of one of the DOOMs, you should
still be able to find them at software stores.

Many thanks to Bernd Kreimeier for taking the time to clean up the
project and make sure that it actually works.  Projects tends to rot if
you leave it alone for a few years, and it takes effort for someone to
deal with it again.

The bad news:  this code only compiles and runs on linux.  We couldn't
release the dos code because of a copyrighted sound library we used
(wow, was that a mistake -- I write my own sound code now), and I
honestly don't even know what happened to the port that microsoft did
to windows.

Still, the code is quite portable, and it should be straightforward to
bring it up on just about any platform.

I wrote this code a long, long time ago, and there are plenty of things
that seem downright silly in retrospect (using polar coordinates for
clipping comes to mind), but overall it should still be a usefull base
to experiment and build on.

The basic rendering concept -- horizontal and vertical lines of constant
Z with fixed light shading per band was dead-on, but the implementation
could be improved dramatically from the original code if it were
revisited.  The way the rendering proceded from walls to floors to
sprites could be collapsed into a single front-to-back walk of the bsp
tree to collect information, then draw all the contents of a subsector
on the way back up the tree.  It requires treating floors and ceilings
as polygons, rather than just the gaps between walls, and it requires
clipping sprite billboards into subsector fragments, but it would be
The Right Thing.

The movement and line of sight checking against the lines is one of the
bigger misses that I look back on.  It is messy code that had some
failure cases, and there was a vastly simpler (and faster) solution
sitting in front of my face.  I used the BSP tree for rendering things,
but I didn't realize at the time that it could also be used for
environment testing.  Replacing the line of sight test with a bsp line
clip would be pretty easy.  Sweeping volumes for movement gets a bit
tougher, and touches on many of the challenges faced in quake / quake2
with edge bevels on polyhedrons.

Some project ideas:

Port it to your favorite operating system.

Add some rendering features -- transparency, look up / down, slopes,
etc.

Add some game features -- weapons, jumping, ducking, flying, etc.

Create a packet server based internet game.

Create a client / server based internet game.

Do a 3D accelerated version.  On modern hardware (fast pentium + 3DFX)
you probably wouldn't even need to be clever -- you could just draw the
entire level and get reasonable speed.  With a touch of effort, it should
easily lock at 60 fps (well, there are some issues with DOOM's 35 hz
timebase...).  The biggest issues would probably be the non-power of two
texture sizes and the walls composed of multiple textures.


I don't have a real good guess at how many people are going to be
playing with this, but if significant projects are undertaken, it would
be cool to see a level of community cooperation.  I know that most early
projects are going to be rough hacks done in isolation, but I would be
very pleased to see a coordinated 'net release of an improved, backwards
compatable version of DOOM on multiple platforms next year.

Have fun.

John Carmack
12-23-97


================================================
FILE: fbdoom/Makefile
================================================
################################################################
#
# $Id:$
#
# $Log:$
#

CROSS_COMPILE ?= #arm-linux-gnueabihf-

ifeq ($(V),1)
	VB=''
else
	VB=@
endif

#LIBS+=-lXext -lX11 -lnsl -lm -lSDL
#CFLAGS+=-Wunused-const-variable=0 
#CFLAGS+=-fsanitize=address
OBJS+=$(OBJDIR)/i_video_fbdev.o
OBJS+=$(OBJDIR)/i_input_tty.o

CC=$(CROSS_COMPILE)gcc  # gcc or g++
CFLAGS+=-ggdb3 -Os
LDFLAGS+=-Wl,--gc-sections
CFLAGS+=-ggdb3 -Wall -DNORMALUNIX -DLINUX -DSNDSERV # -DUSEASM
LIBS+=-lm -lc

ifneq ($(NOSDL),1)
	LIBS+= -lSDL
endif

# subdirectory for objects
OBJDIR=build
OUTPUT=fbdoom

SRC_DOOM = i_main.o dummy.o am_map.o doomdef.o doomstat.o dstrings.o d_event.o d_items.o d_iwad.o d_loop.o d_main.o d_mode.o d_net.o f_finale.o f_wipe.o g_game.o hu_lib.o hu_stuff.o info.o i_cdmus.o i_endoom.o i_joystick.o i_scale.o i_sound.o i_system.o i_timer.o memio.o m_argv.o m_bbox.o m_cheat.o m_config.o m_controls.o m_fixed.o m_menu.o m_misc.o m_random.o p_ceilng.o p_doors.o p_enemy.o p_floor.o p_inter.o p_lights.o p_map.o p_maputl.o p_mobj.o p_plats.o p_pspr.o p_saveg.o p_setup.o p_sight.o p_spec.o p_switch.o p_telept.o p_tick.o p_user.o r_bsp.o r_data.o r_draw.o r_main.o r_plane.o r_segs.o r_sky.o r_things.o sha1.o sounds.o statdump.o st_lib.o st_stuff.o s_sound.o tables.o v_video.o wi_stuff.o w_checksum.o w_file.o w_file_stdc_unbuffered.o w_main.o w_wad.o z_zone.o
OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM))

all:	 $(OUTPUT)

clean:
	rm -rf $(OBJDIR)
	rm -f $(OUTPUT)
	rm -f $(OUTPUT).gdb
	rm -f $(OUTPUT).map

$(OUTPUT):	$(OBJS)
	@echo [Linking $@]
	$(VB)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) \
	-o $(OUTPUT) $(LIBS) -Wl,-Map,$(OUTPUT).map
	@echo [Size]
	-$(CROSS_COMPILE)size $(OUTPUT)

$(OBJS): | $(OBJDIR)

$(OBJDIR):
	mkdir -p $(OBJDIR)

$(OBJDIR)/%.o:	%.c
	@echo [Compiling $<]
	$(VB)$(CC) $(CFLAGS) -c $< -o $@

print:
	@echo OBJS: $(OBJS)



================================================
FILE: fbdoom/am_map.c
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
//
// DESCRIPTION:  the automap code
//


#include <stdio.h>

#include "deh_main.h"

#include "z_zone.h"
#include "doomkeys.h"
#include "doomdef.h"
#include "st_stuff.h"
#include "p_local.h"
#include "w_wad.h"

#include "m_cheat.h"
#include "m_controls.h"
#include "m_misc.h"
#include "i_system.h"

// Needs access to LFB.
#include "v_video.h"

// State.
#include "doomstat.h"
#include "r_state.h"

// Data.
#include "dstrings.h"

#include "am_map.h"


// For use if I do walls with outsides/insides
#define REDS		(256-5*16)
#define REDRANGE	16
#define BLUES		(256-4*16+8)
#define BLUERANGE	8
#define GREENS		(7*16)
#define GREENRANGE	16
#define GRAYS		(6*16)
#define GRAYSRANGE	16
#define BROWNS		(4*16)
#define BROWNRANGE	16
#define YELLOWS		(256-32+7)
#define YELLOWRANGE	1
#define BLACK		0
#define WHITE		(256-47)

// Automap colors
#define BACKGROUND	BLACK
#define YOURCOLORS	WHITE
#define YOURRANGE	0
#define WALLCOLORS	REDS
#define WALLRANGE	REDRANGE
#define TSWALLCOLORS	GRAYS
#define TSWALLRANGE	GRAYSRANGE
#define FDWALLCOLORS	BROWNS
#define FDWALLRANGE	BROWNRANGE
#define CDWALLCOLORS	YELLOWS
#define CDWALLRANGE	YELLOWRANGE
#define THINGCOLORS	GREENS
#define THINGRANGE	GREENRANGE
#define SECRETWALLCOLORS WALLCOLORS
#define SECRETWALLRANGE WALLRANGE
#define GRIDCOLORS	(GRAYS + GRAYSRANGE/2)
#define GRIDRANGE	0
#define XHAIRCOLORS	GRAYS

// drawing stuff

#define AM_NUMMARKPOINTS 10

// scale on entry
#define INITSCALEMTOF (.2*FRACUNIT)
// how much the automap moves window per tic in frame-buffer coordinates
// moves 140 pixels in 1 second
#define F_PANINC	4
// how much zoom-in per tic
// goes to 2x in 1 second
#define M_ZOOMIN        ((int) (1.02*FRACUNIT))
// how much zoom-out per tic
// pulls out to 0.5x in 1 second
#define M_ZOOMOUT       ((int) (FRACUNIT/1.02))

// translates between frame-buffer and map distances
#define FTOM(x) FixedMul(((x)<<16),scale_ftom)
#define MTOF(x) (FixedMul((x),scale_mtof)>>16)
// translates between frame-buffer and map coordinates
#define CXMTOF(x)  (f_x + MTOF((x)-m_x))
#define CYMTOF(y)  (f_y + (f_h - MTOF((y)-m_y)))

// the following is crap
#define LINE_NEVERSEE ML_DONTDRAW

typedef struct
{
    int x, y;
} fpoint_t;

typedef struct
{
    fpoint_t a, b;
} fline_t;

typedef struct
{
    fixed_t		x,y;
} mpoint_t;

typedef struct
{
    mpoint_t a, b;
} mline_t;

typedef struct
{
    fixed_t slp, islp;
} islope_t;



//
// The vector graphics for the automap.
//  A line drawing of the player pointing right,
//   starting from the middle.
//
#define R ((8*PLAYERRADIUS)/7)
mline_t player_arrow[] = {
    { { -R+R/8, 0 }, { R, 0 } }, // -----
    { { R, 0 }, { R-R/2, R/4 } },  // ----->
    { { R, 0 }, { R-R/2, -R/4 } },
    { { -R+R/8, 0 }, { -R-R/8, R/4 } }, // >---->
    { { -R+R/8, 0 }, { -R-R/8, -R/4 } },
    { { -R+3*R/8, 0 }, { -R+R/8, R/4 } }, // >>--->
    { { -R+3*R/8, 0 }, { -R+R/8, -R/4 } }
};
#undef R

#define R ((8*PLAYERRADIUS)/7)
mline_t cheat_player_arrow[] = {
    { { -R+R/8, 0 }, { R, 0 } }, // -----
    { { R, 0 }, { R-R/2, R/6 } },  // ----->
    { { R, 0 }, { R-R/2, -R/6 } },
    { { -R+R/8, 0 }, { -R-R/8, R/6 } }, // >----->
    { { -R+R/8, 0 }, { -R-R/8, -R/6 } },
    { { -R+3*R/8, 0 }, { -R+R/8, R/6 } }, // >>----->
    { { -R+3*R/8, 0 }, { -R+R/8, -R/6 } },
    { { -R/2, 0 }, { -R/2, -R/6 } }, // >>-d--->
    { { -R/2, -R/6 }, { -R/2+R/6, -R/6 } },
    { { -R/2+R/6, -R/6 }, { -R/2+R/6, R/4 } },
    { { -R/6, 0 }, { -R/6, -R/6 } }, // >>-dd-->
    { { -R/6, -R/6 }, { 0, -R/6 } },
    { { 0, -R/6 }, { 0, R/4 } },
    { { R/6, R/4 }, { R/6, -R/7 } }, // >>-ddt->
    { { R/6, -R/7 }, { R/6+R/32, -R/7-R/32 } },
    { { R/6+R/32, -R/7-R/32 }, { R/6+R/10, -R/7 } }
};
#undef R

#define R (FRACUNIT)
mline_t triangle_guy[] = {
    { { (fixed_t)(-.867*R), (fixed_t)(-.5*R) }, { (fixed_t)(.867*R ), (fixed_t)(-.5*R) } },
    { { (fixed_t)(.867*R ), (fixed_t)(-.5*R) }, { (fixed_t)(0      ), (fixed_t)(R    ) } },
    { { (fixed_t)(0      ), (fixed_t)(R    ) }, { (fixed_t)(-.867*R), (fixed_t)(-.5*R) } }
};
#undef R

#define R (FRACUNIT)
mline_t thintriangle_guy[] = {
    { { (fixed_t)(-.5*R), (fixed_t)(-.7*R) }, { (fixed_t)(R    ), (fixed_t)(0    ) } },
    { { (fixed_t)(R    ), (fixed_t)(0    ) }, { (fixed_t)(-.5*R), (fixed_t)(.7*R ) } },
    { { (fixed_t)(-.5*R), (fixed_t)(.7*R ) }, { (fixed_t)(-.5*R), (fixed_t)(-.7*R) } }
};
#undef R




static int 	cheating = 0;
static int 	grid = 0;

static int 	leveljuststarted = 1; 	// kluge until AM_LevelInit() is called

boolean    	automapactive = false;
static int 	finit_width = SCREENWIDTH;
static int 	finit_height = SCREENHEIGHT - 32;

// location of window on screen
static int 	f_x;
static int	f_y;

// size of window on screen
static int 	f_w;
static int	f_h;

static int 	lightlev; 		// used for funky strobing effect
static byte*	fb; 			// pseudo-frame buffer
static int 	amclock;

static mpoint_t m_paninc; // how far the window pans each tic (map coords)
static fixed_t 	mtof_zoommul; // how far the window zooms in each tic (map coords)
static fixed_t 	ftom_zoommul; // how far the window zooms in each tic (fb coords)

static fixed_t 	m_x, m_y;   // LL x,y where the window is on the map (map coords)
static fixed_t 	m_x2, m_y2; // UR x,y where the window is on the map (map coords)

//
// width/height of window on map (map coords)
//
static fixed_t 	m_w;
static fixed_t	m_h;

// based on level size
static fixed_t 	min_x;
static fixed_t	min_y; 
static fixed_t 	max_x;
static fixed_t  max_y;

static fixed_t 	max_w; // max_x-min_x,
static fixed_t  max_h; // max_y-min_y

// based on player size
static fixed_t 	min_w;
static fixed_t  min_h;


static fixed_t 	min_scale_mtof; // used to tell when to stop zooming out
static fixed_t 	max_scale_mtof; // used to tell when to stop zooming in

// old stuff for recovery later
static fixed_t old_m_w, old_m_h;
static fixed_t old_m_x, old_m_y;

// old location used by the Follower routine
static mpoint_t f_oldloc;

// used by MTOF to scale from map-to-frame-buffer coords
static fixed_t scale_mtof = (fixed_t)INITSCALEMTOF;
// used by FTOM to scale from frame-buffer-to-map coords (=1/scale_mtof)
static fixed_t scale_ftom;

static player_t *plr; // the player represented by an arrow

static patch_t *marknums[10]; // numbers used for marking by the automap
static mpoint_t markpoints[AM_NUMMARKPOINTS]; // where the points are
static int markpointnum = 0; // next point to be assigned

static int followplayer = 1; // specifies whether to follow the player around

cheatseq_t cheat_amap = CHEAT("iddt", 0);

static boolean stopped = true;

// Calculates the slope and slope according to the x-axis of a line
// segment in map coordinates (with the upright y-axis n' all) so
// that it can be used with the brain-dead drawing stuff.

void
AM_getIslope
( mline_t*	ml,
  islope_t*	is )
{
    int dx, dy;

    dy = ml->a.y - ml->b.y;
    dx = ml->b.x - ml->a.x;
    if (!dy) is->islp = (dx<0?-INT_MAX:INT_MAX);
    else is->islp = FixedDiv(dx, dy);
    if (!dx) is->slp = (dy<0?-INT_MAX:INT_MAX);
    else is->slp = FixedDiv(dy, dx);

}

//
//
//
void AM_activateNewScale(void)
{
    m_x += m_w/2;
    m_y += m_h/2;
    m_w = FTOM(f_w);
    m_h = FTOM(f_h);
    m_x -= m_w/2;
    m_y -= m_h/2;
    m_x2 = m_x + m_w;
    m_y2 = m_y + m_h;
}

//
//
//
void AM_saveScaleAndLoc(void)
{
    old_m_x = m_x;
    old_m_y = m_y;
    old_m_w = m_w;
    old_m_h = m_h;
}

//
//
//
void AM_restoreScaleAndLoc(void)
{

    m_w = old_m_w;
    m_h = old_m_h;
    if (!followplayer)
    {
	m_x = old_m_x;
	m_y = old_m_y;
    } else {
	m_x = plr->mo->x - m_w/2;
	m_y = plr->mo->y - m_h/2;
    }
    m_x2 = m_x + m_w;
    m_y2 = m_y + m_h;

    // Change the scaling multipliers
    scale_mtof = FixedDiv(f_w<<FRACBITS, m_w);
    scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
}

//
// adds a marker at the current location
//
void AM_addMark(void)
{
    markpoints[markpointnum].x = m_x + m_w/2;
    markpoints[markpointnum].y = m_y + m_h/2;
    markpointnum = (markpointnum + 1) % AM_NUMMARKPOINTS;

}

//
// Determines bounding box of all vertices,
// sets global variables controlling zoom range.
//
void AM_findMinMaxBoundaries(void)
{
    int i;
    fixed_t a;
    fixed_t b;

    min_x = min_y =  INT_MAX;
    max_x = max_y = -INT_MAX;
  
    for (i=0;i<numvertexes;i++)
    {
	if (vertexes[i].x < min_x)
	    min_x = vertexes[i].x;
	else if (vertexes[i].x > max_x)
	    max_x = vertexes[i].x;
    
	if (vertexes[i].y < min_y)
	    min_y = vertexes[i].y;
	else if (vertexes[i].y > max_y)
	    max_y = vertexes[i].y;
    }
  
    max_w = max_x - min_x;
    max_h = max_y - min_y;

    min_w = 2*PLAYERRADIUS; // const? never changed?
    min_h = 2*PLAYERRADIUS;

    a = FixedDiv(f_w<<FRACBITS, max_w);
    b = FixedDiv(f_h<<FRACBITS, max_h);
  
    min_scale_mtof = a < b ? a : b;
    max_scale_mtof = FixedDiv(f_h<<FRACBITS, 2*PLAYERRADIUS);

}


//
//
//
void AM_changeWindowLoc(void)
{
    if (m_paninc.x || m_paninc.y)
    {
	followplayer = 0;
	f_oldloc.x = INT_MAX;
    }

    m_x += m_paninc.x;
    m_y += m_paninc.y;

    if (m_x + m_w/2 > max_x)
	m_x = max_x - m_w/2;
    else if (m_x + m_w/2 < min_x)
	m_x = min_x - m_w/2;
  
    if (m_y + m_h/2 > max_y)
	m_y = max_y - m_h/2;
    else if (m_y + m_h/2 < min_y)
	m_y = min_y - m_h/2;

    m_x2 = m_x + m_w;
    m_y2 = m_y + m_h;
}


//
//
//
void AM_initVariables(void)
{
    int pnum;
    static event_t st_notify = { ev_keyup, AM_MSGENTERED, 0, 0 };

    automapactive = true;
    fb = I_VideoBuffer;

    f_oldloc.x = INT_MAX;
    amclock = 0;
    lightlev = 0;

    m_paninc.x = m_paninc.y = 0;
    ftom_zoommul = FRACUNIT;
    mtof_zoommul = FRACUNIT;

    m_w = FTOM(f_w);
    m_h = FTOM(f_h);

    // find player to center on initially
    if (playeringame[consoleplayer])
    {
        plr = &players[consoleplayer];
    }
    else
    {
        plr = &players[0];

	for (pnum=0;pnum<MAXPLAYERS;pnum++)
        {
	    if (playeringame[pnum])
            {
                plr = &players[pnum];
		break;
            }
        }
    }

    m_x = plr->mo->x - m_w/2;
    m_y = plr->mo->y - m_h/2;
    AM_changeWindowLoc();

    // for saving & restoring
    old_m_x = m_x;
    old_m_y = m_y;
    old_m_w = m_w;
    old_m_h = m_h;

    // inform the status bar of the change
    ST_Responder(&st_notify);

}

//
// 
//
void AM_loadPics(void)
{
    int i;
    char namebuf[9];
  
    for (i=0;i<10;i++)
    {
	DEH_snprintf(namebuf, 9, "AMMNUM%d", i);
	marknums[i] = W_CacheLumpName(namebuf, PU_STATIC);
    }

}

void AM_unloadPics(void)
{
    int i;
    char namebuf[9];
  
    for (i=0;i<10;i++)
    {
	DEH_snprintf(namebuf, 9, "AMMNUM%d", i);
	W_ReleaseLumpName(namebuf);
    }
}

void AM_clearMarks(void)
{
    int i;

    for (i=0;i<AM_NUMMARKPOINTS;i++)
	markpoints[i].x = -1; // means empty
    markpointnum = 0;
}

//
// should be called at the start of every level
// right now, i figure it out myself
//
void AM_LevelInit(void)
{
    leveljuststarted = 0;

    f_x = f_y = 0;
    f_w = finit_width;
    f_h = finit_height;

    AM_clearMarks();

    AM_findMinMaxBoundaries();
    scale_mtof = FixedDiv(min_scale_mtof, (int) (0.7*FRACUNIT));
    if (scale_mtof > max_scale_mtof)
	scale_mtof = min_scale_mtof;
    scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
}




//
//
//
void AM_Stop (void)
{
    static event_t st_notify = { 0, ev_keyup, AM_MSGEXITED, 0 };

    AM_unloadPics();
    automapactive = false;
    ST_Responder(&st_notify);
    stopped = true;
}

//
//
//
void AM_Start (void)
{
    static int lastlevel = -1, lastepisode = -1;

    if (!stopped) AM_Stop();
    stopped = false;
    if (lastlevel != gamemap || lastepisode != gameepisode)
    {
	AM_LevelInit();
	lastlevel = gamemap;
	lastepisode = gameepisode;
    }
    AM_initVariables();
    AM_loadPics();
}

//
// set the window scale to the maximum size
//
void AM_minOutWindowScale(void)
{
    scale_mtof = min_scale_mtof;
    scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
    AM_activateNewScale();
}

//
// set the window scale to the minimum size
//
void AM_maxOutWindowScale(void)
{
    scale_mtof = max_scale_mtof;
    scale_ftom = FixedDiv(FRACUNIT, scale_mtof);
    AM_activateNewScale();
}


//
// Handle events (user inputs) in automap mode
//
boolean
AM_Responder
( event_t*	ev )
{

    int rc;
    static int bigstate=0;
    static char buffer[20];
    int key;

    rc = false;

    if (!automapactive)
    {
	if (ev->type == ev_keydown && ev->data1 == key_map_toggle)
	{
	    AM_Start ();
	    viewactive = false;
	    rc = true;
	}
    }
    else if (ev->type == ev_keydown)
    {
	rc = true;
        key = ev->data1;

        if (key == key_map_east)          // pan right
        {
            if (!followplayer) m_paninc.x = FTOM(F_PANINC);
            else rc = false;
        }
        else if (key == key_map_west)     // pan left
        {
            if (!followplayer) m_paninc.x = -FTOM(F_PANINC);
            else rc = false;
        }
        else if (key == key_map_north)    // pan up
        {
            if (!followplayer) m_paninc.y = FTOM(F_PANINC);
            else rc = false;
        }
        else if (key == key_map_south)    // pan down
        {
            if (!followplayer) m_paninc.y = -FTOM(F_PANINC);
            else rc = false;
        }
        else if (key == key_map_zoomout)  // zoom out
        {
            mtof_zoommul = M_ZOOMOUT;
            ftom_zoommul = M_ZOOMIN;
        }
        else if (key == key_map_zoomin)   // zoom in
        {
            mtof_zoommul = M_ZOOMIN;
            ftom_zoommul = M_ZOOMOUT;
        }
        else if (key == key_map_toggle)
        {
            bigstate = 0;
            viewactive = true;
            AM_Stop ();
        }
        else if (key == key_map_maxzoom)
        {
            bigstate = !bigstate;
            if (bigstate)
            {
                AM_saveScaleAndLoc();
                AM_minOutWindowScale();
            }
            else AM_restoreScaleAndLoc();
        }
        else if (key == key_map_follow)
        {
            followplayer = !followplayer;
            f_oldloc.x = INT_MAX;
            if (followplayer)
                plr->message = DEH_String(AMSTR_FOLLOWON);
            else
                plr->message = DEH_String(AMSTR_FOLLOWOFF);
        }
        else if (key == key_map_grid)
        {
            grid = !grid;
            if (grid)
                plr->message = DEH_String(AMSTR_GRIDON);
            else
                plr->message = DEH_String(AMSTR_GRIDOFF);
        }
        else if (key == key_map_mark)
        {
            M_snprintf(buffer, sizeof(buffer), "%s %d",
                       DEH_String(AMSTR_MARKEDSPOT), markpointnum);
            plr->message = buffer;
            AM_addMark();
        }
        else if (key == key_map_clearmark)
        {
            AM_clearMarks();
            plr->message = DEH_String(AMSTR_MARKSCLEARED);
        }
        else
        {
            rc = false;
        }

	if (!deathmatch && cht_CheckCheat(&cheat_amap, ev->data2))
	{
	    rc = false;
	    cheating = (cheating+1) % 3;
	}
    }
    else if (ev->type == ev_keyup)
    {
        rc = false;
        key = ev->data1;

        if (key == key_map_east)
        {
            if (!followplayer) m_paninc.x = 0;
        }
        else if (key == key_map_west)
        {
            if (!followplayer) m_paninc.x = 0;
        }
        else if (key == key_map_north)
        {
            if (!followplayer) m_paninc.y = 0;
        }
        else if (key == key_map_south)
        {
            if (!followplayer) m_paninc.y = 0;
        }
        else if (key == key_map_zoomout || key == key_map_zoomin)
        {
            mtof_zoommul = FRACUNIT;
            ftom_zoommul = FRACUNIT;
        }
    }

    return rc;

}


//
// Zooming
//
void AM_changeWindowScale(void)
{

    // Change the scaling multipliers
    scale_mtof = FixedMul(scale_mtof, mtof_zoommul);
    scale_ftom = FixedDiv(FRACUNIT, scale_mtof);

    if (scale_mtof < min_scale_mtof)
	AM_minOutWindowScale();
    else if (scale_mtof > max_scale_mtof)
	AM_maxOutWindowScale();
    else
	AM_activateNewScale();
}


//
//
//
void AM_doFollowPlayer(void)
{

    if (f_oldloc.x != plr->mo->x || f_oldloc.y != plr->mo->y)
    {
	m_x = FTOM(MTOF(plr->mo->x)) - m_w/2;
	m_y = FTOM(MTOF(plr->mo->y)) - m_h/2;
	m_x2 = m_x + m_w;
	m_y2 = m_y + m_h;
	f_oldloc.x = plr->mo->x;
	f_oldloc.y = plr->mo->y;

	//  m_x = FTOM(MTOF(plr->mo->x - m_w/2));
	//  m_y = FTOM(MTOF(plr->mo->y - m_h/2));
	//  m_x = plr->mo->x - m_w/2;
	//  m_y = plr->mo->y - m_h/2;

    }

}

//
//
//
void AM_updateLightLev(void)
{
    static int nexttic = 0;
    //static int litelevels[] = { 0, 3, 5, 6, 6, 7, 7, 7 };
    static int litelevels[] = { 0, 4, 7, 10, 12, 14, 15, 15 };
    static int litelevelscnt = 0;
   
    // Change light level
    if (amclock>nexttic)
    {
	lightlev = litelevels[litelevelscnt++];
	if (litelevelscnt == arrlen(litelevels)) litelevelscnt = 0;
	nexttic = amclock + 6 - (amclock % 6);
    }

}


//
// Updates on Game Tick
//
void AM_Ticker (void)
{

    if (!automapactive)
	return;

    amclock++;

    if (followplayer)
	AM_doFollowPlayer();

    // Change the zoom if necessary
    if (ftom_zoommul != FRACUNIT)
	AM_changeWindowScale();

    // Change x,y location
    if (m_paninc.x || m_paninc.y)
	AM_changeWindowLoc();

    // Update light level
    // AM_updateLightLev();

}


//
// Clear automap frame buffer.
//
void AM_clearFB(int color)
{
    memset(fb, color, f_w*f_h);
}


//
// Automap clipping of lines.
//
// Based on Cohen-Sutherland clipping algorithm but with a slightly
// faster reject and precalculated slopes.  If the speed is needed,
// use a hash algorithm to handle  the common cases.
//
boolean
AM_clipMline
( mline_t*	ml,
  fline_t*	fl )
{
    enum
    {
	LEFT	=1,
	RIGHT	=2,
	BOTTOM	=4,
	TOP	=8
    };
    
    register int	outcode1 = 0;
    register int	outcode2 = 0;
    register int	outside;
    
    fpoint_t	tmp;
    int		dx;
    int		dy;

    
#define DOOUTCODE(oc, mx, my) \
    (oc) = 0; \
    if ((my) < 0) (oc) |= TOP; \
    else if ((my) >= f_h) (oc) |= BOTTOM; \
    if ((mx) < 0) (oc) |= LEFT; \
    else if ((mx) >= f_w) (oc) |= RIGHT;

    
    // do trivial rejects and outcodes
    if (ml->a.y > m_y2)
	outcode1 = TOP;
    else if (ml->a.y < m_y)
	outcode1 = BOTTOM;

    if (ml->b.y > m_y2)
	outcode2 = TOP;
    else if (ml->b.y < m_y)
	outcode2 = BOTTOM;
    
    if (outcode1 & outcode2)
	return false; // trivially outside

    if (ml->a.x < m_x)
	outcode1 |= LEFT;
    else if (ml->a.x > m_x2)
	outcode1 |= RIGHT;
    
    if (ml->b.x < m_x)
	outcode2 |= LEFT;
    else if (ml->b.x > m_x2)
	outcode2 |= RIGHT;
    
    if (outcode1 & outcode2)
	return false; // trivially outside

    // transform to frame-buffer coordinates.
    fl->a.x = CXMTOF(ml->a.x);
    fl->a.y = CYMTOF(ml->a.y);
    fl->b.x = CXMTOF(ml->b.x);
    fl->b.y = CYMTOF(ml->b.y);

    DOOUTCODE(outcode1, fl->a.x, fl->a.y);
    DOOUTCODE(outcode2, fl->b.x, fl->b.y);

    if (outcode1 & outcode2)
	return false;

    while (outcode1 | outcode2)
    {
	// may be partially inside box
	// find an outside point
	if (outcode1)
	    outside = outcode1;
	else
	    outside = outcode2;
	
	// clip to each side
	if (outside & TOP)
	{
	    dy = fl->a.y - fl->b.y;
	    dx = fl->b.x - fl->a.x;
	    tmp.x = fl->a.x + (dx*(fl->a.y))/dy;
	    tmp.y = 0;
	}
	else if (outside & BOTTOM)
	{
	    dy = fl->a.y - fl->b.y;
	    dx = fl->b.x - fl->a.x;
	    tmp.x = fl->a.x + (dx*(fl->a.y-f_h))/dy;
	    tmp.y = f_h-1;
	}
	else if (outside & RIGHT)
	{
	    dy = fl->b.y - fl->a.y;
	    dx = fl->b.x - fl->a.x;
	    tmp.y = fl->a.y + (dy*(f_w-1 - fl->a.x))/dx;
	    tmp.x = f_w-1;
	}
	else if (outside & LEFT)
	{
	    dy = fl->b.y - fl->a.y;
	    dx = fl->b.x - fl->a.x;
	    tmp.y = fl->a.y + (dy*(-fl->a.x))/dx;
	    tmp.x = 0;
	}
        else
        {
            tmp.x = 0;
            tmp.y = 0;
        }

	if (outside == outcode1)
	{
	    fl->a = tmp;
	    DOOUTCODE(outcode1, fl->a.x, fl->a.y);
	}
	else
	{
	    fl->b = tmp;
	    DOOUTCODE(outcode2, fl->b.x, fl->b.y);
	}
	
	if (outcode1 & outcode2)
	    return false; // trivially outside
    }

    return true;
}
#undef DOOUTCODE


//
// Classic Bresenham w/ whatever optimizations needed for speed
//
void
AM_drawFline
( fline_t*	fl,
  int		color )
{
    register int x;
    register int y;
    register int dx;
    register int dy;
    register int sx;
    register int sy;
    register int ax;
    register int ay;
    register int d;
    
    static int fuck = 0;

    // For debugging only
    if (      fl->a.x < 0 || fl->a.x >= f_w
	   || fl->a.y < 0 || fl->a.y >= f_h
	   || fl->b.x < 0 || fl->b.x >= f_w
	   || fl->b.y < 0 || fl->b.y >= f_h)
    {
        DEH_fprintf(stderr, "fuck %d \r", fuck++);
	return;
    }

#define PUTDOT(xx,yy,cc) fb[(yy)*f_w+(xx)]=(cc)

    dx = fl->b.x - fl->a.x;
    ax = 2 * (dx<0 ? -dx : dx);
    sx = dx<0 ? -1 : 1;

    dy = fl->b.y - fl->a.y;
    ay = 2 * (dy<0 ? -dy : dy);
    sy = dy<0 ? -1 : 1;

    x = fl->a.x;
    y = fl->a.y;

    if (ax > ay)
    {
	d = ay - ax/2;
	while (1)
	{
	    PUTDOT(x,y,color);
	    if (x == fl->b.x) return;
	    if (d>=0)
	    {
		y += sy;
		d -= ax;
	    }
	    x += sx;
	    d += ay;
	}
    }
    else
    {
	d = ax - ay/2;
	while (1)
	{
	    PUTDOT(x, y, color);
	    if (y == fl->b.y) return;
	    if (d >= 0)
	    {
		x += sx;
		d -= ay;
	    }
	    y += sy;
	    d += ax;
	}
    }
}


//
// Clip lines, draw visible part sof lines.
//
void
AM_drawMline
( mline_t*	ml,
  int		color )
{
    static fline_t fl;

    if (AM_clipMline(ml, &fl))
	AM_drawFline(&fl, color); // draws it on frame buffer using fb coords
}



//
// Draws flat (floor/ceiling tile) aligned grid lines.
//
void AM_drawGrid(int color)
{
    fixed_t x, y;
    fixed_t start, end;
    mline_t ml;

    // Figure out start of vertical gridlines
    start = m_x;
    if ((start-bmaporgx)%(MAPBLOCKUNITS<<FRACBITS))
	start += (MAPBLOCKUNITS<<FRACBITS)
	    - ((start-bmaporgx)%(MAPBLOCKUNITS<<FRACBITS));
    end = m_x + m_w;

    // draw vertical gridlines
    ml.a.y = m_y;
    ml.b.y = m_y+m_h;
    for (x=start; x<end; x+=(MAPBLOCKUNITS<<FRACBITS))
    {
	ml.a.x = x;
	ml.b.x = x;
	AM_drawMline(&ml, color);
    }

    // Figure out start of horizontal gridlines
    start = m_y;
    if ((start-bmaporgy)%(MAPBLOCKUNITS<<FRACBITS))
	start += (MAPBLOCKUNITS<<FRACBITS)
	    - ((start-bmaporgy)%(MAPBLOCKUNITS<<FRACBITS));
    end = m_y + m_h;

    // draw horizontal gridlines
    ml.a.x = m_x;
    ml.b.x = m_x + m_w;
    for (y=start; y<end; y+=(MAPBLOCKUNITS<<FRACBITS))
    {
	ml.a.y = y;
	ml.b.y = y;
	AM_drawMline(&ml, color);
    }

}

//
// Determines visible lines, draws them.
// This is LineDef based, not LineSeg based.
//
void AM_drawWalls(void)
{
    int i;
    static mline_t l;

    for (i=0;i<numlines;i++)
    {
	l.a.x = lines[i].v1->x;
	l.a.y = lines[i].v1->y;
	l.b.x = lines[i].v2->x;
	l.b.y = lines[i].v2->y;
	if (cheating || (lines[i].flags & ML_MAPPED))
	{
	    if ((lines[i].flags & LINE_NEVERSEE) && !cheating)
		continue;
	    if (!lines[i].backsector)
	    {
		AM_drawMline(&l, WALLCOLORS+lightlev);
	    }
	    else
	    {
		if (lines[i].special == 39)
		{ // teleporters
		    AM_drawMline(&l, WALLCOLORS+WALLRANGE/2);
		}
		else if (lines[i].flags & ML_SECRET) // secret door
		{
		    if (cheating) AM_drawMline(&l, SECRETWALLCOLORS + lightlev);
		    else AM_drawMline(&l, WALLCOLORS+lightlev);
		}
		else if (lines[i].backsector->floorheight
			   != lines[i].frontsector->floorheight) {
		    AM_drawMline(&l, FDWALLCOLORS + lightlev); // floor level change
		}
		else if (lines[i].backsector->ceilingheight
			   != lines[i].frontsector->ceilingheight) {
		    AM_drawMline(&l, CDWALLCOLORS+lightlev); // ceiling level change
		}
		else if (cheating) {
		    AM_drawMline(&l, TSWALLCOLORS+lightlev);
		}
	    }
	}
	else if (plr->powers[pw_allmap])
	{
	    if (!(lines[i].flags & LINE_NEVERSEE)) AM_drawMline(&l, GRAYS+3);
	}
    }
}


//
// Rotation in 2D.
// Used to rotate player arrow line character.
//
void
AM_rotate
( fixed_t*	x,
  fixed_t*	y,
  angle_t	a )
{
    fixed_t tmpx;

    tmpx =
	FixedMul(*x,finecosine[a>>ANGLETOFINESHIFT])
	- FixedMul(*y,finesine[a>>ANGLETOFINESHIFT]);
    
    *y   =
	FixedMul(*x,finesine[a>>ANGLETOFINESHIFT])
	+ FixedMul(*y,finecosine[a>>ANGLETOFINESHIFT]);

    *x = tmpx;
}

void
AM_drawLineCharacter
( mline_t*	lineguy,
  int		lineguylines,
  fixed_t	scale,
  angle_t	angle,
  int		color,
  fixed_t	x,
  fixed_t	y )
{
    int		i;
    mline_t	l;

    for (i=0;i<lineguylines;i++)
    {
	l.a.x = lineguy[i].a.x;
	l.a.y = lineguy[i].a.y;

	if (scale)
	{
	    l.a.x = FixedMul(scale, l.a.x);
	    l.a.y = FixedMul(scale, l.a.y);
	}

	if (angle)
	    AM_rotate(&l.a.x, &l.a.y, angle);

	l.a.x += x;
	l.a.y += y;

	l.b.x = lineguy[i].b.x;
	l.b.y = lineguy[i].b.y;

	if (scale)
	{
	    l.b.x = FixedMul(scale, l.b.x);
	    l.b.y = FixedMul(scale, l.b.y);
	}

	if (angle)
	    AM_rotate(&l.b.x, &l.b.y, angle);
	
	l.b.x += x;
	l.b.y += y;

	AM_drawMline(&l, color);
    }
}

void AM_drawPlayers(void)
{
    int		i;
    player_t*	p;
    static int 	their_colors[] = { GREENS, GRAYS, BROWNS, REDS };
    int		their_color = -1;
    int		color;

    if (!netgame)
    {
	if (cheating)
	    AM_drawLineCharacter
		(cheat_player_arrow, arrlen(cheat_player_arrow), 0,
		 plr->mo->angle, WHITE, plr->mo->x, plr->mo->y);
	else
	    AM_drawLineCharacter
		(player_arrow, arrlen(player_arrow), 0, plr->mo->angle,
		 WHITE, plr->mo->x, plr->mo->y);
	return;
    }

    for (i=0;i<MAXPLAYERS;i++)
    {
	their_color++;
	p = &players[i];

	if ( (deathmatch && !singledemo) && p != plr)
	    continue;

	if (!playeringame[i])
	    continue;

	if (p->powers[pw_invisibility])
	    color = 246; // *close* to black
	else
	    color = their_colors[their_color];
	
	AM_drawLineCharacter
	    (player_arrow, arrlen(player_arrow), 0, p->mo->angle,
	     color, p->mo->x, p->mo->y);
    }

}

void
AM_drawThings
( int	colors,
  int 	colorrange)
{
    int		i;
    mobj_t*	t;

    for (i=0;i<numsectors;i++)
    {
	t = sectors[i].thinglist;
	while (t)
	{
	    AM_drawLineCharacter
		(thintriangle_guy, arrlen(thintriangle_guy),
		 16<<FRACBITS, t->angle, colors+lightlev, t->x, t->y);
	    t = t->snext;
	}
    }
}

void AM_drawMarks(void)
{
    int i, fx, fy, w, h;

    for (i=0;i<AM_NUMMARKPOINTS;i++)
    {
	if (markpoints[i].x != -1)
	{
	    //      w = SHORT(marknums[i]->width);
	    //      h = SHORT(marknums[i]->height);
	    w = 5; // because something's wrong with the wad, i guess
	    h = 6; // because something's wrong with the wad, i guess
	    fx = CXMTOF(markpoints[i].x);
	    fy = CYMTOF(markpoints[i].y);
	    if (fx >= f_x && fx <= f_w - w && fy >= f_y && fy <= f_h - h)
		V_DrawPatch(fx, fy, marknums[i]);
	}
    }

}

void AM_drawCrosshair(int color)
{
    fb[(f_w*(f_h+1))/2] = color; // single point for now

}

void AM_Drawer (void)
{
    if (!automapactive) return;

    AM_clearFB(BACKGROUND);
    if (grid)
	AM_drawGrid(GRIDCOLORS);
    AM_drawWalls();
    AM_drawPlayers();
    if (cheating==2)
	AM_drawThings(THINGCOLORS, THINGRANGE);
    AM_drawCrosshair(XHAIRCOLORS);

    AM_drawMarks();

    V_MarkRect(f_x, f_y, f_w, f_h);

}


================================================
FILE: fbdoom/am_map.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//  AutoMap module.
//

#ifndef __AMMAP_H__
#define __AMMAP_H__

#include "d_event.h"
#include "m_cheat.h"

// Used by ST StatusBar stuff.
#define AM_MSGHEADER (('a'<<24)+('m'<<16))
#define AM_MSGENTERED (AM_MSGHEADER | ('e'<<8))
#define AM_MSGEXITED (AM_MSGHEADER | ('x'<<8))


// Called by main loop.
boolean AM_Responder (event_t* ev);

// Called by main loop.
void AM_Ticker (void);

// Called by main loop,
// called instead of view drawer if automap active.
void AM_Drawer (void);

// Called to force the automap to quit
// if the level is completed while it is up.
void AM_Stop (void);


extern cheatseq_t cheat_amap;


#endif


================================================
FILE: fbdoom/config.h
================================================
/* config.hin.  Generated from configure.ac by autoheader.  */

/* Define to 1 if you have the <dev/isa/spkrio.h> header file. */
#undef HAVE_DEV_ISA_SPKRIO_H

/* Define to 1 if you have the <dev/speaker/speaker.h> header file. */
#undef HAVE_DEV_SPEAKER_SPEAKER_H

/* Define to 1 if you have the <inttypes.h> header file. */
#define HAVE_INTTYPES_H 1

/* Define to 1 if you have the `ioperm' function. */
#undef HAVE_IOPERM

/* Define to 1 if you have the `amd64' library (-lamd64). */
#undef HAVE_LIBAMD64

/* Define to 1 if you have the `i386' library (-li386). */
#undef HAVE_LIBI386

/* Define to 1 if you have the `m' library (-lm). */
#undef HAVE_LIBM

/* Define to 1 if you have the `png' library (-lpng). */
#undef HAVE_LIBPNG

/* Define to 1 if you have the `samplerate' library (-lsamplerate). */
#undef HAVE_LIBSAMPLERATE

/* Define to 1 if you have the `z' library (-lz). */
#undef HAVE_LIBZ

/* Define to 1 if you have the <linux/kd.h> header file. */
#undef HAVE_LINUX_KD_H

/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H

/* Define to 1 if you have the `mmap' function. */
#undef HAVE_MMAP

/* Define to 1 if you have the `sched_setaffinity' function. */
#undef HAVE_SCHED_SETAFFINITY

/* Define to 1 if you have the <stdint.h> header file. */
#define HAVE_STDINT_H 1

/* Define to 1 if you have the <stdlib.h> header file. */
#define HAVE_STDLIB_H 1

/* Define to 1 if you have the <strings.h> header file. */
#define HAVE_STRINGS_H 1

/* Define to 1 if you have the <string.h> header file. */
#define HAVE_STRING_H 1

/* Define to 1 if you have the <sys/stat.h> header file. */
#undef HAVE_SYS_STAT_H

/* Define to 1 if you have the <sys/types.h> header file. */
#define HAVE_SYS_TYPES_H 1

/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H

/* Name of package */
#define PACKAGE "Doom"

/* Define to the address where bug reports for this package should be sent. */
#undef PACKAGE_BUGREPORT

/* Define to the full name of this package. */
#define PACKAGE_NAME "FDoom"

/* Define to the full name and version of this package. */
#define PACKAGE_STRING "FDoom 0.1"

/* Define to the one symbol short name of this package. */
#define PACKAGE_TARNAME "fdoom.tar"

/* Define to the home page for this package. */
#define PACKAGE_URL ""

/* Define to the version of this package. */
#define PACKAGE_VERSION 0.1

/* Change this when you create your awesome forked version */
#define PROGRAM_PREFIX "fdoom"

/* Define to 1 if you have the ANSI C header files. */
#define STDC_HEADERS 1

/* Version number of package */
#define VERSION 0.1

/* Define to 1 if you want to compile the unmodified code */
#undef ORIGCODE

/* Define to the directory where all game files are located */
#define FILES_DIR "/mnt"


================================================
FILE: fbdoom/d_englsh.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//	Printed strings for translation.
//	English language support (default).
//

#ifndef __D_ENGLSH__
#define __D_ENGLSH__

//
//	Printed strings for translation
//

//
// D_Main.C
//
#define D_DEVSTR	"Development mode ON.\n"
#define D_CDROM	"CD-ROM Version: default.cfg from c:\\doomdata\n"

//
//	M_Menu.C
//
#define PRESSKEY 	"press a key."
#define PRESSYN 	"press y or n."
#define QUITMSG	"are you sure you want to\nquit this great game?"
#define LOADNET 	"you can't do load while in a net game!\n\n"PRESSKEY
#define QLOADNET	"you can't quickload during a netgame!\n\n"PRESSKEY
#define QSAVESPOT	"you haven't picked a quicksave slot yet!\n\n"PRESSKEY
#define SAVEDEAD 	"you can't save if you aren't playing!\n\n"PRESSKEY
#define QSPROMPT 	"quicksave over your game named\n\n'%s'?\n\n"PRESSYN
#define QLPROMPT	"do you want to quickload the game named\n\n'%s'?\n\n"PRESSYN

#define NEWGAME	\
"you can't start a new game\n"\
"while in a network game.\n\n"PRESSKEY

#define NIGHTMARE	\
"are you sure? this skill level\n"\
"isn't even remotely fair.\n\n"PRESSYN

#define SWSTRING	\
"this is the shareware version of doom.\n\n"\
"you need to order the entire trilogy.\n\n"PRESSKEY

#define MSGOFF	"Messages OFF"
#define MSGON		"Messages ON"
#define NETEND	"you can't end a netgame!\n\n"PRESSKEY
#define ENDGAME	"are you sure you want to end the game?\n\n"PRESSYN

#define DOSY		"(press y to quit to dos.)"

#define DETAILHI	"High detail"
#define DETAILLO	"Low detail"
#define GAMMALVL0	"Gamma correction OFF"
#define GAMMALVL1	"Gamma correction level 1"
#define GAMMALVL2	"Gamma correction level 2"
#define GAMMALVL3	"Gamma correction level 3"
#define GAMMALVL4	"Gamma correction level 4"
#define EMPTYSTRING	"empty slot"

//
//	P_inter.C
//
#define GOTARMOR	"Picked up the armor."
#define GOTMEGA	"Picked up the MegaArmor!"
#define GOTHTHBONUS	"Picked up a health bonus."
#define GOTARMBONUS	"Picked up an armor bonus."
#define GOTSTIM	"Picked up a stimpack."
#define GOTMEDINEED	"Picked up a medikit that you REALLY need!"
#define GOTMEDIKIT	"Picked up a medikit."
#define GOTSUPER	"Supercharge!"

#define GOTBLUECARD	"Picked up a blue keycard."
#define GOTYELWCARD	"Picked up a yellow keycard."
#define GOTREDCARD	"Picked up a red keycard."
#define GOTBLUESKUL	"Picked up a blue skull key."
#define GOTYELWSKUL	"Picked up a yellow skull key."
#define GOTREDSKULL	"Picked up a red skull key."

#define GOTINVUL	"Invulnerability!"
#define GOTBERSERK	"Berserk!"
#define GOTINVIS	"Partial Invisibility"
#define GOTSUIT	"Radiation Shielding Suit"
#define GOTMAP	"Computer Area Map"
#define GOTVISOR	"Light Amplification Visor"
#define GOTMSPHERE	"MegaSphere!"

#define GOTCLIP	"Picked up a clip."
#define GOTCLIPBOX	"Picked up a box of bullets."
#define GOTROCKET	"Picked up a rocket."
#define GOTROCKBOX	"Picked up a box of rockets."
#define GOTCELL	"Picked up an energy cell."
#define GOTCELLBOX	"Picked up an energy cell pack."
#define GOTSHELLS	"Picked up 4 shotgun shells."
#define GOTSHELLBOX	"Picked up a box of shotgun shells."
#define GOTBACKPACK	"Picked up a backpack full of ammo!"

#define GOTBFG9000	"You got the BFG9000!  Oh, yes."
#define GOTCHAINGUN	"You got the chaingun!"
#define GOTCHAINSAW	"A chainsaw!  Find some meat!"
#define GOTLAUNCHER	"You got the rocket launcher!"
#define GOTPLASMA	"You got the plasma gun!"
#define GOTSHOTGUN	"You got the shotgun!"
#define GOTSHOTGUN2	"You got the super shotgun!"

//
// P_Doors.C
//
#define PD_BLUEO	"You need a blue key to activate this object"
#define PD_REDO	"You need a red key to activate this object"
#define PD_YELLOWO	"You need a yellow key to activate this object"
#define PD_BLUEK	"You need a blue key to open this door"
#define PD_REDK	"You need a red key to open this door"
#define PD_YELLOWK	"You need a yellow key to open this door"

//
//	G_game.C
//
#define GGSAVED	"game saved."

//
//	HU_stuff.C
//
#define HUSTR_MSGU	"[Message unsent]"

#define HUSTR_E1M1	"E1M1: Hangar"
#define HUSTR_E1M2	"E1M2: Nuclear Plant"
#define HUSTR_E1M3	"E1M3: Toxin Refinery"
#define HUSTR_E1M4	"E1M4: Command Control"
#define HUSTR_E1M5	"E1M5: Phobos Lab"
#define HUSTR_E1M6	"E1M6: Central Processing"
#define HUSTR_E1M7	"E1M7: Computer Station"
#define HUSTR_E1M8	"E1M8: Phobos Anomaly"
#define HUSTR_E1M9	"E1M9: Military Base"

#define HUSTR_E2M1	"E2M1: Deimos Anomaly"
#define HUSTR_E2M2	"E2M2: Containment Area"
#define HUSTR_E2M3	"E2M3: Refinery"
#define HUSTR_E2M4	"E2M4: Deimos Lab"
#define HUSTR_E2M5	"E2M5: Command Center"
#define HUSTR_E2M6	"E2M6: Halls of the Damned"
#define HUSTR_E2M7	"E2M7: Spawning Vats"
#define HUSTR_E2M8	"E2M8: Tower of Babel"
#define HUSTR_E2M9	"E2M9: Fortress of Mystery"

#define HUSTR_E3M1	"E3M1: Hell Keep"
#define HUSTR_E3M2	"E3M2: Slough of Despair"
#define HUSTR_E3M3	"E3M3: Pandemonium"
#define HUSTR_E3M4	"E3M4: House of Pain"
#define HUSTR_E3M5	"E3M5: Unholy Cathedral"
#define HUSTR_E3M6	"E3M6: Mt. Erebus"
#define HUSTR_E3M7	"E3M7: Limbo"
#define HUSTR_E3M8	"E3M8: Dis"
#define HUSTR_E3M9	"E3M9: Warrens"

#define HUSTR_E4M1	"E4M1: Hell Beneath"
#define HUSTR_E4M2	"E4M2: Perfect Hatred"
#define HUSTR_E4M3	"E4M3: Sever The Wicked"
#define HUSTR_E4M4	"E4M4: Unruly Evil"
#define HUSTR_E4M5	"E4M5: They Will Repent"
#define HUSTR_E4M6	"E4M6: Against Thee Wickedly"
#define HUSTR_E4M7	"E4M7: And Hell Followed"
#define HUSTR_E4M8	"E4M8: Unto The Cruel"
#define HUSTR_E4M9	"E4M9: Fear"

#define HUSTR_1	"level 1: entryway"
#define HUSTR_2	"level 2: underhalls"
#define HUSTR_3	"level 3: the gantlet"
#define HUSTR_4	"level 4: the focus"
#define HUSTR_5	"level 5: the waste tunnels"
#define HUSTR_6	"level 6: the crusher"
#define HUSTR_7	"level 7: dead simple"
#define HUSTR_8	"level 8: tricks and traps"
#define HUSTR_9	"level 9: the pit"
#define HUSTR_10	"level 10: refueling base"
#define HUSTR_11	"level 11: 'o' of destruction!"

#define HUSTR_12	"level 12: the factory"
#define HUSTR_13	"level 13: downtown"
#define HUSTR_14	"level 14: the inmost dens"
#define HUSTR_15	"level 15: industrial zone"
#define HUSTR_16	"level 16: suburbs"
#define HUSTR_17	"level 17: tenements"
#define HUSTR_18	"level 18: the courtyard"
#define HUSTR_19	"level 19: the citadel"
#define HUSTR_20	"level 20: gotcha!"

#define HUSTR_21	"level 21: nirvana"
#define HUSTR_22	"level 22: the catacombs"
#define HUSTR_23	"level 23: barrels o' fun"
#define HUSTR_24	"level 24: the chasm"
#define HUSTR_25	"level 25: bloodfalls"
#define HUSTR_26	"level 26: the abandoned mines"
#define HUSTR_27	"level 27: monster condo"
#define HUSTR_28	"level 28: the spirit world"
#define HUSTR_29	"level 29: the living end"
#define HUSTR_30	"level 30: icon of sin"

#define HUSTR_31	"level 31: wolfenstein"
#define HUSTR_32	"level 32: grosse"

#define PHUSTR_1	"level 1: congo"
#define PHUSTR_2	"level 2: well of souls"
#define PHUSTR_3	"level 3: aztec"
#define PHUSTR_4	"level 4: caged"
#define PHUSTR_5	"level 5: ghost town"
#define PHUSTR_6	"level 6: baron's lair"
#define PHUSTR_7	"level 7: caughtyard"
#define PHUSTR_8	"level 8: realm"
#define PHUSTR_9	"level 9: abattoire"
#define PHUSTR_10	"level 10: onslaught"
#define PHUSTR_11	"level 11: hunted"

#define PHUSTR_12	"level 12: speed"
#define PHUSTR_13	"level 13: the crypt"
#define PHUSTR_14	"level 14: genesis"
#define PHUSTR_15	"level 15: the twilight"
#define PHUSTR_16	"level 16: the omen"
#define PHUSTR_17	"level 17: compound"
#define PHUSTR_18	"level 18: neurosphere"
#define PHUSTR_19	"level 19: nme"
#define PHUSTR_20	"level 20: the death domain"

#define PHUSTR_21	"level 21: slayer"
#define PHUSTR_22	"level 22: impossible mission"
#define PHUSTR_23	"level 23: tombstone"
#define PHUSTR_24	"level 24: the final frontier"
#define PHUSTR_25	"level 25: the temple of darkness"
#define PHUSTR_26	"level 26: bunker"
#define PHUSTR_27	"level 27: anti-christ"
#define PHUSTR_28	"level 28: the sewers"
#define PHUSTR_29	"level 29: odyssey of noises"
#define PHUSTR_30	"level 30: the gateway of hell"

#define PHUSTR_31	"level 31: cyberden"
#define PHUSTR_32	"level 32: go 2 it"

#define THUSTR_1	"level 1: system control"
#define THUSTR_2	"level 2: human bbq"
#define THUSTR_3	"level 3: power control"
#define THUSTR_4	"level 4: wormhole"
#define THUSTR_5	"level 5: hanger"
#define THUSTR_6	"level 6: open season"
#define THUSTR_7	"level 7: prison"
#define THUSTR_8	"level 8: metal"
#define THUSTR_9	"level 9: stronghold"
#define THUSTR_10	"level 10: redemption"
#define THUSTR_11	"level 11: storage facility"

#define THUSTR_12	"level 12: crater"
#define THUSTR_13	"level 13: nukage processing"
#define THUSTR_14	"level 14: steel works"
#define THUSTR_15	"level 15: dead zone"
#define THUSTR_16	"level 16: deepest reaches"
#define THUSTR_17	"level 17: processing area"
#define THUSTR_18	"level 18: mill"
#define THUSTR_19	"level 19: shipping/respawning"
#define THUSTR_20	"level 20: central processing"

#define THUSTR_21	"level 21: administration center"
#define THUSTR_22	"level 22: habitat"
#define THUSTR_23	"level 23: lunar mining project"
#define THUSTR_24	"level 24: quarry"
#define THUSTR_25	"level 25: baron's den"
#define THUSTR_26	"level 26: ballistyx"
#define THUSTR_27	"level 27: mount pain"
#define THUSTR_28	"level 28: heck"
#define THUSTR_29	"level 29: river styx"
#define THUSTR_30	"level 30: last call"

#define THUSTR_31	"level 31: pharaoh"
#define THUSTR_32	"level 32: caribbean"

#define HUSTR_CHATMACRO1	"I'm ready to kick butt!"
#define HUSTR_CHATMACRO2	"I'm OK."
#define HUSTR_CHATMACRO3	"I'm not looking too good!"
#define HUSTR_CHATMACRO4	"Help!"
#define HUSTR_CHATMACRO5	"You suck!"
#define HUSTR_CHATMACRO6	"Next time, scumbag..."
#define HUSTR_CHATMACRO7	"Come here!"
#define HUSTR_CHATMACRO8	"I'll take care of it."
#define HUSTR_CHATMACRO9	"Yes"
#define HUSTR_CHATMACRO0	"No"

#define HUSTR_TALKTOSELF1	"You mumble to yourself"
#define HUSTR_TALKTOSELF2	"Who's there?"
#define HUSTR_TALKTOSELF3	"You scare yourself"
#define HUSTR_TALKTOSELF4	"You start to rave"
#define HUSTR_TALKTOSELF5	"You've lost it..."

#define HUSTR_MESSAGESENT	"[Message Sent]"

// The following should NOT be changed unless it seems
// just AWFULLY necessary

#define HUSTR_PLRGREEN	"Green: "
#define HUSTR_PLRINDIGO	"Indigo: "
#define HUSTR_PLRBROWN	"Brown: "
#define HUSTR_PLRRED		"Red: "

#define HUSTR_KEYGREEN	'g'
#define HUSTR_KEYINDIGO	'i'
#define HUSTR_KEYBROWN	'b'
#define HUSTR_KEYRED	'r'

//
//	AM_map.C
//

#define AMSTR_FOLLOWON	"Follow Mode ON"
#define AMSTR_FOLLOWOFF	"Follow Mode OFF"

#define AMSTR_GRIDON	"Grid ON"
#define AMSTR_GRIDOFF	"Grid OFF"

#define AMSTR_MARKEDSPOT	"Marked Spot"
#define AMSTR_MARKSCLEARED	"All Marks Cleared"

//
//	ST_stuff.C
//

#define STSTR_MUS		"Music Change"
#define STSTR_NOMUS		"IMPOSSIBLE SELECTION"
#define STSTR_DQDON		"Degreelessness Mode On"
#define STSTR_DQDOFF	"Degreelessness Mode Off"

#define STSTR_KFAADDED	"Very Happy Ammo Added"
#define STSTR_FAADDED	"Ammo (no keys) Added"

#define STSTR_NCON		"No Clipping Mode ON"
#define STSTR_NCOFF		"No Clipping Mode OFF"

#define STSTR_BEHOLD	"inVuln, Str, Inviso, Rad, Allmap, or Lite-amp"
#define STSTR_BEHOLDX	"Power-up Toggled"

#define STSTR_CHOPPERS	"... doesn't suck - GM"
#define STSTR_CLEV		"Changing Level..."

//
//	F_Finale.C
//
#define E1TEXT \
"Once you beat the big badasses and\n"\
"clean out the moon base you're supposed\n"\
"to win, aren't you? Aren't you? Where's\n"\
"your fat reward and ticket home? What\n"\
"the hell is this? It's not supposed to\n"\
"end this way!\n"\
"\n" \
"It stinks like rotten meat, but looks\n"\
"like the lost Deimos base.  Looks like\n"\
"you're stuck on The Shores of Hell.\n"\
"The only way out is through.\n"\
"\n"\
"To continue the DOOM experience, play\n"\
"The Shores of Hell and its amazing\n"\
"sequel, Inferno!\n"


#define E2TEXT \
"You've done it! The hideous cyber-\n"\
"demon lord that ruled the lost Deimos\n"\
"moon base has been slain and you\n"\
"are triumphant! But ... where are\n"\
"you? You clamber to the edge of the\n"\
"moon and look down to see the awful\n"\
"truth.\n" \
"\n"\
"Deimos floats above Hell itself!\n"\
"You've never heard of anyone escaping\n"\
"from Hell, but you'll make the bastards\n"\
"sorry they ever heard of you! Quickly,\n"\
"you rappel down to  the surface of\n"\
"Hell.\n"\
"\n" \
"Now, it's on to the final chapter of\n"\
"DOOM! -- Inferno."


#define E3TEXT \
"The loathsome spiderdemon that\n"\
"masterminded the invasion of the moon\n"\
"bases and caused so much death has had\n"\
"its ass kicked for all time.\n"\
"\n"\
"A hidden doorway opens and you enter.\n"\
"You've proven too tough for Hell to\n"\
"contain, and now Hell at last plays\n"\
"fair -- for you emerge from the door\n"\
"to see the green fields of Earth!\n"\
"Home at last.\n" \
"\n"\
"You wonder what's been happening on\n"\
"Earth while you were battling evil\n"\
"unleashed. It's good that no Hell-\n"\
"spawn could have come through that\n"\
"door with you ..."


#define E4TEXT \
"the spider mastermind must have sent forth\n"\
"its legions of hellspawn before your\n"\
"final confrontation with that terrible\n"\
"beast from hell.  but you stepped forward\n"\
"and brought forth eternal damnation and\n"\
"suffering upon the horde as a true hero\n"\
"would in the face of something so evil.\n"\
"\n"\
"besides, someone was gonna pay for what\n"\
"happened to daisy, your pet rabbit.\n"\
"\n"\
"but now, you see spread before you more\n"\
"potential pain and gibbitude as a nation\n"\
"of demons run amok among our cities.\n"\
"\n"\
"next stop, hell on earth!"


// after level 6, put this:

#define C1TEXT \
"YOU HAVE ENTERED DEEPLY INTO THE INFESTED\n" \
"STARPORT. BUT SOMETHING IS WRONG. THE\n" \
"MONSTERS HAVE BROUGHT THEIR OWN REALITY\n" \
"WITH THEM, AND THE STARPORT'S TECHNOLOGY\n" \
"IS BEING SUBVERTED BY THEIR PRESENCE.\n" \
"\n"\
"AHEAD, YOU SEE AN OUTPOST OF HELL, A\n" \
"FORTIFIED ZONE. IF YOU CAN GET PAST IT,\n" \
"YOU CAN PENETRATE INTO THE HAUNTED HEART\n" \
"OF THE STARBASE AND FIND THE CONTROLLING\n" \
"SWITCH WHICH HOLDS EARTH'S POPULATION\n" \
"HOSTAGE."

// After level 11, put this:

#define C2TEXT \
"YOU HAVE WON! YOUR VICTORY HAS ENABLED\n" \
"HUMANKIND TO EVACUATE EARTH AND ESCAPE\n"\
"THE NIGHTMARE.  NOW YOU ARE THE ONLY\n"\
"HUMAN LEFT ON THE FACE OF THE PLANET.\n"\
"CANNIBAL MUTATIONS, CARNIVOROUS ALIENS,\n"\
"AND EVIL SPIRITS ARE YOUR ONLY NEIGHBORS.\n"\
"YOU SIT BACK AND WAIT FOR DEATH, CONTENT\n"\
"THAT YOU HAVE SAVED YOUR SPECIES.\n"\
"\n"\
"BUT THEN, EARTH CONTROL BEAMS DOWN A\n"\
"MESSAGE FROM SPACE: \"SENSORS HAVE LOCATED\n"\
"THE SOURCE OF THE ALIEN INVASION. IF YOU\n"\
"GO THERE, YOU MAY BE ABLE TO BLOCK THEIR\n"\
"ENTRY.  THE ALIEN BASE IS IN THE HEART OF\n"\
"YOUR OWN HOME CITY, NOT FAR FROM THE\n"\
"STARPORT.\" SLOWLY AND PAINFULLY YOU GET\n"\
"UP AND RETURN TO THE FRAY."


// After level 20, put this:

#define C3TEXT \
"YOU ARE AT THE CORRUPT HEART OF THE CITY,\n"\
"SURROUNDED BY THE CORPSES OF YOUR ENEMIES.\n"\
"YOU SEE NO WAY TO DESTROY THE CREATURES'\n"\
"ENTRYWAY ON THIS SIDE, SO YOU CLENCH YOUR\n"\
"TEETH AND PLUNGE THROUGH IT.\n"\
"\n"\
"THERE MUST BE A WAY TO CLOSE IT ON THE\n"\
"OTHER SIDE. WHAT DO YOU CARE IF YOU'VE\n"\
"GOT TO GO THROUGH HELL TO GET TO IT?"


// After level 29, put this:

#define C4TEXT \
"THE HORRENDOUS VISAGE OF THE BIGGEST\n"\
"DEMON YOU'VE EVER SEEN CRUMBLES BEFORE\n"\
"YOU, AFTER YOU PUMP YOUR ROCKETS INTO\n"\
"HIS EXPOSED BRAIN. THE MONSTER SHRIVELS\n"\
"UP AND DIES, ITS THRASHING LIMBS\n"\
"DEVASTATING UNTOLD MILES OF HELL'S\n"\
"SURFACE.\n"\
"\n"\
"YOU'VE DONE IT. THE INVASION IS OVER.\n"\
"EARTH IS SAVED. HELL IS A WRECK. YOU\n"\
"WONDER WHERE BAD FOLKS WILL GO WHEN THEY\n"\
"DIE, NOW. WIPING THE SWEAT FROM YOUR\n"\
"FOREHEAD YOU BEGIN THE LONG TREK BACK\n"\
"HOME. REBUILDING EARTH OUGHT TO BE A\n"\
"LOT MORE FUN THAN RUINING IT WAS.\n"



// Before level 31, put this:

#define C5TEXT \
"CONGRATULATIONS, YOU'VE FOUND THE SECRET\n"\
"LEVEL! LOOKS LIKE IT'S BEEN BUILT BY\n"\
"HUMANS, RATHER THAN DEMONS. YOU WONDER\n"\
"WHO THE INMATES OF THIS CORNER OF HELL\n"\
"WILL BE."


// Before level 32, put this:

#define C6TEXT \
"CONGRATULATIONS, YOU'VE FOUND THE\n"\
"SUPER SECRET LEVEL!  YOU'D BETTER\n"\
"BLAZE THROUGH THIS ONE!\n"


// after map 06	

#define P1TEXT  \
"You gloat over the steaming carcass of the\n"\
"Guardian.  With its death, you've wrested\n"\
"the Accelerator from the stinking claws\n"\
"of Hell.  You relax and glance around the\n"\
"room.  Damn!  There was supposed to be at\n"\
"least one working prototype, but you can't\n"\
"see it. The demons must have taken it.\n"\
"\n"\
"You must find the prototype, or all your\n"\
"struggles will have been wasted. Keep\n"\
"moving, keep fighting, keep killing.\n"\
"Oh yes, keep living, too."


// after map 11

#define P2TEXT \
"Even the deadly Arch-Vile labyrinth could\n"\
"not stop you, and you've gotten to the\n"\
"prototype Accelerator which is soon\n"\
"efficiently and permanently deactivated.\n"\
"\n"\
"You're good at that kind of thing."


// after map 20

#define P3TEXT \
"You've bashed and battered your way into\n"\
"the heart of the devil-hive.  Time for a\n"\
"Search-and-Destroy mission, aimed at the\n"\
"Gatekeeper, whose foul offspring is\n"\
"cascading to Earth.  Yeah, he's bad. But\n"\
"you know who's worse!\n"\
"\n"\
"Grinning evilly, you check your gear, and\n"\
"get ready to give the bastard a little Hell\n"\
"of your own making!"

// after map 30

#define P4TEXT \
"The Gatekeeper's evil face is splattered\n"\
"all over the place.  As its tattered corpse\n"\
"collapses, an inverted Gate forms and\n"\
"sucks down the shards of the last\n"\
"prototype Accelerator, not to mention the\n"\
"few remaining demons.  You're done. Hell\n"\
"has gone back to pounding bad dead folks \n"\
"instead of good live ones.  Remember to\n"\
"tell your grandkids to put a rocket\n"\
"launcher in your coffin. If you go to Hell\n"\
"when you die, you'll need it for some\n"\
"final cleaning-up ..."

// before map 31

#define P5TEXT \
"You've found the second-hardest level we\n"\
"got. Hope you have a saved game a level or\n"\
"two previous.  If not, be prepared to die\n"\
"aplenty. For master marines only."

// before map 32

#define P6TEXT \
"Betcha wondered just what WAS the hardest\n"\
"level we had ready for ya?  Now you know.\n"\
"No one gets out alive."


#define T1TEXT \
"You've fought your way out of the infested\n"\
"experimental labs.   It seems that UAC has\n"\
"once again gulped it down.  With their\n"\
"high turnover, it must be hard for poor\n"\
"old UAC to buy corporate health insurance\n"\
"nowadays..\n"\
"\n"\
"Ahead lies the military complex, now\n"\
"swarming with diseased horrors hot to get\n"\
"their teeth into you. With luck, the\n"\
"complex still has some warlike ordnance\n"\
"laying around."


#define T2TEXT \
"You hear the grinding of heavy machinery\n"\
"ahead.  You sure hope they're not stamping\n"\
"out new hellspawn, but you're ready to\n"\
"ream out a whole herd if you have to.\n"\
"They might be planning a blood feast, but\n"\
"you feel about as mean as two thousand\n"\
"maniacs packed into one mad killer.\n"\
"\n"\
"You don't plan to go down easy."


#define T3TEXT \
"The vista opening ahead looks real damn\n"\
"familiar. Smells familiar, too -- like\n"\
"fried excrement. You didn't like this\n"\
"place before, and you sure as hell ain't\n"\
"planning to like it now. The more you\n"\
"brood on it, the madder you get.\n"\
"Hefting your gun, an evil grin trickles\n"\
"onto your face. Time to take some names."

#define T4TEXT \
"Suddenly, all is silent, from one horizon\n"\
"to the other. The agonizing echo of Hell\n"\
"fades away, the nightmare sky turns to\n"\
"blue, the heaps of monster corpses start \n"\
"to evaporate along with the evil stench \n"\
"that filled the air. Jeeze, maybe you've\n"\
"done it. Have you really won?\n"\
"\n"\
"Something rumbles in the distance.\n"\
"A blue light begins to glow inside the\n"\
"ruined skull of the demon-spitter."


#define T5TEXT \
"What now? Looks totally different. Kind\n"\
"of like King Tut's condo. Well,\n"\
"whatever's here can't be any worse\n"\
"than usual. Can it?  Or maybe it's best\n"\
"to let sleeping gods lie.."


#define T6TEXT \
"Time for a vacation. You've burst the\n"\
"bowels of hell and by golly you're ready\n"\
"for a break. You mutter to yourself,\n"\
"Maybe someone else can kick Hell's ass\n"\
"next time around. Ahead lies a quiet town,\n"\
"with peaceful flowing water, quaint\n"\
"buildings, and presumably no Hellspawn.\n"\
"\n"\
"As you step off the transport, you hear\n"\
"the stomp of a cyberdemon's iron shoe."



//
// Character cast strings F_FINALE.C
//
#define CC_ZOMBIE	"ZOMBIEMAN"
#define CC_SHOTGUN	"SHOTGUN GUY"
#define CC_HEAVY	"HEAVY WEAPON DUDE"
#define CC_IMP	"IMP"
#define CC_DEMON	"DEMON"
#define CC_LOST	"LOST SOUL"
#define CC_CACO	"CACODEMON"
#define CC_HELL	"HELL KNIGHT"
#define CC_BARON	"BARON OF HELL"
#define CC_ARACH	"ARACHNOTRON"
#define CC_PAIN	"PAIN ELEMENTAL"
#define CC_REVEN	"REVENANT"
#define CC_MANCU	"MANCUBUS"
#define CC_ARCH	"ARCH-VILE"
#define CC_SPIDER	"THE SPIDER MASTERMIND"
#define CC_CYBER	"THE CYBERDEMON"
#define CC_HERO	"OUR HERO"


#endif


================================================
FILE: fbdoom/d_event.c
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
//
// DESCRIPTION: Event handling.
//
// Events are asynchronous inputs generally generated by the game user.
// Events can be discarded if no responder claims them
//

#include <stdlib.h>
#include "d_event.h"

#define MAXEVENTS 64

static event_t events[MAXEVENTS];
static int eventhead;
static int eventtail;

//
// D_PostEvent
// Called by the I/O functions when input is detected
//
void D_PostEvent (event_t* ev)
{
    events[eventhead] = *ev;
    eventhead = (eventhead + 1) % MAXEVENTS;
}

// Read an event from the queue.

event_t *D_PopEvent(void)
{
    event_t *result;

    // No more events waiting.

    if (eventtail == eventhead)
    {
        return NULL;
    }
    
    result = &events[eventtail];

    // Advance to the next event in the queue.

    eventtail = (eventtail + 1) % MAXEVENTS;

    return result;
}




================================================
FILE: fbdoom/d_event.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//
//    


#ifndef __D_EVENT__
#define __D_EVENT__


#include "doomtype.h"


//
// Event handling.
//

// Input event types.
typedef enum
{
    ev_keydown,
    ev_keyup,
    ev_mouse,
    ev_joystick,
    ev_quit
} evtype_t;

// Event structure.
typedef struct
{
    evtype_t type;

    // Event-related data that depends on the type of event:
    //
    // ev_keydown/ev_keyup:
    //    data1: Key code (from doomkeys.h) of the key that was
    //           pressed or released.
    //    data2: Ascii text of the character that was pressed,
    //           shifted appropriately (eg. '$' if 4 was pressed
    //           while shift was held).
    //
    // ev_mouse:
    //    data1: Bitfield of buttons currently held down.
    //           (bit 0 = left; bit 1 = right; bit 2 = middle).
    //    data2: X axis mouse movement (turn).
    //    data3: Y axis mouse movement (forward/backward).
    //
    // ev_joystick:
    //    data1: Bitfield of buttons currently pressed.
    //    data2: X axis mouse movement (turn).
    //    data3: Y axis mouse movement (forward/backward).
    //    data4: Third axis mouse movement (strafe).

    int data1, data2, data3, data4;
} event_t;

 
//
// Button/action code definitions.
//
typedef enum
{
    // Press "Fire".
    BT_ATTACK		= 1,
    // Use button, to open doors, activate switches.
    BT_USE		= 2,

    // Flag: game events, not really buttons.
    BT_SPECIAL		= 128,
    BT_SPECIALMASK	= 3,
    
    // Flag, weapon change pending.
    // If true, the next 3 bits hold weapon num.
    BT_CHANGE		= 4,
    // The 3bit weapon mask and shift, convenience.
    BT_WEAPONMASK	= (8+16+32),
    BT_WEAPONSHIFT	= 3,

    // Pause the game.
    BTS_PAUSE		= 1,
    // Save the game at each console.
    BTS_SAVEGAME	= 2,

    // Savegame slot numbers
    //  occupy the second byte of buttons.    
    BTS_SAVEMASK	= (4+8+16),
    BTS_SAVESHIFT 	= 2,
  
} buttoncode_t;

// villsa [STRIFE] Strife specific buttons
// TODO - not finished
typedef enum
{
    // Player view look up
    BT2_LOOKUP          = 1,
    // Player view look down
    BT2_LOOKDOWN        = 2,
    // Center player's view
    BT2_CENTERVIEW      = 4,
    // Use inventory item
    BT2_INVUSE          = 8,
    // Drop inventory item
    BT2_INVDROP         = 16,
    // Jump up and down
    BT2_JUMP            = 32,
    // Use medkit
    BT2_HEALTH          = 128,
  
} buttoncode2_t;




// Called by IO functions when input is detected.
void D_PostEvent (event_t *ev);

// Read an event from the event queue

event_t *D_PopEvent(void);


#endif



================================================
FILE: fbdoom/d_items.c
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//


// We are referring to sprite numbers.
#include "info.h"

#include "d_items.h"


//
// PSPRITE ACTIONS for waepons.
// This struct controls the weapon animations.
//
// Each entry is:
//   ammo/amunition type
//  upstate
//  downstate
// readystate
// atkstate, i.e. attack/fire/hit frame
// flashstate, muzzle flash
//
weaponinfo_t	weaponinfo[NUMWEAPONS] =
{
    {
	// fist
	am_noammo,
	S_PUNCHUP,
	S_PUNCHDOWN,
	S_PUNCH,
	S_PUNCH1,
	S_NULL
    },	
    {
	// pistol
	am_clip,
	S_PISTOLUP,
	S_PISTOLDOWN,
	S_PISTOL,
	S_PISTOL1,
	S_PISTOLFLASH
    },	
    {
	// shotgun
	am_shell,
	S_SGUNUP,
	S_SGUNDOWN,
	S_SGUN,
	S_SGUN1,
	S_SGUNFLASH1
    },
    {
	// chaingun
	am_clip,
	S_CHAINUP,
	S_CHAINDOWN,
	S_CHAIN,
	S_CHAIN1,
	S_CHAINFLASH1
    },
    {
	// missile launcher
	am_misl,
	S_MISSILEUP,
	S_MISSILEDOWN,
	S_MISSILE,
	S_MISSILE1,
	S_MISSILEFLASH1
    },
    {
	// plasma rifle
	am_cell,
	S_PLASMAUP,
	S_PLASMADOWN,
	S_PLASMA,
	S_PLASMA1,
	S_PLASMAFLASH1
    },
    {
	// bfg 9000
	am_cell,
	S_BFGUP,
	S_BFGDOWN,
	S_BFG,
	S_BFG1,
	S_BFGFLASH1
    },
    {
	// chainsaw
	am_noammo,
	S_SAWUP,
	S_SAWDOWN,
	S_SAW,
	S_SAW1,
	S_NULL
    },
    {
	// super shotgun
	am_shell,
	S_DSGUNUP,
	S_DSGUNDOWN,
	S_DSGUN,
	S_DSGUN1,
	S_DSGUNFLASH1
    },	
};










================================================
FILE: fbdoom/d_items.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//	Items: key cards, artifacts, weapon, ammunition.
//


#ifndef __D_ITEMS__
#define __D_ITEMS__

#include "doomdef.h"



// Weapon info: sprite frames, ammunition use.
typedef struct
{
    ammotype_t	ammo;
    int		upstate;
    int		downstate;
    int		readystate;
    int		atkstate;
    int		flashstate;

} weaponinfo_t;

extern  weaponinfo_t    weaponinfo[NUMWEAPONS];

#endif


================================================
FILE: fbdoom/d_iwad.c
================================================
//
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//     Search for and locate an IWAD file, and initialize according
//     to the IWAD type.
//

#include <stdio.h>
#include <stdlib.h>
#include <ctype.h>
#include <string.h>

#include "config.h"
#include "deh_str.h"
#include "doomkeys.h"
#include "d_iwad.h"
#include "i_system.h"
#include "m_argv.h"
#include "m_config.h"
#include "m_misc.h"
#include "w_wad.h"
#include "z_zone.h"

static const iwad_t iwads[] =
{
    { "doom2.wad",    doom2,     commercial, "Doom II" },
    { "plutonia.wad", pack_plut, commercial, "Final Doom: Plutonia Experiment" },
    { "tnt.wad",      pack_tnt,  commercial, "Final Doom: TNT: Evilution" },
    { "doom.wad",     doom,      retail,     "Doom" },
    { "DOOM1.WAD",    doom,      shareware,  "Doom Shareware" },
    { "chex.wad",     pack_chex, shareware,  "Chex Quest" },
    { "hacx.wad",     pack_hacx, commercial, "Hacx" },
    { "freedm.wad",   doom2,     commercial, "FreeDM" },
    { "freedoom2.wad", doom2,    commercial, "Freedoom: Phase 2" },
    { "freedoom1.wad", doom,     retail,     "Freedoom: Phase 1" },
    { "heretic.wad",  heretic,   retail,     "Heretic" },
    { "heretic1.wad", heretic,   shareware,  "Heretic Shareware" },
    { "hexen.wad",    hexen,     commercial, "Hexen" },
    //{ "strife0.wad",  strife,    commercial, "Strife" }, // haleyjd: STRIFE-FIXME
    { "strife1.wad",  strife,    commercial, "Strife" },
};

// Array of locations to search for IWAD files
//
// "128 IWAD search directories should be enough for anybody".

#define MAX_IWAD_DIRS 128

static boolean iwad_dirs_built = false;
static char *iwad_dirs[MAX_IWAD_DIRS];
static int num_iwad_dirs = 0;

static void AddIWADDir(char *dir)
{
    if (num_iwad_dirs < MAX_IWAD_DIRS)
    {
        iwad_dirs[num_iwad_dirs] = dir;
        ++num_iwad_dirs;
    }
}

// This is Windows-specific code that automatically finds the location
// of installed IWAD files.  The registry is inspected to find special
// keys installed by the Windows installers for various CD versions
// of Doom.  From these keys we can deduce where to find an IWAD.

#if defined(_WIN32) && !defined(_WIN32_WCE)

#define WIN32_LEAN_AND_MEAN
#include <windows.h>

typedef struct 
{
    HKEY root;
    char *path;
    char *value;
} registry_value_t;

#define UNINSTALLER_STRING "\\uninstl.exe /S "

// Keys installed by the various CD editions.  These are actually the 
// commands to invoke the uninstaller and look like this:
//
// C:\Program Files\Path\uninstl.exe /S C:\Program Files\Path
//
// With some munging we can find where Doom was installed.

// [AlexMax] From the persepctive of a 64-bit executable, 32-bit registry
// keys are located in a different spot.
#if _WIN64
#define SOFTWARE_KEY "Software\\Wow6432Node"
#else
#define SOFTWARE_KEY "Software"
#endif

static registry_value_t uninstall_values[] =
{
    // Ultimate Doom, CD version (Depths of Doom trilogy)

    {
        HKEY_LOCAL_MACHINE,
        SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
            "Uninstall\\Ultimate Doom for Windows 95",
        "UninstallString",
    },

    // Doom II, CD version (Depths of Doom trilogy)

    {
        HKEY_LOCAL_MACHINE,
        SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
            "Uninstall\\Doom II for Windows 95",
        "UninstallString",
    },

    // Final Doom

    {
        HKEY_LOCAL_MACHINE,
        SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
            "Uninstall\\Final Doom for Windows 95",
        "UninstallString",
    },

    // Shareware version

    {
        HKEY_LOCAL_MACHINE,
        SOFTWARE_KEY "\\Microsoft\\Windows\\CurrentVersion\\"
            "Uninstall\\Doom Shareware for Windows 95",
        "UninstallString",
    },
};

// Value installed by the Collector's Edition when it is installed

static registry_value_t collectors_edition_value =
{
    HKEY_LOCAL_MACHINE,
    SOFTWARE_KEY "\\Activision\\DOOM Collector's Edition\\v1.0",
    "INSTALLPATH",
};

// Subdirectories of the above install path, where IWADs are installed.

static char *collectors_edition_subdirs[] = 
{
    "Doom2",
    "Final Doom",
    "Ultimate Doom",
};

// Location where Steam is installed

static registry_value_t steam_install_location =
{
    HKEY_LOCAL_MACHINE,
    SOFTWARE_KEY "\\Valve\\Steam",
    "InstallPath",
};

// Subdirs of the steam install directory where IWADs are found

static char *steam_install_subdirs[] =
{
    "steamapps\\common\\doom 2\\base",
    "steamapps\\common\\final doom\\base",
    "steamapps\\common\\ultimate doom\\base",
    "steamapps\\common\\heretic shadow of the serpent riders\\base",
    "steamapps\\common\\hexen\\base",
    "steamapps\\common\\hexen deathkings of the dark citadel\\base",

    // From Doom 3: BFG Edition:

    "steamapps\\common\\DOOM 3 BFG Edition\\base\\wads",
};

#define STEAM_BFG_GUS_PATCHES \
    "steamapps\\common\\DOOM 3 BFG Edition\\base\\classicmusic\\instruments"

static char *GetRegistryString(registry_value_t *reg_val)
{
    HKEY key;
    DWORD len;
    DWORD valtype;
    char *result;

    // Open the key (directory where the value is stored)

    if (RegOpenKeyEx(reg_val->root, reg_val->path,
                     0, KEY_READ, &key) != ERROR_SUCCESS)
    {
        return NULL;
    }

    result = NULL;

    // Find the type and length of the string, and only accept strings.

    if (RegQueryValueEx(key, reg_val->value,
                        NULL, &valtype, NULL, &len) == ERROR_SUCCESS
     && valtype == REG_SZ)
    {
        // Allocate a buffer for the value and read the value

        result = malloc(len);

        if (RegQueryValueEx(key, reg_val->value, NULL, &valtype,
                            (unsigned char *) result, &len) != ERROR_SUCCESS)
        {
            free(result);
            result = NULL;
        }
    }

    // Close the key

    RegCloseKey(key);

    return result;
}

// Check for the uninstall strings from the CD versions

static void CheckUninstallStrings(void)
{
    unsigned int i;

    for (i=0; i<arrlen(uninstall_values); ++i)
    {
        char *val;
        char *path;
        char *unstr;

        val = GetRegistryString(&uninstall_values[i]);

        if (val == NULL)
        {
            continue;
        }

        unstr = strstr(val, UNINSTALLER_STRING);

        if (unstr == NULL)
        {
            free(val);
        }
        else
        {
            path = unstr + strlen(UNINSTALLER_STRING);

            AddIWADDir(path);
        }
    }
}

// Check for Doom: Collector's Edition

static void CheckCollectorsEdition(void)
{
    char *install_path;
    char *subpath;
    unsigned int i;

    install_path = GetRegistryString(&collectors_edition_value);

    if (install_path == NULL)
    {
        return;
    }

    for (i=0; i<arrlen(collectors_edition_subdirs); ++i)
    {
        subpath = M_StringJoin(install_path, DIR_SEPARATOR_S,
                               collectors_edition_subdirs[i], NULL);

        AddIWADDir(subpath);
    }

    free(install_path);
}


// Check for Doom downloaded via Steam

static void CheckSteamEdition(void)
{
    char *install_path;
    char *subpath;
    size_t i;

    install_path = GetRegistryString(&steam_install_location);

    if (install_path == NULL)
    {
        return;
    }

    for (i=0; i<arrlen(steam_install_subdirs); ++i)
    {
        subpath = M_StringJoin(install_path, DIR_SEPARATOR_S,
                               steam_install_subdirs[i], NULL);

        AddIWADDir(subpath);
    }

    free(install_path);
}

// The BFG edition ships with a full set of GUS patches. If we find them,
// we can autoconfigure to use them.

static void CheckSteamGUSPatches(void)
{
    const char *current_path;
    char *install_path;
    char *patch_path;
    int len;

    // Already configured? Don't stomp on the user's choices.
    current_path = M_GetStrVariable("gus_patch_path");
    if (current_path != NULL && strlen(current_path) > 0)
    {
        return;
    }

    install_path = GetRegistryString(&steam_install_location);

    if (install_path == NULL)
    {
        return;
    }

    len = strlen(install_path) + strlen(STEAM_BFG_GUS_PATCHES) + 20;
    patch_path = malloc(len);
    M_snprintf(patch_path, len, "%s\\%s\\ACBASS.PAT",
               install_path, STEAM_BFG_GUS_PATCHES);

    // Does acbass.pat exist? If so, then set gus_patch_path.
    if (M_FileExists(patch_path))
    {
        M_snprintf(patch_path, len, "%s\\%s",
                   install_path, STEAM_BFG_GUS_PATCHES);
        M_SetVariable("gus_patch_path", patch_path);
    }

    free(patch_path);
    free(install_path);
}

// Default install directories for DOS Doom

static void CheckDOSDefaults(void)
{
    // These are the default install directories used by the deice
    // installer program:

    AddIWADDir("\\doom2");              // Doom II
    AddIWADDir("\\plutonia");           // Final Doom
    AddIWADDir("\\tnt");
    AddIWADDir("\\doom_se");            // Ultimate Doom
    AddIWADDir("\\doom");               // Shareware / Registered Doom
    AddIWADDir("\\dooms");              // Shareware versions
    AddIWADDir("\\doomsw");

    AddIWADDir("\\heretic");            // Heretic
    AddIWADDir("\\hrtic_se");           // Heretic Shareware from Quake disc

    AddIWADDir("\\hexen");              // Hexen
    AddIWADDir("\\hexendk");            // Hexen Deathkings of the Dark Citadel

    AddIWADDir("\\strife");             // Strife
}

#endif

// Returns true if the specified path is a path to a file
// of the specified name.

static boolean DirIsFile(char *path, char *filename)
{
    size_t path_len;
    size_t filename_len;

    path_len = strlen(path);
    filename_len = strlen(filename);

    return path_len >= filename_len + 1
        && path[path_len - filename_len - 1] == DIR_SEPARATOR
        && !strcasecmp(&path[path_len - filename_len], filename);
}

// Check if the specified directory contains the specified IWAD
// file, returning the full path to the IWAD if found, or NULL
// if not found.

static char *CheckDirectoryHasIWAD(char *dir, char *iwadname)
{
    char *filename; 

    // As a special case, the "directory" may refer directly to an
    // IWAD file if the path comes from DOOMWADDIR or DOOMWADPATH.

    if (DirIsFile(dir, iwadname) && M_FileExists(dir))
    {
        return strdup(dir);
    }

    // Construct the full path to the IWAD if it is located in
    // this directory, and check if it exists.

    if (!strcmp(dir, "."))
    {
        filename = strdup(iwadname);
    }
    else
    {
        filename = M_StringJoin(dir, DIR_SEPARATOR_S, iwadname, NULL);
    }

    if (M_FileExists(filename))
    {
        return filename;
    }

    free(filename);

    return NULL;
}

// Search a directory to try to find an IWAD
// Returns the location of the IWAD if found, otherwise NULL.

static char *SearchDirectoryForIWAD(char *dir, int mask, GameMission_t *mission)
{
    char *filename;
    size_t i;

    for (i=0; i<arrlen(iwads); ++i) 
    {
        if (((1 << iwads[i].mission) & mask) == 0)
        {
            continue;
        }

        filename = CheckDirectoryHasIWAD(dir, DEH_String(iwads[i].name));

        if (filename != NULL)
        {
            *mission = iwads[i].mission;

            return filename;
        }
    }

    return NULL;
}

// When given an IWAD with the '-iwad' parameter,
// attempt to identify it by its name.

static GameMission_t IdentifyIWADByName(char *name, int mask)
{
    size_t i;
    GameMission_t mission;
    char *p;

    p = strrchr(name, DIR_SEPARATOR);

    if (p != NULL)
    {
        name = p + 1;
    }

    mission = none;

    for (i=0; i<arrlen(iwads); ++i)
    {
        // Check if the filename is this IWAD name.

        // Only use supported missions:

        if (((1 << iwads[i].mission) & mask) == 0)
            continue;

        // Check if it ends in this IWAD name.

        if (!strcasecmp(name, iwads[i].name))
        {
            mission = iwads[i].mission;
            break;
        }
    }

    return mission;
}

#if ORIGCODE
//
// Add directories from the list in the DOOMWADPATH environment variable.
//

static void AddDoomWadPath(void)
{
    char *doomwadpath;
    char *p;

    // Check the DOOMWADPATH environment variable.

    doomwadpath = getenv("DOOMWADPATH");

    if (doomwadpath == NULL)
    {
        return;
    }

    doomwadpath = strdup(doomwadpath);

    // Add the initial directory

    AddIWADDir(doomwadpath);

    // Split into individual dirs within the list.

    p = doomwadpath;

    for (;;)
    {
        p = strchr(p, PATH_SEPARATOR);

        if (p != NULL)
        {
            // Break at the separator and store the right hand side
            // as another iwad dir
  
            *p = '\0';
            p += 1;

            AddIWADDir(p);
        }
        else
        {
            break;
        }
    }
}

#endif

//
// Build a list of IWAD files
//

static void BuildIWADDirList(void)
{
#if ORIGCODE
    char *doomwaddir;

    if (iwad_dirs_built)
    {
        return;
    }

    // Look in the current directory.  Doom always does this.

    AddIWADDir(".");

    // Add DOOMWADDIR if it is in the environment

    doomwaddir = getenv("DOOMWADDIR");

    if (doomwaddir != NULL)
    {
        AddIWADDir(doomwaddir);
    }        

    // Add dirs from DOOMWADPATH

    AddDoomWadPath();

#ifdef _WIN32

    // Search the registry and find where IWADs have been installed.

    CheckUninstallStrings();
    CheckCollectorsEdition();
    CheckSteamEdition();
    CheckDOSDefaults();

    // Check for GUS patches installed with the BFG edition!

    CheckSteamGUSPatches();

#else

    // Standard places where IWAD files are installed under Unix.

    AddIWADDir("/usr/share/games/doom");
    AddIWADDir("/usr/local/share/games/doom");

#endif
#else
    AddIWADDir (FILES_DIR);

    // Don't run this function again.

    iwad_dirs_built = true;
#endif
}

//
// Searches WAD search paths for an WAD with a specific filename.
// 

char *D_FindWADByName(char *name)
{
    char *path;
    int i;
    
    // Absolute path?

    if (M_FileExists(name))
    {
        return name;
    }

    BuildIWADDirList();

    // Search through all IWAD paths for a file with the given name.

    for (i=0; i<num_iwad_dirs; ++i)
    {
        // As a special case, if this is in DOOMWADDIR or DOOMWADPATH,
        // the "directory" may actually refer directly to an IWAD
        // file.

        if (DirIsFile(iwad_dirs[i], name) && M_FileExists(iwad_dirs[i]))
        {
            return strdup(iwad_dirs[i]);
        }

        // Construct a string for the full path

        path = M_StringJoin(iwad_dirs[i], DIR_SEPARATOR_S, name, NULL);

        if (M_FileExists(path))
        {
            return path;
        }

        free(path);
    }

    // File not found

    return NULL;
}

//
// D_TryWADByName
//
// Searches for a WAD by its filename, or passes through the filename
// if not found.
//

char *D_TryFindWADByName(char *filename)
{
    char *result;

    result = D_FindWADByName(filename);

    if (result != NULL)
    {
        return result;
    }
    else
    {
        return filename;
    }
}

//
// FindIWAD
// Checks availability of IWAD files by name,
// to determine whether registered/commercial features
// should be executed (notably loading PWADs).
//

char *D_FindIWAD(int mask, GameMission_t *mission)
{
    char *result;
    char *iwadfile;
    int iwadparm;
    int i;

    // Check for the -iwad parameter

    //!
    // Specify an IWAD file to use.
    //
    // @arg <file>
    //

    iwadparm = M_CheckParmWithArgs("-iwad", 1);

    if (iwadparm)
    {
        // Search through IWAD dirs for an IWAD with the given name.

        iwadfile = myargv[iwadparm + 1];

        result = D_FindWADByName(iwadfile);

        if (result == NULL)
        {
            I_Error("IWAD file '%s' not found!", iwadfile);
        }
        
        *mission = IdentifyIWADByName(result, mask);
    }
    else
    {
        // Search through the list and look for an IWAD

        result = NULL;

        BuildIWADDirList();
    
        for (i=0; result == NULL && i<num_iwad_dirs; ++i)
        {
            result = SearchDirectoryForIWAD(iwad_dirs[i], mask, mission);
        }
    }

    return result;
}

// Find all IWADs in the IWAD search path matching the given mask.

const iwad_t **D_FindAllIWADs(int mask)
{
    const iwad_t **result;
    int result_len;
    char *filename;
    int i;

    result = malloc(sizeof(iwad_t *) * (arrlen(iwads) + 1));
    result_len = 0;

    // Try to find all IWADs

    for (i=0; i<arrlen(iwads); ++i)
    {
        if (((1 << iwads[i].mission) & mask) == 0)
        {
            continue;
        }

        filename = D_FindWADByName(iwads[i].name);

        if (filename != NULL)
        {
            result[result_len] = &iwads[i];
            ++result_len;
        }
    }

    // End of list

    result[result_len] = NULL;

    return result;
}

//
// Get the IWAD name used for savegames.
//

char *D_SaveGameIWADName(GameMission_t gamemission)
{
    size_t i;

    // Determine the IWAD name to use for savegames.
    // This determines the directory the savegame files get put into.
    //
    // Note that we match on gamemission rather than on IWAD name.
    // This ensures that doom1.wad and doom.wad saves are stored
    // in the same place.

    for (i=0; i<arrlen(iwads); ++i)
    {
        if (gamemission == iwads[i].mission)
        {
            return iwads[i].name;
        }
    }

    // Default fallback:

    return "unknown.wad";
}

char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode)
{
    int i;

    for (i = 0; i < arrlen(iwads); ++i)
    {
        if (iwads[i].mission == mission && iwads[i].mode == mode)
        {
            return iwads[i].name;
        }
    }

    return "unknown.wad";
}

char *D_SuggestGameName(GameMission_t mission, GameMode_t mode)
{
    int i;

    for (i = 0; i < arrlen(iwads); ++i)
    {
        if (iwads[i].mission == mission
         && (mode == indetermined || iwads[i].mode == mode))
        {
            return iwads[i].description;
        }
    }

    return "Unknown game?";
}



================================================
FILE: fbdoom/d_iwad.h
================================================
//
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//     Find IWAD and initialize according to IWAD type.
//


#ifndef __D_IWAD__
#define __D_IWAD__

#include "d_mode.h"

#define IWAD_MASK_DOOM    ((1 << doom)           \
                         | (1 << doom2)          \
                         | (1 << pack_tnt)       \
                         | (1 << pack_plut)      \
                         | (1 << pack_chex)      \
                         | (1 << pack_hacx))
#define IWAD_MASK_HERETIC (1 << heretic)
#define IWAD_MASK_HEXEN   (1 << hexen)
#define IWAD_MASK_STRIFE  (1 << strife)

typedef struct
{
    char *name;
    GameMission_t mission;
    GameMode_t mode;
    char *description;
} iwad_t;

char *D_FindWADByName(char *filename);
char *D_TryFindWADByName(char *filename);
char *D_FindIWAD(int mask, GameMission_t *mission);
const iwad_t **D_FindAllIWADs(int mask);
char *D_SaveGameIWADName(GameMission_t gamemission);
char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode);
char *D_SuggestGameName(GameMission_t mission, GameMode_t mode);
void D_CheckCorrectIWAD(GameMission_t mission);

#endif



================================================
FILE: fbdoom/d_loop.c
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//     Main loop code.
//

#include <stdlib.h>
#include <string.h>

#include "doomfeatures.h"

#include "d_event.h"
#include "d_loop.h"
#include "d_ticcmd.h"

#include "i_system.h"
#include "i_timer.h"
#include "i_video.h"

#include "m_argv.h"
#include "m_fixed.h"

#include "net_client.h"
#include "net_gui.h"
#include "net_io.h"
#include "net_query.h"
#include "net_server.h"
#include "net_sdl.h"
#include "net_loop.h"

// The complete set of data for a particular tic.

typedef struct
{
    ticcmd_t cmds[NET_MAXPLAYERS];
    boolean ingame[NET_MAXPLAYERS];
} ticcmd_set_t;

//
// gametic is the tic about to (or currently being) run
// maketic is the tic that hasn't had control made for it yet
// recvtic is the latest tic received from the server.
//
// a gametic cannot be run until ticcmds are received for it
// from all players.
//

static ticcmd_set_t ticdata[BACKUPTICS];

// The index of the next tic to be made (with a call to BuildTiccmd).

static int maketic;

// The number of complete tics received from the server so far.

static int recvtic;

// The number of tics that have been run (using RunTic) so far.

int gametic;

// When set to true, a single tic is run each time TryRunTics() is called.
// This is used for -timedemo mode.

boolean singletics = false;

// Index of the local player.

static int localplayer;

// Used for original sync code.

static int      skiptics = 0;

// Reduce the bandwidth needed by sampling game input less and transmitting
// less.  If ticdup is 2, sample half normal, 3 = one third normal, etc.

int		ticdup;

// Amount to offset the timer for game sync.

fixed_t         offsetms;

// Use new client syncronisation code

static boolean  new_sync = true;

// Callback functions for loop code.

static loop_interface_t *loop_interface = NULL;

// Current players in the multiplayer game.
// This is distinct from playeringame[] used by the game code, which may
// modify playeringame[] when playing back multiplayer demos.

static boolean local_playeringame[NET_MAXPLAYERS];

// Requested player class "sent" to the server on connect.
// If we are only doing a single player game then this needs to be remembered
// and saved in the game settings.

static int player_class;


// 35 fps clock adjusted by offsetms milliseconds

static int GetAdjustedTime(void)
{
    int time_ms;

    time_ms = I_GetTimeMS();

    if (new_sync)
    {
	// Use the adjustments from net_client.c only if we are
	// using the new sync mode.

        time_ms += (offsetms / FRACUNIT);
    }

    return (time_ms * TICRATE) / 1000;
}

static boolean BuildNewTic(void)
{
    int	gameticdiv;
    ticcmd_t cmd;

    gameticdiv = gametic/ticdup;

    I_StartTic ();
    loop_interface->ProcessEvents();

    // Always run the menu

    loop_interface->RunMenu();

    if (drone)
    {
        // In drone mode, do not generate any ticcmds.

        return false;
    }

    if (new_sync)
    {
       // If playing single player, do not allow tics to buffer
       // up very far

       if (!net_client_connected && maketic - gameticdiv > 2)
           return false;

       // Never go more than ~200ms ahead

       if (maketic - gameticdiv > 8)
           return false;
    }
    else
    {
       if (maketic - gameticdiv >= 5)
           return false;
    }

    //printf ("mk:%i ",maketic);
    memset(&cmd, 0, sizeof(ticcmd_t));
    loop_interface->BuildTiccmd(&cmd, maketic);

#ifdef FEATURE_MULTIPLAYER

    if (net_client_connected)
    {
        NET_CL_SendTiccmd(&cmd, maketic);
    }

#endif
    ticdata[maketic % BACKUPTICS].cmds[localplayer] = cmd;
    ticdata[maketic % BACKUPTICS].ingame[localplayer] = true;

    ++maketic;

    return true;
}

//
// NetUpdate
// Builds ticcmds for console player,
// sends out a packet
//
int      lasttime;

void NetUpdate (void)
{
    int nowtime;
    int newtics;
    int	i;

    // If we are running with singletics (timing a demo), this
    // is all done separately.

    if (singletics)
        return;

#ifdef FEATURE_MULTIPLAYER

    // Run network subsystems

    NET_CL_Run();
    NET_SV_Run();

#endif

    // check time
    nowtime = GetAdjustedTime() / ticdup;
    newtics = nowtime - lasttime;

    lasttime = nowtime;

    if (skiptics <= newtics)
    {
        newtics -= skiptics;
        skiptics = 0;
    }
    else
    {
        skiptics -= newtics;
        newtics = 0;
    }

    // build new ticcmds for console player

    for (i=0 ; i<newtics ; i++)
    {
        if (!BuildNewTic())
        {
            break;
        }
    }
}

static void D_Disconnected(void)
{
    // In drone mode, the game cannot continue once disconnected.

    if (drone)
    {
        I_Error("Disconnected from server in drone mode.");
    }

    // disconnected from server

    printf("Disconnected from server.\n");
}

//
// Invoked by the network engine when a complete set of ticcmds is
// available.
//

void D_ReceiveTic(ticcmd_t *ticcmds, boolean *players_mask)
{
    int i;

    // Disconnected from server?

    if (ticcmds == NULL && players_mask == NULL)
    {
        D_Disconnected();
        return;
    }

    for (i = 0; i < NET_MAXPLAYERS; ++i)
    {
        if (!drone && i == localplayer)
        {
            // This is us.  Don't overwrite it.
        }
        else
        {
            ticdata[recvtic % BACKUPTICS].cmds[i] = ticcmds[i];
            ticdata[recvtic % BACKUPTICS].ingame[i] = players_mask[i];
        }
    }

    ++recvtic;
}

//
// Start game loop
//
// Called after the screen is set but before the game starts running.
//

void D_StartGameLoop(void)
{
    lasttime = GetAdjustedTime() / ticdup;
}

#if ORIGCODE
//
// Block until the game start message is received from the server.
//

static void BlockUntilStart(net_gamesettings_t *settings,
                            netgame_startup_callback_t callback)
{
    while (!NET_CL_GetSettings(settings))
    {
        NET_CL_Run();
        NET_SV_Run();

        if (!net_client_connected)
        {
            I_Error("Lost connection to server");
        }

        if (callback != NULL && !callback(net_client_wait_data.ready_players,
                                          net_client_wait_data.num_players))
        {
            I_Error("Netgame startup aborted.");
        }

        I_Sleep(100);
    }
}

#endif

void D_StartNetGame(net_gamesettings_t *settings,
                    netgame_startup_callback_t callback)
{
#if ORIGCODE
    int i;

    offsetms = 0;
    recvtic = 0;

    settings->consoleplayer = 0;
    settings->num_players = 1;
    settings->player_classes[0] = player_class;

    //!
    // @category net
    //
    // Use new network client sync code rather than the classic
    // sync code. This is currently disabled by default because it
    // has some bugs.
    //
    if (M_CheckParm("-newsync") > 0)
        settings->new_sync = 1;
    else
        settings->new_sync = 0;

    // TODO: New sync code is not enabled by default because it's
    // currently broken. 
    //if (M_CheckParm("-oldsync") > 0)
    //    settings->new_sync = 0;
    //else
    //    settings->new_sync = 1;

    //!
    // @category net
    // @arg <n>
    //
    // Send n extra tics in every packet as insurance against dropped
    // packets.
    //

    i = M_CheckParmWithArgs("-extratics", 1);

    if (i > 0)
        settings->extratics = atoi(myargv[i+1]);
    else
        settings->extratics = 1;

    //!
    // @category net
    // @arg <n>
    //
    // Reduce the resolution of the game by a factor of n, reducing
    // the amount of network bandwidth needed.
    //

    i = M_CheckParmWithArgs("-dup", 1);

    if (i > 0)
        settings->ticdup = atoi(myargv[i+1]);
    else
        settings->ticdup = 1;

    if (net_client_connected)
    {
        // Send our game settings and block until game start is received
        // from the server.

        NET_CL_StartGame(settings);
        BlockUntilStart(settings, callback);

        // Read the game settings that were received.

        NET_CL_GetSettings(settings);
    }

    if (drone)
    {
        settings->consoleplayer = 0;
    }

    // Set the local player and playeringame[] values.

    localplayer = settings->consoleplayer;

    for (i = 0; i < NET_MAXPLAYERS; ++i)
    {
        local_playeringame[i] = i < settings->num_players;
    }

    // Copy settings to global variables.

    ticdup = settings->ticdup;
    new_sync = settings->new_sync;

    // TODO: Message disabled until we fix new_sync.
    //if (!new_sync)
    //{
    //    printf("Syncing netgames like Vanilla Doom.\n");
    //}
#else
    settings->consoleplayer = 0;
	settings->num_players = 1;
	settings->player_classes[0] = player_class;
	settings->new_sync = 0;
	settings->extratics = 1;
	settings->ticdup = 1;

	ticdup = settings->ticdup;
	new_sync = settings->new_sync;
#endif
}

boolean D_InitNetGame(net_connect_data_t *connect_data)
{
    boolean result = false;
#ifdef FEATURE_MULTIPLAYER
    net_addr_t *addr = NULL;
    int i;
#endif

    // Call D_QuitNetGame on exit:

    I_AtExit(D_QuitNetGame, true);

    player_class = connect_data->player_class;

#ifdef FEATURE_MULTIPLAYER

    //!
    // @category net
    //
    // Start a multiplayer server, listening for connections.
    //

    if (M_CheckParm("-server") > 0
     || M_CheckParm("-privateserver") > 0)
    {
        NET_SV_Init();
        NET_SV_AddModule(&net_loop_server_module);
        NET_SV_AddModule(&net_sdl_module);
        NET_SV_RegisterWithMaster();

        net_loop_client_module.InitClient();
        addr = net_loop_client_module.ResolveAddress(NULL);
    }
    else
    {
        //!
        // @category net
        //
        // Automatically search the local LAN for a multiplayer
        // server and join it.
        //

        i = M_CheckParm("-autojoin");

        if (i > 0)
        {
            addr = NET_FindLANServer();

            if (addr == NULL)
            {
                I_Error("No server found on local LAN");
            }
        }

        //!
        // @arg <address>
        // @category net
        //
        // Connect to a multiplayer server running on the given
        // address.
        //

        i = M_CheckParmWithArgs("-connect", 1);

        if (i > 0)
        {
            net_sdl_module.InitClient();
            addr = net_sdl_module.ResolveAddress(myargv[i+1]);

            if (addr == NULL)
            {
                I_Error("Unable to resolve '%s'\n", myargv[i+1]);
            }
        }
    }

    if (addr != NULL)
    {
        if (M_CheckParm("-drone") > 0)
        {
            connect_data->drone = true;
        }

        if (!NET_CL_Connect(addr, connect_data))
        {
            I_Error("D_InitNetGame: Failed to connect to %s\n",
                    NET_AddrToString(addr));
        }

        printf("D_InitNetGame: Connected to %s\n", NET_AddrToString(addr));

        // Wait for launch message received from server.

        NET_WaitForLaunch();

        result = true;
    }
#endif

    return result;
}


//
// D_QuitNetGame
// Called before quitting to leave a net game
// without hanging the other players
//
void D_QuitNetGame (void)
{
#ifdef FEATURE_MULTIPLAYER
    NET_SV_Shutdown();
    NET_CL_Disconnect();
#endif
}

static int GetLowTic(void)
{
    int lowtic;

    lowtic = maketic;

#ifdef FEATURE_MULTIPLAYER
    if (net_client_connected)
    {
        if (drone || recvtic < lowtic)
        {
            lowtic = recvtic;
        }
    }
#endif

    return lowtic;
}

static int frameon;
static int frameskip[4];
static int oldnettics;

static void OldNetSync(void)
{
    unsigned int i;
    int keyplayer = -1;

    frameon++;

    // ideally maketic should be 1 - 3 tics above lowtic
    // if we are consistantly slower, speed up time

    for (i=0 ; i<NET_MAXPLAYERS ; i++)
    {
        if (local_playeringame[i])
        {
            keyplayer = i;
            break;
        }
    }

    if (keyplayer < 0)
    {
        // If there are no players, we can never advance anyway

        return;
    }

    if (localplayer == keyplayer)
    {
        // the key player does not adapt
    }
    else
    {
        if (maketic <= recvtic)
        {
            lasttime--;
            // printf ("-");
        }

        frameskip[frameon & 3] = oldnettics > recvtic;
        oldnettics = maketic;

        if (frameskip[0] && frameskip[1] && frameskip[2] && frameskip[3])
        {
            skiptics = 1;
            // printf ("+");
        }
    }
}

// Returns true if there are players in the game:

static boolean PlayersInGame(void)
{
    boolean result = false;
    unsigned int i;

    // If we are connected to a server, check if there are any players
    // in the game.

    if (net_client_connected)
    {
        for (i = 0; i < NET_MAXPLAYERS; ++i)
        {
            result = result || local_playeringame[i];
        }
    }

    // Whether single or multi-player, unless we are running as a drone,
    // we are in the game.

    if (!drone)
    {
        result = true;
    }

    return result;
}

// When using ticdup, certain values must be cleared out when running
// the duplicate ticcmds.

static void TicdupSquash(ticcmd_set_t *set)
{
    ticcmd_t *cmd;
    unsigned int i;

    for (i = 0; i < NET_MAXPLAYERS ; ++i)
    {
        cmd = &set->cmds[i];
        cmd->chatchar = 0;
        if (cmd->buttons & BT_SPECIAL)
            cmd->buttons = 0;
    }
}

// When running in single player mode, clear all the ingame[] array
// except the local player.

static void SinglePlayerClear(ticcmd_set_t *set)
{
    unsigned int i;

    for (i = 0; i < NET_MAXPLAYERS; ++i)
    {
        if (i != localplayer)
        {
            set->ingame[i] = false;
        }
    }
}

//
// TryRunTics
//

void TryRunTics (void)
{
    int	i;
    int	lowtic;
    int	entertic;
    static int oldentertics;
    int realtics;
    int	availabletics;
    int	counts;

    // get real tics
    entertic = I_GetTime() / ticdup;
    realtics = entertic - oldentertics;
    oldentertics = entertic;

    // in singletics mode, run a single tic every time this function
    // is called.

    if (singletics)
    {
        BuildNewTic();
    }
    else
    {
        NetUpdate ();
    }

    lowtic = GetLowTic();

    availabletics = lowtic - gametic/ticdup;

    // decide how many tics to run

    if (new_sync)
    {
	counts = availabletics;
    }
    else
    {
        // decide how many tics to run
        if (realtics < availabletics-1)
            counts = realtics+1;
        else if (realtics < availabletics)
            counts = realtics;
        else
            counts = availabletics;

        if (counts < 1)
            counts = 1;

        if (net_client_connected)
        {
            OldNetSync();
        }
    }

    if (counts < 1)
	counts = 1;

    // wait for new tics if needed

    while (!PlayersInGame() || lowtic < gametic/ticdup + counts)
    {
	NetUpdate ();

        lowtic = GetLowTic();

	if (lowtic < gametic/ticdup)
	    I_Error ("TryRunTics: lowtic < gametic");

        // Don't stay in this loop forever.  The menu is still running,
        // so return to update the screen

	if (I_GetTime() / ticdup - entertic > 0)
	{
	    return;
	}

        I_Sleep(1);
    }

    // run the count * ticdup dics
    while (counts--)
    {
        ticcmd_set_t *set;

        if (!PlayersInGame())
        {
            return;
        }

        set = &ticdata[(gametic / ticdup) % BACKUPTICS];

        if (!net_client_connected)
        {
            SinglePlayerClear(set);
        }

	for (i=0 ; i<ticdup ; i++)
	{
            if (gametic/ticdup > lowtic)
                I_Error ("gametic>lowtic");

            memcpy(local_playeringame, set->ingame, sizeof(local_playeringame));

            loop_interface->RunTic(set->cmds, set->ingame);
	    gametic++;

	    // modify command for duplicated tics

            TicdupSquash(set);
	}

	NetUpdate ();	// check for new console commands
    }
}

void D_RegisterLoopCallbacks(loop_interface_t *i)
{
    loop_interface = i;
}


================================================
FILE: fbdoom/d_loop.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//	Main loop stuff.
//

#ifndef __D_LOOP__
#define __D_LOOP__

#include "net_defs.h"

// Callback function invoked while waiting for the netgame to start.
// The callback is invoked when new players are ready. The callback
// should return true, or return false to abort startup.

typedef boolean (*netgame_startup_callback_t)(int ready_players,
                                              int num_players);

typedef struct
{
    // Read events from the event queue, and process them.

    void (*ProcessEvents)();

    // Given the current input state, fill in the fields of the specified
    // ticcmd_t structure with data for a new tic.

    void (*BuildTiccmd)(ticcmd_t *cmd, int maketic);

    // Advance the game forward one tic, using the specified player input.

    void (*RunTic)(ticcmd_t *cmds, boolean *ingame);

    // Run the menu (runs independently of the game).

    void (*RunMenu)();
} loop_interface_t;

// Register callback functions for the main loop code to use.
void D_RegisterLoopCallbacks(loop_interface_t *i);

// Create any new ticcmds and broadcast to other players.
void NetUpdate (void);

// Broadcasts special packets to other players
//  to notify of game exit
void D_QuitNetGame (void);

//? how many ticks to run?
void TryRunTics (void);

// Called at start of game loop to initialize timers
void D_StartGameLoop(void);

// Initialize networking code and connect to server.

boolean D_InitNetGame(net_connect_data_t *connect_data);

// Start game with specified settings. The structure will be updated
// with the actual settings for the game.

void D_StartNetGame(net_gamesettings_t *settings,
                    netgame_startup_callback_t callback);

extern boolean singletics;
extern int gametic, ticdup;

#endif



================================================
FILE: fbdoom/d_main.c
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//	DOOM main program (D_DoomMain) and game loop (D_DoomLoop),
//	plus functions to determine game mode (shareware, registered),
//	parse command line parameters, configure game parameters (turbo),
//	and call the startup functions.
//


#include <ctype.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "config.h"
#include "deh_main.h"
#include "doomdef.h"
#include "doomstat.h"

#include "dstrings.h"
#include "doomfeatures.h"
#include "sounds.h"

#include "d_iwad.h"

#include "z_zone.h"
#include "w_main.h"
#include "w_wad.h"
#include "s_sound.h"
#include "v_video.h"

#include "f_finale.h"
#include "f_wipe.h"

#include "m_argv.h"
#include "m_config.h"
#include "m_controls.h"
#include "m_misc.h"
#include "m_menu.h"
#include "p_saveg.h"

#include "i_endoom.h"
#include "i_joystick.h"
#include "i_system.h"
#include "i_timer.h"
#include "i_video.h"

#include "g_game.h"

#include "hu_stuff.h"
#include "wi_stuff.h"
#include "st_stuff.h"
#include "am_map.h"
#include "net_client.h"
#include "net_dedicated.h"
#include "net_query.h"

#include "p_setup.h"
#include "r_local.h"
#include "statdump.h"


#include "d_main.h"

//
// D-DoomLoop()
// Not a globally visible function,
//  just included for source reference,
//  called by D_DoomMain, never exits.
// Manages timing and IO,
//  calls all ?_Responder, ?_Ticker, and ?_Drawer,
//  calls I_GetTime, I_StartFrame, and I_StartTic
//
void D_DoomLoop (void);

// Location where savegames are stored

char *          savegamedir;

// location of IWAD and WAD files

char *          iwadfile;


boolean		devparm;	// started game with -devparm
boolean         nomonsters;	// checkparm of -nomonsters
boolean         respawnparm;	// checkparm of -respawn
boolean         fastparm;	// checkparm of -fast

//extern int soundVolume;
//extern  int	sfxVolume;
//extern  int	musicVolume;

extern  boolean	inhelpscreens;

skill_t		startskill;
int             startepisode;
int		startmap;
boolean		autostart;
int             startloadgame;

boolean		advancedemo;

// Store demo, do not accept any inputs
boolean         storedemo;

// "BFG Edition" version of doom2.wad does not include TITLEPIC.
boolean         bfgedition;

// If true, the main game loop has started.
boolean         main_loop_started = false;

char		wadfile[1024];		// primary wad file
char		mapdir[1024];           // directory of development maps

int             show_endoom = 1;


void D_ConnectNetGame(void);
void D_CheckNetGame(void);


//
// D_ProcessEvents
// Send all the events of the given timestamp down the responder chain
//
void D_ProcessEvents (void)
{
    event_t*	ev;
	
    // IF STORE DEMO, DO NOT ACCEPT INPUT
    if (storedemo)
        return;
	
    while ((ev = D_PopEvent()) != NULL)
    {
	if (M_Responder (ev))
	    continue;               // menu ate the event
	G_Responder (ev);
    }
}




//
// D_Display
//  draw current display, possibly wiping it from the previous
//

// wipegamestate can be set to -1 to force a wipe on the next draw
gamestate_t     wipegamestate = GS_DEMOSCREEN;
extern  boolean setsizeneeded;
extern  int             showMessages;
void R_ExecuteSetViewSize (void);

void D_Display (void)
{
    static  boolean		viewactivestate = false;
    static  boolean		menuactivestate = false;
    static  boolean		inhelpscreensstate = false;
    static  boolean		fullscreen = false;
    static  gamestate_t		oldgamestate = -1;
    static  int			borderdrawcount;
    int				nowtime;
    int				tics;
    int				wipestart;
    int				y;
    boolean			done;
    boolean			wipe;
    boolean			redrawsbar;

    if (nodrawers)
    	return;                    // for comparative timing / profiling
		
    redrawsbar = false;
    
    // change the view size if needed
    if (setsizeneeded)
    {
		R_ExecuteSetViewSize ();
		oldgamestate = -1;                      // force background redraw
		borderdrawcount = 3;
    }

    // save the current screen if about to wipe
    if (gamestate != wipegamestate)
		{
		wipe = true;
		wipe_StartScreen(0, 0, SCREENWIDTH, SCREENHEIGHT);
    }
    else
    	wipe = false;

    if (gamestate == GS_LEVEL && gametic)
    	HU_Erase();
    
    // do buffered drawing
    switch (gamestate)
    {
      case GS_LEVEL:
		if (!gametic)
			break;
		if (automapactive)
			AM_Drawer ();
		if (wipe || (viewheight != 200 && fullscreen) )
			redrawsbar = true;
		if (inhelpscreensstate && !inhelpscreens)
			redrawsbar = true;              // just put away the help screen
		ST_Drawer (viewheight == 200, redrawsbar );
		fullscreen = viewheight == 200;
		break;

      case GS_INTERMISSION:
		WI_Drawer ();
		break;

      case GS_FINALE:
		F_Drawer ();
		break;

      case GS_DEMOSCREEN:
		D_PageDrawer ();
		break;
    }
    
    // draw buffered stuff to screen
    I_UpdateNoBlit ();
    
    // draw the view directly
    if (gamestate == GS_LEVEL && !automapactive && gametic)
    	R_RenderPlayerView (&players[displayplayer]);

    if (gamestate == GS_LEVEL && gametic)
    	HU_Drawer ();
    
    // clean up border stuff
    if (gamestate != oldgamestate && gamestate != GS_LEVEL)
    	I_SetPalette (W_CacheLumpName (DEH_String("PLAYPAL"),PU_CACHE));

    // see if the border needs to be initially drawn
    if (gamestate == GS_LEVEL && oldgamestate != GS_LEVEL)
    {
		viewactivestate = false;        // view was not active
		R_FillBackScreen ();    // draw the pattern into the back screen
    }

    // see if the border needs to be updated to the screen
    if (gamestate == GS_LEVEL && !automapactive && scaledviewwidth != 320)
    {
		if (menuactive || menuactivestate || !viewactivestate)
			borderdrawcount = 3;
		if (borderdrawcount)
		{
			R_DrawViewBorder ();    // erase old menu stuff
			borderdrawcount--;
		}
    }

    if (testcontrols)
    {
        // Box showing current mouse speed

        V_DrawMouseSpeedBox(testcontrols_mousespeed);
    }

    menuactivestate = menuactive;
    viewactivestate = viewactive;
    inhelpscreensstate = inhelpscreens;
    oldgamestate = wipegamestate = gamestate;
    
    // draw pause pic
    if (paused)
    {
		if (automapactive)
			y = 4;
		else
			y = viewwindowy+4;
		V_DrawPatchDirect(viewwindowx + (scaledviewwidth - 68) / 2, y,
							  W_CacheLumpName (DEH_String("M_PAUSE"), PU_CACHE));
    }


    // menus go directly to the screen
    M_Drawer ();          // menu is drawn even on top of everything
    NetUpdate ();         // send out any new accumulation


    // normal update
    if (!wipe)
    {
	I_FinishUpdate ();              // page flip or blit buffer
	return;
    }
    
    // wipe update
    wipe_EndScreen(0, 0, SCREENWIDTH, SCREENHEIGHT);

    wipestart = I_GetTime () - 1;

    do
    {
	do
	{
	    nowtime = I_GetTime ();
	    tics = nowtime - wipestart;
            I_Sleep(1);
	} while (tics <= 0);
        
	wipestart = nowtime;
	done = wipe_ScreenWipe(wipe_Melt
			       , 0, 0, SCREENWIDTH, SCREENHEIGHT, tics);
	I_UpdateNoBlit ();
	M_Drawer ();                            // menu is drawn even on top of wipes
	I_FinishUpdate ();                      // page flip or blit buffer
    } while (!done);
}

//
// Add configuration file variable bindings.
//

void D_BindVariables(void)
{
    int i;

    M_ApplyPlatformDefaults();

    I_BindVideoVariables();
    I_BindJoystickVariables();
    I_BindSoundVariables();

    M_BindBaseControls();
    M_BindWeaponControls();
    M_BindMapControls();
    M_BindMenuControls();
    M_BindChatControls(MAXPLAYERS);

    key_multi_msgplayer[0] = HUSTR_KEYGREEN;
    key_multi_msgplayer[1] = HUSTR_KEYINDIGO;
    key_multi_msgplayer[2] = HUSTR_KEYBROWN;
    key_multi_msgplayer[3] = HUSTR_KEYRED;

#ifdef FEATURE_MULTIPLAYER
    NET_BindVariables();
#endif

    M_BindVariable("mouse_sensitivity",      &mouseSensitivity);
    M_BindVariable("sfx_volume",             &sfxVolume);
    M_BindVariable("music_volume",           &musicVolume);
    M_BindVariable("show_messages",          &showMessages);
    M_BindVariable("screenblocks",           &screenblocks);
    M_BindVariable("detaillevel",            &detailLevel);
    M_BindVariable("snd_channels",           &snd_channels);
    M_BindVariable("vanilla_savegame_limit", &vanilla_savegame_limit);
    M_BindVariable("vanilla_demo_limit",     &vanilla_demo_limit);
    M_BindVariable("show_endoom",            &show_endoom);

    // Multiplayer chat macros

    for (i=0; i<10; ++i)
    {
        char buf[12];

        M_snprintf(buf, sizeof(buf), "chatmacro%i", i);
        M_BindVariable(buf, &chat_macros[i]);
    }
}

//
// D_GrabMouseCallback
//
// Called to determine whether to grab the mouse pointer
//

boolean D_GrabMouseCallback(void)
{
    // Drone players don't need mouse focus

    if (drone)
        return false;

    // when menu is active or game is paused, release the mouse 
 
    if (menuactive || paused)
        return false;

    // only grab mouse when playing levels (but not demos)

    return (gamestate == GS_LEVEL) && !demoplayback && !advancedemo;
}

//
//  D_DoomLoop
//
void D_DoomLoop (void)
{
    if (bfgedition &&
        (demorecording || (gameaction == ga_playdemo) || netgame))
    {
        printf(" WARNING: You are playing using one of the Doom Classic\n"
               " IWAD files shipped with the Doom 3: BFG Edition. These are\n"
               " known to be incompatible with the regular IWAD files and\n"
               " may cause demos and network games to get out of sync.\n");
    }

    if (demorecording)
    	G_BeginRecording ();

    main_loop_started = true;

    TryRunTics();

    I_SetWindowTitle(gamedescription);
    I_GraphicsCheckCommandLine();
    I_SetGrabMouseCallback(D_GrabMouseCallback);
    I_InitGraphics();
    I_EnableLoadingDisk();

    V_RestoreBuffer();
    R_ExecuteSetViewSize();

    D_StartGameLoop();

    if (testcontrols)
    {
        wipegamestate = gamestate;
    }

    while (1)
    {
		// frame syncronous IO operations
		I_StartFrame ();

		TryRunTics (); // will run at least one tic

		S_UpdateSounds (players[consoleplayer].mo);// move positional sounds

		// Update display, next frame, with current state.
		if (screenvisible)
		{
			D_Display ();
		}
    }
}



//
//  DEMO LOOP
//
int             demosequence;
int             pagetic;
char                    *pagename;


//
// D_PageTicker
// Handles timing for warped projection
//
void D_PageTicker (void)
{
    if (--pagetic < 0)
	D_AdvanceDemo ();
}



//
// D_PageDrawer
//
void D_PageDrawer (void)
{
    V_DrawPatch (0, 0, W_CacheLumpName(pagename, PU_CACHE));
}


//
// D_AdvanceDemo
// Called after each demo or intro demosequence finishes
//
void D_AdvanceDemo (void)
{
    advancedemo = true;
}


//
// This cycles through the demo sequences.
// FIXME - version dependend demo numbers?
//
void D_DoAdvanceDemo (void)
{
    players[consoleplayer].playerstate = PST_LIVE;  // not reborn
    advancedemo = false;
    usergame = false;               // no save / end game here
    paused = false;
    gameaction = ga_nothing;

    // The Ultimate Doom executable changed the demo sequence to add
    // a DEMO4 demo.  Final Doom was based on Ultimate, so also
    // includes this change; however, the Final Doom IWADs do not
    // include a DEMO4 lump, so the game bombs out with an error
    // when it reaches this point in the demo sequence.

    // However! There is an alternate version of Final Doom that
    // includes a fixed executable.

    if (gameversion == exe_ultimate || gameversion == exe_final)
      demosequence = (demosequence+1)%7;
    else
      demosequence = (demosequence+1)%6;
    
    switch (demosequence)
    {
      case 0:
	if ( gamemode == commercial )
	    pagetic = TICRATE * 11;
	else
	    pagetic = 170;
	gamestate = GS_DEMOSCREEN;
	pagename = DEH_String("TITLEPIC");
	if ( gamemode == commercial )
	  S_StartMusic(mus_dm2ttl);
	else
	  S_StartMusic (mus_intro);
	break;
      case 1:
	G_DeferedPlayDemo(DEH_String("demo1"));
	break;
      case 2:
	pagetic = 200;
	gamestate = GS_DEMOSCREEN;
	pagename = DEH_String("CREDIT");
	break;
      case 3:
	G_DeferedPlayDemo(DEH_String("demo2"));
	break;
      case 4:
	gamestate = GS_DEMOSCREEN;
	if ( gamemode == commercial)
	{
	    pagetic = TICRATE * 11;
	    pagename = DEH_String("TITLEPIC");
	    S_StartMusic(mus_dm2ttl);
	}
	else
	{
	    pagetic = 200;

	    if ( gamemode == retail )
	      pagename = DEH_String("CREDIT");
	    else
	      pagename = DEH_String("HELP2");
	}
	break;
      case 5:
	G_DeferedPlayDemo(DEH_String("demo3"));
	break;
        // THE DEFINITIVE DOOM Special Edition demo
      case 6:
	G_DeferedPlayDemo(DEH_String("demo4"));
	break;
    }

    // The Doom 3: BFG Edition version of doom2.wad does not have a
    // TITLETPIC lump. Use INTERPIC instead as a workaround.
    if (bfgedition && !strcasecmp(pagename, "TITLEPIC")
        && W_CheckNumForName("titlepic") < 0)
    {
        pagename = DEH_String("INTERPIC");
    }
}



//
// D_StartTitle
//
void D_StartTitle (void)
{
    gameaction = ga_nothing;
    demosequence = -1;
    D_AdvanceDemo ();
}

// Strings for dehacked replacements of the startup banner
//
// These are from the original source: some of them are perhaps
// not used in any dehacked patches

static char *banners[] =
{
    // doom2.wad
    "                         "
    "DOOM 2: Hell on Earth v%i.%i"
    "                           ",
    // doom1.wad
    "                            "
    "DOOM Shareware Startup v%i.%i"
    "                           ",
    // doom.wad
    "                            "
    "DOOM Registered Startup v%i.%i"
    "                           ",
    // Registered DOOM uses this
    "                          "
    "DOOM System Startup v%i.%i"
    "                          ",
    // doom.wad (Ultimate DOOM)
    "                         "
    "The Ultimate DOOM Startup v%i.%i"
    "                        ",
    // tnt.wad
    "                     "
    "DOOM 2: TNT - Evilution v%i.%i"
    "                           ",
    // plutonia.wad
    "                   "
    "DOOM 2: Plutonia Experiment v%i.%i"
    "                           ",
};

//
// Get game name: if the startup banner has been replaced, use that.
// Otherwise, use the name given
// 

static char *GetGameName(char *gamename)
{
    size_t i;
    char *deh_sub;
    
    for (i=0; i<arrlen(banners); ++i)
    {
        // Has the banner been replaced?

        deh_sub = DEH_String(banners[i]);
        
        if (deh_sub != banners[i])
        {
            size_t gamename_size;
            int version;

            // Has been replaced.
            // We need to expand via printf to include the Doom version number
            // We also need to cut off spaces to get the basic name

            gamename_size = strlen(deh_sub) + 10;
            gamename = Z_Malloc(gamename_size, PU_STATIC, 0);
            version = G_VanillaVersionCode();
            M_snprintf(gamename, gamename_size, deh_sub,
                       version / 100, version % 100);

            while (gamename[0] != '\0' && isspace((int)gamename[0]))
            {
                memmove(gamename, gamename + 1, gamename_size - 1);
            }

            while (gamename[0] != '\0' && isspace((int)gamename[strlen(gamename)-1]))
            {
                gamename[strlen(gamename) - 1] = '\0';
            }

            return gamename;
        }
    }

    return gamename;
}

static void SetMissionForPackName(char *pack_name)
{
    int i;
    static const struct
    {
        char *name;
        int mission;
    } packs[] = {
        { "doom2",    doom2 },
        { "tnt",      pack_tnt },
        { "plutonia", pack_plut },
    };

    for (i = 0; i < arrlen(packs); ++i)
    {
        if (!strcasecmp(pack_name, packs[i].name))
        {
            gamemission = packs[i].mission;
            return;
        }
    }

    printf("Valid mission packs are:\n");

    for (i = 0; i < arrlen(packs); ++i)
    {
        printf("\t%s\n", packs[i].name);
    }

    I_Error("Unknown mission pack name: %s", pack_name);
}

//
// Find out what version of Doom is playing.
//

void D_IdentifyVersion(void)
{
    // gamemission is set up by the D_FindIWAD function.  But if 
    // we specify '-iwad', we have to identify using 
    // IdentifyIWADByName.  However, if the iwad does not match
    // any known IWAD name, we may have a dilemma.  Try to 
    // identify by its contents.

    if (gamemission == none)
    {
        unsigned int i;

        for (i=0; i<numlumps; ++i)
        {
            if (!strncasecmp(lumpinfo[i].name, "MAP01", 8))
            {
                gamemission = doom2;
                break;
            } 
            else if (!strncasecmp(lumpinfo[i].name, "E1M1", 8))
            {
                gamemission = doom;
                break;
            }
        }

        if (gamemission == none)
        {
            // Still no idea.  I don't think this is going to work.

            I_Error("Unknown or invalid IWAD file.");
        }
    }

    // Make sure gamemode is set up correctly

    if (logical_gamemission == doom)
    {
        // Doom 1.  But which version?

        if (W_CheckNumForName("E4M1") > 0)
        {
            // Ultimate Doom

            gamemode = retail;
        } 
        else if (W_CheckNumForName("E3M1") > 0)
        {
            gamemode = registered;
        }
        else
        {
            gamemode = shareware;
        }
    }
    else
    {
        int p;

        // Doom 2 of some kind.
        gamemode = commercial;

        // We can manually override the gamemission that we got from the
        // IWAD detection code. This allows us to eg. play Plutonia 2
        // with Freedoom and get the right level names.

        //!
        // @arg <pack>
        //
        // Explicitly specify a Doom II "mission pack" to run as, instead of
        // detecting it based on the filename. Valid values are: "doom2",
        // "tnt" and "plutonia".
        //
        p = M_CheckParmWithArgs("-pack", 1);
        if (p > 0)
        {
            SetMissionForPackName(myargv[p + 1]);
        }
    }
}

// Set the gamedescription string

void D_SetGameDescription(void)
{
    boolean is_freedoom = W_CheckNumForName("FREEDOOM") >= 0,
            is_freedm = W_CheckNumForName("FREEDM") >= 0;

    gamedescription = "Unknown";

    if (logical_gamemission == doom)
    {
        // Doom 1.  But which version?

        if (is_freedoom)
        {
            gamedescription = GetGameName("Freedoom: Phase 1");
        }
        else if (gamemode == retail)
        {
            // Ultimate Doom

            gamedescription = GetGameName("The Ultimate DOOM");
        }
        else if (gamemode == registered)
        {
            gamedescription = GetGameName("DOOM Registered");
        }
        else if (gamemode == shareware)
        {
            gamedescription = GetGameName("DOOM Shareware");
        }
    }
    else
    {
        // Doom 2 of some kind.  But which mission?

        if (is_freedoom)
        {
            if (is_freedm)
            {
                gamedescription = GetGameName("FreeDM");
            }
            else
            {
                gamedescription = GetGameName("Freedoom: Phase 2");
            }
        }
        else if (logical_gamemission == doom2)
        {
            gamedescription = GetGameName("DOOM 2: Hell on Earth");
        }
        else if (logical_gamemission == pack_plut)
        {
            gamedescription = GetGameName("DOOM 2: Plutonia Experiment"); 
        }
        else if (logical_gamemission == pack_tnt)
        {
            gamedescription = GetGameName("DOOM 2: TNT - Evilution");
        }
    }
}

//      print title for every printed line
char            title[128];

static boolean D_AddFile(char *filename)
{
    wad_file_t *handle;

    printf(" adding %s\n", filename);
    handle = W_AddFile(filename);

    return handle != NULL;
}

// Copyright message banners
// Some dehacked mods replace these.  These are only displayed if they are 
// replaced by dehacked.

static char *copyright_banners[] =
{
    "===========================================================================\n"
    "ATTENTION:  This version of DOOM has been modified.  If you would like to\n"
    "get a copy of the original game, call 1-800-IDGAMES or see the readme file.\n"
    "        You will not receive technical support for modified games.\n"
    "                      press enter to continue\n"
    "===========================================================================\n",

    "===========================================================================\n"
    "                 Commercial product - do not distribute!\n"
    "         Please report software piracy to the SPA: 1-800-388-PIR8\n"
    "===========================================================================\n",

    "===========================================================================\n"
    "                                Shareware!\n"
    "===========================================================================\n"
};

// Prints a message only if it has been modified by dehacked.

void PrintDehackedBanners(void)
{
    size_t i;

    for (i=0; i<arrlen(copyright_banners); ++i)
    {
        char *deh_s;

        deh_s = DEH_String(copyright_banners[i]);

        if (deh_s != copyright_banners[i])
        {
            printf("%s", deh_s);

            // Make sure the modified banner always ends in a newline character.
            // If it doesn't, add a newline.  This fixes av.wad.

            if (deh_s[strlen(deh_s) - 1] != '\n')
            {
                printf("\n");
            }
        }
    }
}

static struct 
{
    char *description;
    char *cmdline;
    GameVersion_t version;
} gameversions[] = {
    {"Doom 1.666",           "1.666",      exe_doom_1_666},
    {"Doom 1.7/1.7a",        "1.7",        exe_doom_1_7},
    {"Doom 1.8",             "1.8",        exe_doom_1_8},
    {"Doom 1.9",             "1.9",        exe_doom_1_9},
    {"Hacx",                 "hacx",       exe_hacx},
    {"Ultimate Doom",        "ultimate",   exe_ultimate},
    {"Final Doom",           "final",      exe_final},
    {"Final Doom (alt)",     "final2",     exe_final2},
    {"Chex Quest",           "chex",       exe_chex},
    { NULL,                  NULL,         0},
};

// Initialize the game version

static void InitGameVersion(void)
{
    int p;
    int i;

    //! 
    // @arg <version>
    // @category compat
    //
    // Emulate a specific version of Doom.  Valid values are "1.9",
    // "ultimate", "final", "final2", "hacx" and "chex".
    //

    p = M_CheckParmWithArgs("-gameversion", 1);

    if (p)
    {
        for (i=0; gameversions[i].description != NULL; ++i)
        {
            if (!strcmp(myargv[p+1], gameversions[i].cmdline))
            {
                gameversion = gameversions[i].version;
                break;
            }
        }
        
        if (gameversions[i].description == NULL) 
        {
            printf("Supported game versions:\n");

            for (i=0; gameversions[i].description != NULL; ++i)
            {
                printf("\t%s (%s)\n", gameversions[i].cmdline,
                        gameversions[i].description);
            }
            
            I_Error("Unknown game version '%s'", myargv[p+1]);
        }
    }
    else
    {
        // Determine automatically

        if (gamemission == pack_chex)
        {
            // chex.exe - identified by iwad filename

            gameversion = exe_chex;
        }
        else if (gamemission == pack_hacx)
        {
            // hacx.exe: identified by iwad filename

            gameversion = exe_hacx;
        }
        else if (gamemode == shareware || gamemode == registered)
        {
            // original

            gameversion = exe_doom_1_9;

            // TODO: Detect IWADs earlier than Doom v1.9.
        }
        else if (gamemode == retail)
        {
            gameversion = exe_ultimate;
        }
        else if (gamemode == commercial)
        {
            if (gamemission == doom2)
            {
                gameversion = exe_doom_1_9;
            }
            else
            {
                // Final Doom: tnt or plutonia
                // Defaults to emulating the first Final Doom executable,
                // which has the crash in the demo loop; however, having
                // this as the default should mean that it plays back
                // most demos correctly.

                gameversion = exe_final;
            }
        }
    }
    
    // The original exe does not support retail - 4th episode not supported

    if (gameversion < exe_ultimate && gamemode == retail)
    {
        gamemode = registered;
    }

    // EXEs prior to the Final Doom exes do not support Final Doom.

    if (gameversion < exe_final && gamemode == commercial
     && (gamemission == pack_tnt || gamemission == pack_plut))
    {
        gamemission = doom2;
    }
}

void PrintGameVersion(void)
{
    int i;

    for (i=0; gameversions[i].description != NULL; ++i)
    {
        if (gameversions[i].version == gameversion)
        {
            printf("Emulating the behavior of the "
                   "'%s' executable.\n", gameversions[i].description);
            break;
        }
    }
}

// Function called at exit to display the ENDOOM screen

static void D_Endoom(void)
{
    byte *endoom;

    // Don't show ENDOOM if we have it disabled, or we're running
    // in screensaver or control test mode. Only show it once the
    // game has actually started.

    if (!show_endoom || !main_loop_started
     || screensaver_mode || M_CheckParm("-testcontrols") > 0)
    {
        return;
    }

    endoom = W_CacheLumpName(DEH_String("ENDOOM"), PU_STATIC);

    I_Endoom(endoom);
}

#if ORIGCODE
// Load dehacked patches needed for certain IWADs.
static void LoadIwadDeh(void)
{
    // The Freedoom IWADs have DEHACKED lumps that must be loaded.
    if (W_CheckNumForName("FREEDOOM") >= 0)
    {
        // Old versions of Freedoom (before 2014-09) did not have technically
        // valid DEHACKED lumps, so ignore errors and just continue if this
        // is an old IWAD.
        DEH_LoadLumpByName("DEHACKED", false, true);
    }

    // If this is the HACX IWAD, we need to load the DEHACKED lump.
    if (gameversion == exe_hacx)
    {
        if (!DEH_LoadLumpByName("DEHACKED", true, false))
        {
            I_Error("DEHACKED lump not found.  Please check that this is the "
                    "Hacx v1.2 IWAD.");
        }
    }

    // Chex Quest needs a separate Dehacked patch which must be downloaded
    // and installed next to the IWAD.
    if (gameversion == exe_chex)
    {
        char *chex_deh = NULL;
        char *sep;

        // Look for chex.deh in the same directory as the IWAD file.
        sep = strrchr(iwadfile, DIR_SEPARATOR);

        if (sep != NULL)
        {
            size_t chex_deh_len = strlen(iwadfile) + 9;
            chex_deh = malloc(chex_deh_len);
            M_StringCopy(chex_deh, iwadfile, chex_deh_len);
            chex_deh[sep - iwadfile + 1] = '\0';
            M_StringConcat(chex_deh, "chex.deh", chex_deh_len);
        }
        else
        {
            chex_deh = strdup("chex.deh");
        }

        // If the dehacked patch isn't found, try searching the WAD
        // search path instead.  We might find it...
        if (!M_FileExists(chex_deh))
        {
            free(chex_deh);
            chex_deh = D_FindWADByName("chex.deh");
        }

        // Still not found?
        if (chex_deh == NULL)
        {
            I_Error("Unable to find Chex Quest dehacked file (chex.deh).\n"
                    "The dehacked file is required in order to emulate\n"
                    "chex.exe correctly.  It can be found in your nearest\n"
                    "/idgames repository mirror at:\n\n"
                    "   utils/exe_edit/patches/chexdeh.zip");
        }

        if (!DEH_LoadFile(chex_deh))
        {
            I_Error("Failed to load chex.deh needed for emulating chex.exe.");
        }
    }
}
#endif

//
// D_DoomMain
//
void D_DoomMain (void)
{
    int p;
    char file[256];
    char demolumpname[9];
#if ORIGCODE
    int numiwadlumps;
#endif

    I_AtExit(D_Endoom, false);

    // print banner

    I_PrintBanner(PACKAGE_STRING);

    DEH_printf("Z_Init: Init zone memory allocation daemon. \n");
    Z_Init ();

#ifdef FEATURE_MULTIPLAYER
    //!
    // @category net
    //
    // Start a dedicated server, routing packets but not participating
    // in the game itself.
    //

    if (M_CheckParm("-dedicated") > 0)
    {
        printf("Dedicated server mode.\n");
        NET_DedicatedServer();

        // Never returns
    }

    //!
    // @category net
    //
    // Query the Internet master server for a global list of active
    // servers.
    //

    if (M_CheckParm("-search"))
    {
        NET_MasterQuery();
        exit(0);
    }

    //!
    // @arg <address>
    // @category net
    //
    // Query the status of the server running on the given IP
    // address.
    //

    p = M_CheckParmWithArgs("-query", 1);

    if (p)
    {
        NET_QueryAddress(myargv[p+1]);
        exit(0);
    }

    //!
    // @category net
    //
    // Search the local LAN for running servers.
    //

    if (M_CheckParm("-localsearch"))
    {
        NET_LANQuery();
        exit(0);
    }

#endif

    //!
    // @vanilla
    //
    // Disable monsters.
    //
	
    nomonsters = M_CheckParm ("-nomonsters");

    //!
    // @vanilla
    //
    // Monsters respawn after being killed.
    //

    respawnparm = M_CheckParm ("-respawn");

    //!
    // @vanilla
    //
    // Monsters move faster.
    //

    fastparm = M_CheckParm ("-fast");

    //! 
    // @vanilla
    //
    // Developer mode.  F1 saves a screenshot in the current working
    // directory.
    //

    devparm = M_CheckParm ("-devparm");

    I_DisplayFPSDots(devparm);

    //!
    // @category net
    // @vanilla
    //
    // Start a deathmatch game.
    //

    if (M_CheckParm ("-deathmatch"))
	deathmatch = 1;

    //!
    // @category net
    // @vanilla
    //
    // Start a deathmatch 2.0 game.  Weapons do not stay in place and
    // all items respawn after 30 seconds.
    //

    if (M_CheckParm ("-altdeath"))
	deathmatch = 2;

    if (devparm)
	DEH_printf(D_DEVSTR);
    
    // find which dir to use for config files

#ifdef _WIN32

    //!
    // @platform windows
    // @vanilla
    //
    // Save configuration data and savegames in c:\doomdata,
    // allowing play from CD.
    //

    if (M_ParmExists("-cdrom"))
    {
        printf(D_CDROM);

        M_SetConfigDir("c:\\doomdata\\");
    }
    else
#endif
    {
        // Auto-detect the configuration dir.

        M_SetConfigDir(NULL);
    }

    //!
    // @arg <x>
    // @vanilla
    //
    // Turbo mode.  The player's speed is multiplied by x%.  If unspecified,
    // x defaults to 200.  Values are rounded up to 10 and down to 400.
    //

    if ( (p=M_CheckParm ("-turbo")) )
    {
	int     scale = 200;
	extern int forwardmove[2];
	extern int sidemove[2];
	
	if (p<myargc-1)
	    scale = atoi (myargv[p+1]);
	if (scale < 10)
	    scale = 10;
	if (scale > 400)
	    scale = 400;
        DEH_printf("turbo scale: %i%%\n", scale);
	forwardmove[0] = forwardmove[0]*scale/100;
	forwardmove[1] = forwardmove[1]*scale/100;
	sidemove[0] = sidemove[0]*scale/100;
	sidemove[1] = sidemove[1]*scale/100;
    }
    
    // init subsystems
    DEH_printf("V_Init: allocate screens.\n");
    V_Init ();

    // Load configuration files before initialising other subsystems.
    DEH_printf("M_LoadDefaults: Load system defaults.\n");
    M_SetConfigFilenames("default.cfg", PROGRAM_PREFIX "doom.cfg");
    D_BindVariables();
    M_LoadDefaults();

    // Save configuration at exit.
    I_AtExit(M_SaveDefaults, false);

    // Find main IWAD file and load it.
    iwadfile = D_FindIWAD(IWAD_MASK_DOOM, &gamemission);

    // None found?

    if (iwadfile == NULL)
    {
        I_Error("Game mode indeterminate.  No IWAD file was found.  Try\n"
                "specifying one with the '-iwad' command line parameter.\n");
    }

    modifiedgame = false;

    DEH_printf("W_Init: Init WADfiles.\n");
    D_AddFile(iwadfile);
#if ORIGCODE
    numiwadlumps = numlumps;
#endif

    W_CheckCorrectIWAD(doom);

    // Now that we've loaded the IWAD, we can figure out what gamemission
    // we're playing and which version of Vanilla Doom we need to emulate.
    D_IdentifyVersion();
    InitGameVersion();

#if ORIGCODE
    //!
    // @category mod
    //
    // Disable automatic loading of Dehacked patches for certain
    // IWAD files.
    //
    if (!M_ParmExists("-nodeh"))
    {
        // Some IWADs have dehacked patches that need to be loaded for
        // them to be played properly.
        LoadIwadDeh();
    }
#endif

    // Doom 3: BFG Edition includes modified versions of the classic
    // IWADs which can be identified by an additional DMENUPIC lump.
    // Furthermore, the M_GDHIGH lumps have been modified in a way that
    // makes them incompatible to Vanilla Doom and the modified version
    // of doom2.wad is missing the TITLEPIC lump.
    // We specifically check for DMENUPIC here, before PWADs have been
    // loaded which could probably include a lump of that name.

    if (W_CheckNumForName("dmenupic") >= 0)
    {
        printf("BFG Edition: Using workarounds as needed.\n");
        bfgedition = true;

        // BFG Edition changes the names of the secret levels to
        // censor the Wolfenstein references. It also has an extra
        // secret level (MAP33). In Vanilla Doom (meaning the DOS
        // version), MAP33 overflows into the Plutonia level names
        // array, so HUSTR_33 is actually PHUSTR_1.

        DEH_AddStringReplacement(HUSTR_31, "level 31: idkfa");
        DEH_AddStringReplacement(HUSTR_32, "level 32: keen");
        DEH_AddStringReplacement(PHUSTR_1, "level 33: betray");

        // The BFG edition doesn't have the "low detail" menu option (fair
        // enough). But bizarrely, it reuses the M_GDHIGH patch as a label
        // for the options menu (says "Fullscreen:"). Why the perpetrators
        // couldn't just add a new graphic lump and had to reuse this one,
        // I don't know.
        //
        // The end result is that M_GDHIGH is too wide and causes the game
        // to crash. As a workaround to get a minimum level of support for
        // the BFG edition IWADs, use the "ON"/"OFF" graphics instead.

        DEH_AddStringReplacement("M_GDHIGH", "M_MSGON");
        DEH_AddStringReplacement("M_GDLOW", "M_MSGOFF");
    }

#ifdef FEATURE_DEHACKED
    // Load Dehacked patches specified on the command line with -deh.
    // Note that there's a very careful and deliberate ordering to how
    // Dehacked patches are loaded. The order we use is:
    //  1. IWAD dehacked patches.
    //  2. Command line dehacked patches specified with -deh.
    //  3. PWAD dehacked patches in DEHACKED lumps.
    DEH_ParseCommandLine();
#endif

    // Load PWAD files.
    modifiedgame = W_ParseCommandLine();

    // Debug:
//    W_PrintDirectory();

    //!
    // @arg <demo>
    // @category demo
    // @vanilla
    //
    // Play back the demo named demo.lmp.
    //

    p = M_CheckParmWithArgs ("-playdemo", 1);

    if (!p)
    {
        //!
        // @arg <demo>
        // @category demo
        // @vanilla
        //
        // Play back the demo named demo.lmp, determining the framerate
        // of the screen.
        //
	p = M_CheckParmWithArgs("-timedemo", 1);

    }

    if (p)
    {
        // With Vanilla you have to specify the file without extension,
        // but make that optional.
        if (M_StringEndsWith(myargv[p + 1], ".lmp"))
        {
            M_StringCopy(file, myargv[p + 1], sizeof(file));
        }
        else
        {
            DEH_snprintf(file, sizeof(file), "%s.lmp", myargv[p+1]);
        }

        if (D_AddFile(file))
        {
            M_StringCopy(demolumpname, lumpinfo[numlumps - 1].name,
                         sizeof(demolumpname));
        }
        else
        {
            // If file failed to load, still continue trying to play
            // the demo in the same way as Vanilla Doom.  This makes
            // tricks like "-playdemo demo1" possible.

            M_StringCopy(demolumpname, myargv[p + 1], sizeof(demolumpname));
        }

        printf("Playing demo %s.\n", file);
    }

    I_AtExit((atexit_func_t) G_CheckDemoStatus, true);

    // Generate the WAD hash table.  Speed things up a bit.
    W_GenerateHashTable();

    // Load DEHACKED lumps from WAD files - but only if we give the right
    // command line parameter.

#if ORIGCODE
    //!
    // @category mod
    //
    // Load Dehacked patches from DEHACKED lumps contained in one of the
    // loaded PWAD files.
    //
    if (M_ParmExists("-dehlump"))
    {
        int i, loaded = 0;

        for (i = numiwadlumps; i < numlumps; ++i)
        {
            if (!strncmp(lumpinfo[i].name, "DEHACKED", 8))
            {
                DEH_LoadLump(i, false, false);
                loaded++;
            }
        }

        printf("  loaded %i DEHACKED lumps from PWAD files.\n", loaded);
    }
#endif

    // Set the gamedescription string. This is only possible now that
    // we've finished loading Dehacked patches.
    D_SetGameDescription();

#ifdef _WIN32
    // In -cdrom mode, we write savegames to c:\doomdata as well as configs.
    if (M_ParmExists("-cdrom"))
    {
        savegamedir = configdir;
    }
    else
#endif
    {
        savegamedir = M_GetSaveGameDir(D_SaveGameIWADName(gamemission));
    }

    // Check for -file in shareware
    if (modifiedgame)
    {
	// These are the lumps that will be checked in IWAD,
	// if any one is not present, execution will be aborted.
	char name[23][8]=
	{
	    "e2m1","e2m2","e2m3","e2m4","e2m5","e2m6","e2m7","e2m8","e2m9",
	    "e3m1","e3m3","e3m3","e3m4","e3m5","e3m6","e3m7","e3m8","e3m9",
	    "dphoof","bfgga0","heada1","cybra1","spida1d1"
	};
	int i;
	
	if ( gamemode == shareware)
	    I_Error(DEH_String("\nYou cannot -file with the shareware "
			       "version. Register!"));

	// Check for fake IWAD with right name,
	// but w/o all the lumps of the registered version. 
	if (gamemode == registered)
	    for (i = 0;i < 23; i++)
		if (W_CheckNumForName(name[i])<0)
		    I_Error(DEH_String("\nThis is not the registered version."));
    }

    if (W_CheckNumForName("SS_START") >= 0
     || W_CheckNumForName("FF_END") >= 0)
    {
        I_PrintDivider();
        printf(" WARNING: The loaded WAD file contains modified sprites or\n"
               " floor textures.  You may want to use the '-merge' command\n"
               " line option instead of '-file'.\n");
    }

    I_PrintStartupBanner(gamedescription);
    PrintDehackedBanners();

    // Freedoom's IWADs are Boom-compatible, which means they usually
    // don't work in Vanilla (though FreeDM is okay). Show a warning
    // message and give a link to the website.
    if (W_CheckNumForName("FREEDOOM") >= 0 && W_CheckNumForName("FREEDM") < 0)
    {
        printf(" WARNING: You are playing using one of the Freedoom IWAD\n"
               " files, which might not work in this port. See this page\n"
               " for more information on how to play using Freedoom:\n"
               "   http://www.chocolate-doom.org/wiki/index.php/Freedoom\n");
        I_PrintDivider();
    }

    DEH_printf("I_Init: Setting up machine state.\n");
    I_CheckIsScreensaver();
    I_InitTimer();
    I_InitJoystick();
    I_InitSound(true);
    I_InitMusic();

#ifdef FEATURE_MULTIPLAYER
    printf ("NET_Init: Init network subsystem.\n");
    NET_Init ();
#endif

    // Initial netgame startup. Connect to server etc.
    D_ConnectNetGame();

    // get skill / episode / map from parms
    startskill = sk_medium;
    startepisode = 1;
    startmap = 1;
    autostart = false;

    //!
    // @arg <skill>
    // @vanilla
    //
    // Set the game skill, 1-5 (1: easiest, 5: hardest).  A skill of
    // 0 disables all monsters.
    //

    p = M_CheckParmWithArgs("-skill", 1);

    if (p)
    {
	startskill = myargv[p+1][0]-'1';
	autostart = true;
    }

    //!
    // @arg <n>
    // @vanilla
    //
    // Start playing on episode n (1-4)
    //

    p = M_CheckParmWithArgs("-episode", 1);

    if (p)
    {
	startepisode = myargv[p+1][0]-'0';
	startmap = 1;
	autostart = true;
    }
	
    timelimit = 0;

    //! 
    // @arg <n>
    // @category net
    // @vanilla
    //
    // For multiplayer games: exit each level after n minutes.
    //

    p = M_CheckParmWithArgs("-timer", 1);

    if (p)
    {
	timelimit = atoi(myargv[p+1]);
    }

    //!
    // @category net
    // @vanilla
    //
    // Austin Virtual Gaming: end levels after 20 minutes.
    //

    p = M_CheckParm ("-avg");

    if (p)
    {
	timelimit = 20;
    }

    //!
    // @arg [<x> <y> | <xy>]
    // @vanilla
    //
    // Start a game immediately, warping to ExMy (Doom 1) or MAPxy
    // (Doom 2)
    //

    p = M_CheckParmWithArgs("-warp", 1);

    if (p)
    {
        if (gamemode == commercial)
            startmap = atoi (myargv[p+1]);
        else
        {
            startepisode = myargv[p+1][0]-'0';

            if (p + 2 < myargc)
            {
                startmap = myargv[p+2][0]-'0';
            }
            else
            {
                startmap = 1;
            }
        }
        autostart = true;
    }

    // Undocumented:
    // Invoked by setup to test the controls.

    p = M_CheckParm("-testcontrols");

    if (p > 0)
    {
        startepisode = 1;
        startmap = 1;
        autostart = true;
        testcontrols = true;
    }

    // Check for load game parameter
    // We do this here and save the slot number, so that the network code
    // can override it or send the load slot to other players.

    //!
    // @arg <s>
    // @vanilla
    //
    // Load the game in slot s.
    //

    p = M_CheckParmWithArgs("-loadgame", 1);
    
    if (p)
    {
        startloadgame = atoi(myargv[p+1]);
    }
    else
    {
        // Not loading a game
        startloadgame = -1;
    }

    DEH_printf("M_Init: Init miscellaneous info.\n");
    M_Init ();

    DEH_printf("R_Init: Init DOOM refresh daemon - ");
    R_Init ();

    DEH_printf("\nP_Init: Init Playloop state.\n");
    P_Init ();

    DEH_printf("S_Init: Setting up sound.\n");
    S_Init (sfxVolume * 8, musicVolume * 8);

    DEH_printf("D_CheckNetGame: Checking network game status.\n");
    D_CheckNetGame ();

    PrintGameVersion();

    DEH_printf("HU_Init: Setting up heads up display.\n");
    HU_Init ();

    DEH_printf("ST_Init: Init status bar.\n");
    ST_Init ();

    // If Doom II without a MAP01 lump, this is a store demo.
    // Moved this here so that MAP01 isn't constantly looked up
    // in the main loop.

    if (gamemode == commercial && W_CheckNumForName("map01") < 0)
        storedemo = true;

    if (M_CheckParmWithArgs("-statdump", 1))
    {
        I_AtExit(StatDump, true);
        DEH_printf("External statistics registered.\n");
    }

    //!
    // @arg <x>
    // @category demo
    // @vanilla
    //
    // Record a demo named x.lmp.
    //

    p = M_CheckParmWithArgs("-record", 1);

    if (p)
    {
		G_RecordDemo (myargv[p+1]);
		autostart = true;
    }

    p = M_CheckParmWithArgs("-playdemo", 1);
    if (p)
    {
		singledemo = true;              // quit after one demo
		G_DeferedPlayDemo (demolumpname);
		D_DoomLoop ();  // never returns
    }

    p = M_CheckParmWithArgs("-timedemo", 1);
    if (p)
    {
		G_TimeDemo (demolumpname);
		D_DoomLoop ();  // never returns
    }

    if (startloadgame >= 0)
    {
        M_StringCopy(file, P_SaveGameFile(startloadgame), sizeof(file));
        G_LoadGame(file);
    }

    if (gameaction != ga_loadgame )
    {
		if (autostart || netgame)
			G_InitNew (startskill, startepisode, startmap);
		else
			D_StartTitle ();                // start up intro loop
    }

    D_DoomLoop ();  // never returns
}



================================================
FILE: fbdoom/d_main.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//	System specific interface stuff.
//


#ifndef __D_MAIN__
#define __D_MAIN__

#include "doomdef.h"




// Read events from all input devices

void D_ProcessEvents (void); 
	

//
// BASE LEVEL
//
void D_PageTicker (void);
void D_PageDrawer (void);
void D_AdvanceDemo (void);
void D_DoAdvanceDemo (void);
void D_StartTitle (void);
 
//
// GLOBAL VARIABLES
//

extern  gameaction_t    gameaction;


#endif



================================================
FILE: fbdoom/d_mode.c
================================================
//
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
//
// DESCRIPTION:
//   Functions and definitions relating to the game type and operational
//   mode.
//

#include "doomtype.h"
#include "d_mode.h"

// Valid game mode/mission combinations, with the number of
// episodes/maps for each.

static struct
{
    GameMission_t mission;
    GameMode_t mode;
    int episode;
    int map;
} valid_modes[] = {
    { pack_chex, shareware,  1, 5 },
    { doom,      shareware,  1, 9 },
    { doom,      registered, 3, 9 },
    { doom,      retail,     4, 9 },
    { doom2,     commercial, 1, 32 },
    { pack_tnt,  commercial, 1, 32 },
    { pack_plut, commercial, 1, 32 },
    { pack_hacx, commercial, 1, 32 },
    { heretic,   shareware,  1, 9 },
    { heretic,   registered, 3, 9 },
    { heretic,   retail,     5, 9 },
    { hexen,     commercial, 1, 60 },
    { strife,    commercial, 1, 34 },
};

// Check that a gamemode+gamemission received over the network is valid.

boolean D_ValidGameMode(GameMission_t mission, GameMode_t mode)
{
    int i;

    for (i=0; i<arrlen(valid_modes); ++i)
    {
        if (valid_modes[i].mode == mode && valid_modes[i].mission == mission)
        {
            return true;
        }
    }

    return false;
}

boolean D_ValidEpisodeMap(GameMission_t mission, GameMode_t mode,
                          int episode, int map)
{
    int i;

    // Hacks for Heretic secret episodes

    if (mission == heretic)
    {
        if (mode == retail && episode == 6)
        {
            return map >= 1 && map <= 3;
        }
        else if (mode == registered && episode == 4)
        {
            return map == 1;
        }
    }

    // Find the table entry for this mission/mode combination.

    for (i=0; i<arrlen(valid_modes); ++i) 
    {
        if (mission == valid_modes[i].mission
         && mode == valid_modes[i].mode)
        {
            return episode >= 1 && episode <= valid_modes[i].episode
                && map >= 1 && map <= valid_modes[i].map;
        }
    }

    // Unknown mode/mission combination

    return false;
}

// Get the number of valid episodes for the specified mission/mode.

int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode)
{
    int episode;

    episode = 1;

    while (D_ValidEpisodeMap(mission, mode, episode, 1))
    {
        ++episode;
    }

    return episode - 1;
}

// Table of valid versions

static struct {
    GameMission_t mission;
    GameVersion_t version;
} valid_versions[] = {
    { doom,     exe_doom_1_9 },
    { doom,     exe_hacx },
    { doom,     exe_ultimate },
    { doom,     exe_final },
    { doom,     exe_final2 },
    { doom,     exe_chex },
    { heretic,  exe_heretic_1_3 },
    { hexen,    exe_hexen_1_1 },
    { strife,   exe_strife_1_2 },
    { strife,   exe_strife_1_31 },
};

boolean D_ValidGameVersion(GameMission_t mission, GameVersion_t version)
{
    int i;

    // All Doom variants can use the Doom versions.

    if (mission == doom2 || mission == pack_plut || mission == pack_tnt
     || mission == pack_hacx || mission == pack_chex)
    {
        mission = doom;
    }

    for (i=0; i<arrlen(valid_versions); ++i) 
    {
        if (valid_versions[i].mission == mission 
         && valid_versions[i].version == version)
        {
            return true;
        }
    }

    return false;
}

// Does this mission type use ExMy form, rather than MAPxy form?

boolean D_IsEpisodeMap(GameMission_t mission)
{
    switch (mission)
    {
        case doom:
        case heretic:
        case pack_chex:
            return true;

        case none:
        case hexen:
        case doom2:
        case pack_hacx:
        case pack_tnt:
        case pack_plut:
        case strife:
        default:
            return false;
    }
}

char *D_GameMissionString(GameMission_t mission)
{
    switch (mission)
    {
        case none:
        default:
            return "none";
        case doom:
            return "doom";
        case doom2:
            return "doom2";
        case pack_tnt:
            return "tnt";
        case pack_plut:
            return "plutonia";
        case pack_hacx:
            return "hacx";
        case pack_chex:
            return "chex";
        case heretic:
            return "heretic";
        case hexen:
            return "hexen";
        case strife:
            return "strife";
    }
}



================================================
FILE: fbdoom/d_mode.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//   Functions and definitions relating to the game type and operational
//   mode.
//

#ifndef __D_MODE__
#define __D_MODE__

#include "doomtype.h"

// The "mission" controls what game we are playing.

typedef enum
{
    doom,            // Doom 1
    doom2,           // Doom 2
    pack_tnt,        // Final Doom: TNT: Evilution
    pack_plut,       // Final Doom: The Plutonia Experiment
    pack_chex,       // Chex Quest (modded doom)
    pack_hacx,       // Hacx (modded doom2)
    heretic,         // Heretic
    hexen,           // Hexen
    strife,          // Strife

    none
} GameMission_t;

// The "mode" allows more accurate specification of the game mode we are
// in: eg. shareware vs. registered.  So doom1.wad and doom.wad are the
// same mission, but a different mode.

typedef enum
{
    shareware,       // Doom/Heretic shareware
    registered,      // Doom/Heretic registered
    commercial,      // Doom II/Hexen
    retail,          // Ultimate Doom
    indetermined     // Unknown.
} GameMode_t;

// What version are we emulating?

typedef enum
{
    exe_doom_1_2,    // Doom 1.2: shareware and registered
    exe_doom_1_666,  // Doom 1.666: for shareware, registered and commercial
    exe_doom_1_7,    // Doom 1.7/1.7a: "
    exe_doom_1_8,    // Doom 1.8: "
    exe_doom_1_9,    // Doom 1.9: "
    exe_hacx,        // Hacx
    exe_ultimate,    // Ultimate Doom (retail)
    exe_final,       // Final Doom
    exe_final2,      // Final Doom (alternate exe)
    exe_chex,        // Chex Quest executable (based on Final Doom)

    exe_heretic_1_3, // Heretic 1.3

    exe_hexen_1_1,   // Hexen 1.1
    exe_strife_1_2,  // Strife v1.2
    exe_strife_1_31  // Strife v1.31
} GameVersion_t;

// Skill level.

typedef enum
{
    sk_noitems = -1,        // the "-skill 0" hack
    sk_baby = 0,
    sk_easy,
    sk_medium,
    sk_hard,
    sk_nightmare
} skill_t;

boolean D_ValidGameMode(GameMission_t mission, GameMode_t mode);
boolean D_ValidGameVersion(GameMission_t mission, GameVersion_t version);
boolean D_ValidEpisodeMap(GameMission_t mission, GameMode_t mode,
                          int episode, int map);
int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode);
boolean D_IsEpisodeMap(GameMission_t mission);
char *D_GameMissionString(GameMission_t mission);

#endif /* #ifndef __D_MODE__ */



================================================
FILE: fbdoom/d_net.c
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//	DOOM Network game communication and protocol,
//	all OS independend parts.
//

#include <stdlib.h>

#include "doomfeatures.h"

#include "d_main.h"
#include "m_argv.h"
#include "m_menu.h"
#include "m_misc.h"
#include "i_system.h"
#include "i_timer.h"
#include "i_video.h"
#include "g_game.h"
#include "doomdef.h"
#include "doomstat.h"
#include "w_checksum.h"
#include "w_wad.h"

#include "deh_main.h"

#include "d_loop.h"

ticcmd_t *netcmds;

// Called when a player leaves the game

static void PlayerQuitGame(player_t *player)
{
    static char exitmsg[80];
    unsigned int player_num;

    player_num = player - players;

    // Do this the same way as Vanilla Doom does, to allow dehacked
    // replacements of this message

    M_StringCopy(exitmsg, DEH_String("Player 1 left the game"),
                 sizeof(exitmsg));

    exitmsg[7] += player_num;

    playeringame[player_num] = false;
    players[consoleplayer].message = exitmsg;

    // TODO: check if it is sensible to do this:

    if (demorecording) 
    {
        G_CheckDemoStatus ();
    }
}

static void RunTic(ticcmd_t *cmds, boolean *ingame)
{
    extern boolean advancedemo;
    unsigned int i;

    // Check for player quits.

    for (i = 0; i < MAXPLAYERS; ++i)
    {
        if (!demoplayback && playeringame[i] && !ingame[i])
        {
            PlayerQuitGame(&players[i]);
        }
    }

    netcmds = cmds;

    // check that there are players in the game.  if not, we cannot
    // run a tic.

    if (advancedemo)
        D_DoAdvanceDemo ();

    G_Ticker ();
}

static loop_interface_t doom_loop_interface = {
    D_ProcessEvents,
    G_BuildTiccmd,
    RunTic,
    M_Ticker
};


// Load game settings from the specified structure and
// set global variables.

static void LoadGameSettings(net_gamesettings_t *settings)
{
    unsigned int i;

    deathmatch = settings->deathmatch;
    startepisode = settings->episode;
    startmap = settings->map;
    startskill = settings->skill;
    startloadgame = settings->loadgame;
    lowres_turn = settings->lowres_turn;
    nomonsters = settings->nomonsters;
    fastparm = settings->fast_monsters;
    respawnparm = settings->respawn_monsters;
    timelimit = settings->timelimit;
    consoleplayer = settings->consoleplayer;

    if (lowres_turn)
    {
        printf("NOTE: Turning resolution is reduced; this is probably "
               "because there is a client recording a Vanilla demo.\n");
    }

    for (i = 0; i < MAXPLAYERS; ++i)
    {
        playeringame[i] = i < settings->num_players;
    }
}

// Save the game settings from global variables to the specified
// game settings structure.

static void SaveGameSettings(net_gamesettings_t *settings)
{
    // Fill in game settings structure with appropriate parameters
    // for the new game

    settings->deathmatch = deathmatch;
    settings->episode = startepisode;
    settings->map = startmap;
    settings->skill = startskill;
    settings->loadgame = startloadgame;
    settings->gameversion = gameversion;
    settings->nomonsters = nomonsters;
    settings->fast_monsters = fastparm;
    settings->respawn_monsters = respawnparm;
    settings->timelimit = timelimit;

    settings->lowres_turn = M_CheckParm("-record") > 0
                         && M_CheckParm("-longtics") == 0;
}

static void InitConnectData(net_connect_data_t *connect_data)
{
    connect_data->max_players = MAXPLAYERS;
    connect_data->drone = false;

    //!
    // @category net
    //
    // Run as the left screen in three screen mode.
    //

    if (M_CheckParm("-left") > 0)
    {
        viewangleoffset = ANG90;
        connect_data->drone = true;
    }

    //! 
    // @category net
    //
    // Run as the right screen in three screen mode.
    //

    if (M_CheckParm("-right") > 0)
    {
        viewangleoffset = ANG270;
        connect_data->drone = true;
    }

    //
    // Connect data
    //

    // Game type fields:

    connect_data->gamemode = gamemode;
    connect_data->gamemission = gamemission;

    // Are we recording a demo? Possibly set lowres turn mode

    connect_data->lowres_turn = M_CheckParm("-record") > 0
                             && M_CheckParm("-longtics") == 0;

    // Read checksums of our WAD directory and dehacked information

    W_Checksum(connect_data->wad_sha1sum);

#if ORIGCODE
    DEH_Checksum(connect_data->deh_sha1sum);
#endif

    // Are we playing with the Freedoom IWAD?

    connect_data->is_freedoom = W_CheckNumForName("FREEDOOM") >= 0;
}

void D_ConnectNetGame(void)
{
    net_connect_data_t connect_data;

    InitConnectData(&connect_data);
    netgame = D_InitNetGame(&connect_data);

    //!
    // @category net
    //
    // Start the game playing as though in a netgame with a single
    // player.  This can also be used to play back single player netgame
    // demos.
    //

    if (M_CheckParm("-solo-net") > 0)
    {
        netgame = true;
    }
}

//
// D_CheckNetGame
// Works out player numbers among the net participants
//
void D_CheckNetGame (void)
{
    net_gamesettings_t settings;

    if (netgame)
    {
        autostart = true;
    }

    D_RegisterLoopCallbacks(&doom_loop_interface);

    SaveGameSettings(&settings);
    D_StartNetGame(&settings, NULL);
    LoadGameSettings(&settings);

    DEH_printf("startskill %i  deathmatch: %i  startmap: %i  startepisode: %i\n",
               startskill, deathmatch, startmap, startepisode);

    DEH_printf("player %i of %i (%i nodes)\n",
               consoleplayer+1, settings.num_players, settings.num_players);

    // Show players here; the server might have specified a time limit

    if (timelimit > 0 && deathmatch)
    {
        // Gross hack to work like Vanilla:

        if (timelimit == 20 && M_CheckParm("-avg"))
        {
            DEH_printf("Austin Virtual Gaming: Levels will end "
                           "after 20 minutes\n");
        }
        else
        {
            DEH_printf("Levels will end after %d minute", timelimit);
            if (timelimit > 1)
                printf("s");
            printf(".\n");
        }
    }
}



================================================
FILE: fbdoom/d_player.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//
//


#ifndef __D_PLAYER__
#define __D_PLAYER__


// The player data structure depends on a number
// of other structs: items (internal inventory),
// animation states (closely tied to the sprites
// used to represent them, unfortunately).
#include "d_items.h"
#include "p_pspr.h"

// In addition, the player is just a special
// case of the generic moving object/actor.
#include "p_mobj.h"

// Finally, for odd reasons, the player input
// is buffered within the player data struct,
// as commands per game tick.
#include "d_ticcmd.h"

#include "net_defs.h"




//
// Player states.
//
typedef enum
{
    // Playing or camping.
    PST_LIVE,
    // Dead on the ground, view follows killer.
    PST_DEAD,
    // Ready to restart/respawn???
    PST_REBORN		

} playerstate_t;


//
// Player internal flags, for cheats and debug.
//
typedef enum
{
    // No clipping, walk through barriers.
    CF_NOCLIP		= 1,
    // No damage, no health loss.
    CF_GODMODE		= 2,
    // Not really a cheat, just a debug aid.
    CF_NOMOMENTUM	= 4

} cheat_t;


//
// Extended player object info: player_t
//
typedef struct player_s
{
    mobj_t*		mo;
    playerstate_t	playerstate;
    ticcmd_t		cmd;

    // Determine POV,
    //  including viewpoint bobbing during movement.
    // Focal origin above r.z
    fixed_t		viewz;
    // Base height above floor for viewz.
    fixed_t		viewheight;
    // Bob/squat speed.
    fixed_t         	deltaviewheight;
    // bounded/scaled total momentum.
    fixed_t         	bob;	

    // This is only used between levels,
    // mo->health is used during levels.
    int			health;	
    int			armorpoints;
    // Armor type is 0-2.
    int			armortype;	

    // Power ups. invinc and invis are tic counters.
    int			powers[NUMPOWERS];
    boolean		cards[NUMCARDS];
    boolean		backpack;
    
    // Frags, kills of other players.
    int			frags[MAXPLAYERS];
    weapontype_t	readyweapon;
    
    // Is wp_nochange if not changing.
    weapontype_t	pendingweapon;

    boolean		weaponowned[NUMWEAPONS];
    int			ammo[NUMAMMO];
    int			maxammo[NUMAMMO];

    // True if button down last tic.
    int			attackdown;
    int			usedown;

    // Bit flags, for cheats and debug.
    // See cheat_t, above.
    int			cheats;		

    // Refired shots are less accurate.
    int			refire;		

     // For intermission stats.
    int			killcount;
    int			itemcount;
    int			secretcount;

    // Hint messages.
    char*		message;	
    
    // For screen flashing (red or bright).
    int			damagecount;
    int			bonuscount;

    // Who did damage (NULL for floors/ceilings).
    mobj_t*		attacker;
    
    // So gun flashes light up areas.
    int			extralight;

    // Current PLAYPAL, ???
    //  can be set to REDCOLORMAP for pain, etc.
    int			fixedcolormap;

    // Player skin colorshift,
    //  0-3 for which color to draw player.
    int			colormap;	

    // Overlay view sprites (gun, etc).
    pspdef_t		psprites[NUMPSPRITES];

    // True if secret level has been done.
    boolean		didsecret;	

} player_t;


//
// INTERMISSION
// Structure passed e.g. to WI_Start(wb)
//
typedef struct
{
    boolean	in;	// whether the player is in game
    
    // Player stats, kills, collected items etc.
    int		skills;
    int		sitems;
    int		ssecret;
    int		stime; 
    int		frags[4];
    int		score;	// current score on entry, modified on return
  
} wbplayerstruct_t;

typedef struct
{
    int		epsd;	// episode # (0-2)

    // if true, splash the secret level
    boolean	didsecret;
    
    // previous and next levels, origin 0
    int		last;
    int		next;	
    
    int		maxkills;
    int		maxitems;
    int		maxsecret;
    int		maxfrags;

    // the par time
    int		partime;
    
    // index of this player in game
    int		pnum;	

    wbplayerstruct_t	plyr[MAXPLAYERS];

} wbstartstruct_t;


#endif


================================================
FILE: fbdoom/d_textur.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//	Typedefs related to to textures etc.,
//	 isolated here to make it easier separating modules.
//    


#ifndef __D_TEXTUR__
#define __D_TEXTUR__

#include "doomtype.h"




//
// Flats?
//
// a pic is an unmasked block of pixels
typedef struct
{
    byte		width;
    byte		height;
    byte		data;
} pic_t;




#endif


================================================
FILE: fbdoom/d_think.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//  MapObj data. Map Objects or mobjs are actors, entities,
//  thinker, take-your-pick... anything that moves, acts, or
//  suffers state changes of more or less violent nature.
//


#ifndef __D_THINK__
#define __D_THINK__





//
// Experimental stuff.
// To compile this as "ANSI C with classes"
//  we will need to handle the various
//  action functions cleanly.
//
typedef  void (*actionf_v)();
typedef  void (*actionf_p1)( void* );
typedef  void (*actionf_p2)( void*, void* );

typedef union
{
  actionf_v	acv;
  actionf_p1	acp1;
  actionf_p2	acp2;

} actionf_t;





// Historically, "think_t" is yet another
//  function pointer to a routine to handle
//  an actor.
typedef actionf_t  think_t;


// Doubly linked list of actors.
typedef struct thinker_s
{
    struct thinker_s*	prev;
    struct thinker_s*	next;
    think_t		function;
    
} thinker_t;



#endif


================================================
FILE: fbdoom/d_ticcmd.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 1993-2008 Raven Software
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//	System specific interface stuff.
//


#ifndef __D_TICCMD__
#define __D_TICCMD__

#include "doomtype.h"


// The data sampled per tick (single player)
// and transmitted to other peers (multiplayer).
// Mainly movements/button commands per game tick,
// plus a checksum for internal state consistency.

typedef struct
{
    signed char	forwardmove;	// *2048 for move
    signed char	sidemove;	// *2048 for move
    short angleturn;            // <<16 for angle delta
    byte chatchar;
    byte buttons;
    // villsa [STRIFE] according to the asm,
    // consistancy is a short, not a byte
    byte consistancy;           // checks for net game

    // villsa - Strife specific:

    byte buttons2;
    int inventory;
   
    // Heretic/Hexen specific:

    byte lookfly;               // look/fly up/down/centering
    byte arti;                  // artitype_t to use
} ticcmd_t;



#endif


================================================
FILE: fbdoom/deh_main.h
================================================
//
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
//
// Dehacked entrypoint and common code
//

#ifndef DEH_MAIN_H
#define DEH_MAIN_H

#include "doomtype.h"
#include "doomfeatures.h"
#include "deh_str.h"
#include "sha1.h"

// These are the limits that dehacked uses (from dheinit.h in the dehacked
// source).  If these limits are exceeded, it does not generate an error, but
// a warning is displayed.

#define DEH_VANILLA_NUMSTATES 966
#define DEH_VANILLA_NUMSFX 107

void DEH_ParseCommandLine(void);
int DEH_LoadFile(char *filename);
int DEH_LoadLump(int lumpnum, boolean allow_long, boolean allow_error);
int DEH_LoadLumpByName(char *name, boolean allow_long, boolean allow_error);

boolean DEH_ParseAssignment(char *line, char **variable_name, char **value);

void DEH_Checksum(sha1_digest_t digest);

extern boolean deh_allow_extended_strings;
extern boolean deh_allow_long_strings;
extern boolean deh_allow_long_cheats;
extern boolean deh_apply_cheats;

#endif /* #ifndef DEH_MAIN_H */



================================================
FILE: fbdoom/deh_misc.h
================================================
//
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
//
// Parses "Misc" sections in dehacked files
//

#ifndef DEH_MISC_H
#define DEH_MISC_H

#include "doomfeatures.h"

#define DEH_DEFAULT_INITIAL_HEALTH 100
#define DEH_DEFAULT_INITIAL_BULLETS 50
#define DEH_DEFAULT_MAX_HEALTH 200
#define DEH_DEFAULT_MAX_ARMOR 200
#define DEH_DEFAULT_GREEN_ARMOR_CLASS 1
#define DEH_DEFAULT_BLUE_ARMOR_CLASS 2
#define DEH_DEFAULT_MAX_SOULSPHERE 200
#define DEH_DEFAULT_SOULSPHERE_HEALTH 100
#define DEH_DEFAULT_MEGASPHERE_HEALTH 200
#define DEH_DEFAULT_GOD_MODE_HEALTH 100
#define DEH_DEFAULT_IDFA_ARMOR 200
#define DEH_DEFAULT_IDFA_ARMOR_CLASS 2
#define DEH_DEFAULT_IDKFA_ARMOR 200
#define DEH_DEFAULT_IDKFA_ARMOR_CLASS 2
#define DEH_DEFAULT_BFG_CELLS_PER_SHOT 40
#define DEH_DEFAULT_SPECIES_INFIGHTING 0

#ifdef FEATURE_DEHACKED

extern int deh_initial_health;             
extern int deh_initial_bullets;            
extern int deh_max_health;                 
extern int deh_max_armor;                  
extern int deh_green_armor_class;          
extern int deh_blue_armor_class;           
extern int deh_max_soulsphere;             
extern int deh_soulsphere_health;          
extern int deh_megasphere_health;          
extern int deh_god_mode_health;            
extern int deh_idfa_armor;                 
extern int deh_idfa_armor_class;           
extern int deh_idkfa_armor;                
extern int deh_idkfa_armor_class;          
extern int deh_bfg_cells_per_shot;         
extern int deh_species_infighting;           

#else

// If dehacked is disabled, hard coded values

#define deh_initial_health      DEH_DEFAULT_INITIAL_HEALTH
#define deh_initial_bullets     DEH_DEFAULT_INITIAL_BULLETS
#define deh_max_health          DEH_DEFAULT_MAX_HEALTH
#define deh_max_armor           DEH_DEFAULT_MAX_ARMOR
#define deh_green_armor_class   DEH_DEFAULT_GREEN_ARMOR_CLASS
#define deh_blue_armor_class    DEH_DEFAULT_BLUE_ARMOR_CLASS
#define deh_max_soulsphere      DEH_DEFAULT_MAX_SOULSPHERE
#define deh_soulsphere_health   DEH_DEFAULT_SOULSPHERE_HEALTH
#define deh_megasphere_health   DEH_DEFAULT_MEGASPHERE_HEALTH
#define deh_god_mode_health     DEH_DEFAULT_GOD_MODE_HEALTH
#define deh_idfa_armor          DEH_DEFAULT_IDFA_ARMOR
#define deh_idfa_armor_class    DEH_DEFAULT_IDFA_ARMOR_CLASS
#define deh_idkfa_armor         DEH_DEFAULT_IDKFA_ARMOR
#define deh_idkfa_armor_class   DEH_DEFAULT_IDKFA_ARMOR_CLASS
#define deh_bfg_cells_per_shot  DEH_DEFAULT_BFG_CELLS_PER_SHOT
#define deh_species_infighting  DEH_DEFAULT_SPECIES_INFIGHTING

#endif

#endif /* #ifndef DEH_MISC_H */



================================================
FILE: fbdoom/deh_str.h
================================================
//
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
//
// Dehacked string replacements
//

#ifndef DEH_STR_H
#define DEH_STR_H

#include <stdio.h>

#include "doomfeatures.h"

// Used to do dehacked text substitutions throughout the program

#ifdef FEATURE_DEHACKED

char *DEH_String(char *s);
void DEH_printf(char *fmt, ...);
void DEH_fprintf(FILE *fstream, char *fmt, ...);
void DEH_snprintf(char *buffer, size_t len, char *fmt, ...);
void DEH_AddStringReplacement(char *from_text, char *to_text);


#else

#define DEH_String(x) (x)
#define DEH_printf printf
#define DEH_fprintf fprintf
#define DEH_snprintf snprintf
#define DEH_AddStringReplacement(x, y)

#endif

#endif /* #ifndef DEH_STR_H */



================================================
FILE: fbdoom/doom.h
================================================
/*
 * doom.h
 *
 *  Created on: 18.02.2015
 *      Author: Florian
 */


#ifndef SRC_CHOCDOOM_DOOM_H_
#define SRC_CHOCDOOM_DOOM_H_

/*---------------------------------------------------------------------*
 *  additional includes                                                *
 *---------------------------------------------------------------------*/

/*---------------------------------------------------------------------*
 *  global definitions                                                 *
 *---------------------------------------------------------------------*/

/*---------------------------------------------------------------------*
 *  type declarations                                                  *
 *---------------------------------------------------------------------*/

/*---------------------------------------------------------------------*
 *  function prototypes                                                *
 *---------------------------------------------------------------------*/

void D_DoomMain (void);

/*---------------------------------------------------------------------*
 *  global data                                                        *
 *---------------------------------------------------------------------*/

/*---------------------------------------------------------------------*
 *  inline functions and function-like macros                          *
 *---------------------------------------------------------------------*/

/*---------------------------------------------------------------------*
 *  eof                                                                *
 *---------------------------------------------------------------------*/

#endif /* SRC_CHOCDOOM_DOOM_H_ */


================================================
FILE: fbdoom/doomdata.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//  all external data is defined here
//  most of the data is loaded into different structures at run time
//  some internal structures shared by many modules are here
//

#ifndef __DOOMDATA__
#define __DOOMDATA__

// The most basic types we use, portability.
#include "doomtype.h"

// Some global defines, that configure the game.
#include "doomdef.h"



//
// Map level types.
// The following data structures define the persistent format
// used in the lumps of the WAD files.
//

// Lump order in a map WAD: each map needs a couple of lumps
// to provide a complete scene geometry description.
enum
{
  ML_LABEL,		// A separator, name, ExMx or MAPxx
  ML_THINGS,		// Monsters, items..
  ML_LINEDEFS,		// LineDefs, from editing
  ML_SIDEDEFS,		// SideDefs, from editing
  ML_VERTEXES,		// Vertices, edited and BSP splits generated
  ML_SEGS,		// LineSegs, from LineDefs split by BSP
  ML_SSECTORS,		// SubSectors, list of LineSegs
  ML_NODES,		// BSP nodes
  ML_SECTORS,		// Sectors, from editing
  ML_REJECT,		// LUT, sector-sector visibility	
  ML_BLOCKMAP		// LUT, motion clipping, walls/grid element
};


// A single Vertex.
typedef struct
{
  short		x;
  short		y;
} PACKEDATTR mapvertex_t;


// A SideDef, defining the visual appearance of a wall,
// by setting textures and offsets.
typedef struct
{
  short		textureoffset;
  short		rowoffset;
  char		toptexture[8];
  char		bottomtexture[8];
  char		midtexture[8];
  // Front sector, towards viewer.
  short		sector;
} PACKEDATTR mapsidedef_t;



// A LineDef, as used for editing, and as input
// to the BSP builder.
typedef struct
{
  short		v1;
  short		v2;
  short		flags;
  short		special;
  short		tag;
  // sidenum[1] will be -1 if one sided
  short		sidenum[2];		
} PACKEDATTR maplinedef_t;


//
// LineDef attributes.
//

// Solid, is an obstacle.
#define ML_BLOCKING		1

// Blocks monsters only.
#define ML_BLOCKMONSTERS	2

// Backside will not be present at all
//  if not two sided.
#define ML_TWOSIDED		4

// If a texture is pegged, the texture will have
// the end exposed to air held constant at the
// top or bottom of the texture (stairs or pulled
// down things) and will move with a height change
// of one of the neighbor sectors.
// Unpegged textures allways have the first row of
// the texture at the top pixel of the line for both
// top and bottom textures (use next to windows).

// upper texture unpegged
#define ML_DONTPEGTOP		8

// lower texture unpegged
#define ML_DONTPEGBOTTOM	16	

// In AutoMap: don't map as two sided: IT'S A SECRET!
#define ML_SECRET		32

// Sound rendering: don't let sound cross two of these.
#define ML_SOUNDBLOCK		64

// Don't draw on the automap at all.
#define ML_DONTDRAW		128

// Set if already seen, thus drawn in automap.
#define ML_MAPPED		256




// Sector definition, from editing.
typedef	struct
{
  short		floorheight;
  short		ceilingheight;
  char		floorpic[8];
  char		ceilingpic[8];
  short		lightlevel;
  short		special;
  short		tag;
} PACKEDATTR mapsector_t;

// SubSector, as generated by BSP.
typedef struct
{
  short		numsegs;
  // Index of first one, segs are stored sequentially.
  short		firstseg;	
} PACKEDATTR mapsubsector_t;


// LineSeg, generated by splitting LineDefs
// using partition lines selected by BSP builder.
typedef struct
{
  short		v1;
  short		v2;
  short		angle;		
  short		linedef;
  short		side;
  short		offset;
} PACKEDATTR mapseg_t;



// BSP node structure.

// Indicate a leaf.
#define	NF_SUBSECTOR	0x8000

typedef struct
{
  // Partition line from (x,y) to x+dx,y+dy)
  short		x;
  short		y;
  short		dx;
  short		dy;

  // Bounding box for each child,
  // clip against view frustum.
  short		bbox[2][4];

  // If NF_SUBSECTOR its a subsector,
  // else it's a node of another subtree.
  unsigned short	children[2];

} PACKEDATTR mapnode_t;




// Thing definition, position, orientation and type,
// plus skill/visibility flags and attributes.
typedef struct
{
    short		x;
    short		y;
    short		angle;
    short		type;
    short		options;
} PACKEDATTR mapthing_t;





#endif			// __DOOMDATA__


================================================
FILE: fbdoom/doomdef.c
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//  DoomDef - basic defines for DOOM, e.g. Version, game mode
//   and skill level, and display parameters.
//



#include "doomdef.h"

// Location for any defines turned variables.

// None.




================================================
FILE: fbdoom/doomdef.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//  Internally used data structures for virtually everything,
//   lots of other stuff.
//

#ifndef __DOOMDEF__
#define __DOOMDEF__

#include <stdio.h>
#include <string.h>

#include "doomtype.h"
#include "i_timer.h"
#include "d_mode.h"

//
// Global parameters/defines.
//
// DOOM version
#define DOOM_VERSION 109

// Version code for cph's longtics hack ("v1.91")
#define DOOM_191_VERSION 111


// If rangecheck is undefined,
// most parameter validation debugging code will not be compiled
#define RANGECHECK

// The maximum number of players, multiplayer/networking.
#define MAXPLAYERS 4

// The current state of the game: whether we are
// playing, gazing at the intermission screen,
// the game final animation, or a demo. 
typedef enum
{
    GS_LEVEL,
    GS_INTERMISSION,
    GS_FINALE,
    GS_DEMOSCREEN,
} gamestate_t;

typedef enum
{
    ga_nothing,
    ga_loadlevel,
    ga_newgame,
    ga_loadgame,
    ga_savegame,
    ga_playdemo,
    ga_completed,
    ga_victory,
    ga_worlddone,
    ga_screenshot
} gameaction_t;

//
// Difficulty/skill settings/filters.
//

// Skill flags.
#define	MTF_EASY		1
#define	MTF_NORMAL		2
#define	MTF_HARD		4

// Deaf monsters/do not react to sound.
#define	MTF_AMBUSH		8


//
// Key cards.
//
typedef enum
{
    it_bluecard,
    it_yellowcard,
    it_redcard,
    it_blueskull,
    it_yellowskull,
    it_redskull,
    
    NUMCARDS
    
} card_t;



// The defined weapons,
//  including a marker indicating
//  user has not changed weapon.
typedef enum
{
    wp_fist,
    wp_pistol,
    wp_shotgun,
    wp_chaingun,
    wp_missile,
    wp_plasma,
    wp_bfg,
    wp_chainsaw,
    wp_supershotgun,

    NUMWEAPONS,
    
    // No pending weapon change.
    wp_nochange

} weapontype_t;


// Ammunition types defined.
typedef enum
{
    am_clip,	// Pistol / chaingun ammo.
    am_shell,	// Shotgun / double barreled shotgun.
    am_cell,	// Plasma rifle, BFG.
    am_misl,	// Missile launcher.
    NUMAMMO,
    am_noammo	// Unlimited for chainsaw / fist.	

} ammotype_t;


// Power up artifacts.
typedef enum
{
    pw_invulnerability,
    pw_strength,
    pw_invisibility,
    pw_ironfeet,
    pw_allmap,
    pw_infrared,
    NUMPOWERS
    
} powertype_t;



//
// Power up durations,
//  how many seconds till expiration,
//  assuming TICRATE is 35 ticks/second.
//
typedef enum
{
    INVULNTICS	= (30*TICRATE),
    INVISTICS	= (60*TICRATE),
    INFRATICS	= (120*TICRATE),
    IRONTICS	= (60*TICRATE)
    
} powerduration_t;

#endif          // __DOOMDEF__


================================================
FILE: fbdoom/doomfeatures.h
================================================
//
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//     List of features which can be enabled/disabled to slim down the
//     program.
//

#ifndef DOOM_FEATURES_H
#define DOOM_FEATURES_H

// Enables wad merging (the '-merge' command line parameter)

#undef FEATURE_WAD_MERGE

// Enables dehacked support ('-deh')

#undef FEATURE_DEHACKED

// Enables multiplayer support (network games)

#undef FEATURE_MULTIPLAYER

// Enables sound output

#undef FEATURE_SOUND

#endif /* #ifndef DOOM_FEATURES_H */




================================================
FILE: fbdoom/doomkeys.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//       Key definitions
//

#ifndef __DOOMKEYS__
#define __DOOMKEYS__

//
// DOOM keyboard definition.
// This is the stuff configured by Setup.Exe.
// Most key data are simple ascii (uppercased).
//
#define KEY_RIGHTARROW	0xae
#define KEY_LEFTARROW	0xac
#define KEY_UPARROW		0xad
#define KEY_DOWNARROW	0xaf
#define KEY_STRAFE_L	0xa0
#define KEY_STRAFE_R	0xa1
#define KEY_USE			0xa2
#define KEY_FIRE		0xa3
#define KEY_ESCAPE		27
#define KEY_ENTER		13
#define KEY_TAB			9
#define KEY_F1			(0x80+0x3b)
#define KEY_F2			(0x80+0x3c)
#define KEY_F3			(0x80+0x3d)
#define KEY_F4			(0x80+0x3e)
#define KEY_F5			(0x80+0x3f)
#define KEY_F6			(0x80+0x40)
#define KEY_F7			(0x80+0x41)
#define KEY_F8			(0x80+0x42)
#define KEY_F9			(0x80+0x43)
#define KEY_F10			(0x80+0x44)
#define KEY_F11			(0x80+0x57)
#define KEY_F12			(0x80+0x58)

#define KEY_BACKSPACE	0x7f
#define KEY_PAUSE	0xff

#define KEY_EQUALS	0x3d
#define KEY_MINUS	0x2d

#define KEY_RSHIFT	(0x80+0x36)
#define KEY_RCTRL	(0x80+0x1d)
#define KEY_RALT	(0x80+0x38)

#define KEY_LALT	KEY_RALT

// new keys:

#define KEY_CAPSLOCK    (0x80+0x3a)
#define KEY_NUMLOCK     (0x80+0x45)
#define KEY_SCRLCK      (0x80+0x46)
#define KEY_PRTSCR      (0x80+0x59)

#define KEY_HOME        (0x80+0x47)
#define KEY_END         (0x80+0x4f)
#define KEY_PGUP        (0x80+0x49)
#define KEY_PGDN        (0x80+0x51)
#define KEY_INS         (0x80+0x52)
#define KEY_DEL         (0x80+0x53)

#define KEYP_0          0
#define KEYP_1          KEY_END
#define KEYP_2          KEY_DOWNARROW
#define KEYP_3          KEY_PGDN
#define KEYP_4          KEY_LEFTARROW
#define KEYP_5          '5'
#define KEYP_6          KEY_RIGHTARROW
#define KEYP_7          KEY_HOME
#define KEYP_8          KEY_UPARROW
#define KEYP_9          KEY_PGUP

#define KEYP_DIVIDE     '/'
#define KEYP_PLUS       '+'
#define KEYP_MINUS      '-'
#define KEYP_MULTIPLY   '*'
#define KEYP_PERIOD     0
#define KEYP_EQUALS     KEY_EQUALS
#define KEYP_ENTER      KEY_ENTER

#endif          // __DOOMKEYS__



================================================
FILE: fbdoom/doomstat.c
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can redistribute it and/or
// modify it under the terms of the GNU General Public License
// as published by the Free Software Foundation; either version 2
// of the License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU General Public License for more details.
//
// DESCRIPTION:
//	Put all global tate variables here.
//

#include <stdio.h>

#include "doomstat.h"


// Game Mode - identify IWAD as shareware, retail etc.
GameMode_t gamemode = indetermined;
GameMission_t	gamemission = doom;
GameVersion_t   gameversion = exe_final2;
char *gamedescription;

// Set if homebrew PWAD stuff has been added.
boolean	modifiedgame;






================================================
FILE: fbdoom/doomstat.h
================================================
//
// Copyright(C) 1993-1996 Id Software, Inc.
// Copyright(C) 2005-2014 Simon Howard
//
// This program is free software; you can 
Download .txt
gitextract_f8lk69kj/

├── README.TXT
├── fbdoom/
│   ├── Makefile
│   ├── am_map.c
│   ├── am_map.h
│   ├── config.h
│   ├── d_englsh.h
│   ├── d_event.c
│   ├── d_event.h
│   ├── d_items.c
│   ├── d_items.h
│   ├── d_iwad.c
│   ├── d_iwad.h
│   ├── d_loop.c
│   ├── d_loop.h
│   ├── d_main.c
│   ├── d_main.h
│   ├── d_mode.c
│   ├── d_mode.h
│   ├── d_net.c
│   ├── d_player.h
│   ├── d_textur.h
│   ├── d_think.h
│   ├── d_ticcmd.h
│   ├── deh_main.h
│   ├── deh_misc.h
│   ├── deh_str.h
│   ├── doom.h
│   ├── doomdata.h
│   ├── doomdef.c
│   ├── doomdef.h
│   ├── doomfeatures.h
│   ├── doomkeys.h
│   ├── doomstat.c
│   ├── doomstat.h
│   ├── doomtype.h
│   ├── dstrings.c
│   ├── dstrings.h
│   ├── dummy.c
│   ├── f_finale.c
│   ├── f_finale.h
│   ├── f_wipe.c
│   ├── f_wipe.h
│   ├── g_game.c
│   ├── g_game.h
│   ├── gusconf.c
│   ├── gusconf.h
│   ├── hu_lib.c
│   ├── hu_lib.h
│   ├── hu_stuff.c
│   ├── hu_stuff.h
│   ├── i_cdmus.c
│   ├── i_cdmus.h
│   ├── i_endoom.c
│   ├── i_endoom.h
│   ├── i_input_sdl.c
│   ├── i_input_tty.c
│   ├── i_input_tty.h
│   ├── i_joystick.c
│   ├── i_joystick.h
│   ├── i_main.c
│   ├── i_oplmusic.c
│   ├── i_pcsound.c
│   ├── i_scale.c
│   ├── i_scale.h
│   ├── i_sdlmusic.c
│   ├── i_sdlsound.c
│   ├── i_sound.c
│   ├── i_sound.h
│   ├── i_sound_dummy.c
│   ├── i_swap.h
│   ├── i_system.c
│   ├── i_system.h
│   ├── i_timer.c
│   ├── i_timer.h
│   ├── i_video.c
│   ├── i_video.h
│   ├── i_video_fbdev.c
│   ├── icon.c
│   ├── info.c
│   ├── info.h
│   ├── m_argv.c
│   ├── m_argv.h
│   ├── m_bbox.c
│   ├── m_bbox.h
│   ├── m_cheat.c
│   ├── m_cheat.h
│   ├── m_config.c
│   ├── m_config.h
│   ├── m_controls.c
│   ├── m_controls.h
│   ├── m_fixed.c
│   ├── m_fixed.h
│   ├── m_menu.c
│   ├── m_menu.h
│   ├── m_misc.c
│   ├── m_misc.h
│   ├── m_random.c
│   ├── m_random.h
│   ├── memio.c
│   ├── memio.h
│   ├── net_client.h
│   ├── net_dedicated.h
│   ├── net_defs.h
│   ├── net_gui.h
│   ├── net_io.h
│   ├── net_loop.h
│   ├── net_packet.h
│   ├── net_query.h
│   ├── net_sdl.h
│   ├── net_server.h
│   ├── p_ceilng.c
│   ├── p_doors.c
│   ├── p_enemy.c
│   ├── p_floor.c
│   ├── p_inter.c
│   ├── p_inter.h
│   ├── p_lights.c
│   ├── p_local.h
│   ├── p_map.c
│   ├── p_maputl.c
│   ├── p_mobj.c
│   ├── p_mobj.h
│   ├── p_plats.c
│   ├── p_pspr.c
│   ├── p_pspr.h
│   ├── p_saveg.c
│   ├── p_saveg.h
│   ├── p_setup.c
│   ├── p_setup.h
│   ├── p_sight.c
│   ├── p_spec.c
│   ├── p_spec.h
│   ├── p_switch.c
│   ├── p_telept.c
│   ├── p_tick.c
│   ├── p_tick.h
│   ├── p_user.c
│   ├── r_bsp.c
│   ├── r_bsp.h
│   ├── r_data.c
│   ├── r_data.h
│   ├── r_defs.h
│   ├── r_draw.c
│   ├── r_draw.h
│   ├── r_local.h
│   ├── r_main.c
│   ├── r_main.h
│   ├── r_plane.c
│   ├── r_plane.h
│   ├── r_segs.c
│   ├── r_segs.h
│   ├── r_sky.c
│   ├── r_sky.h
│   ├── r_state.h
│   ├── r_things.c
│   ├── r_things.h
│   ├── s_sound.c
│   ├── s_sound.h
│   ├── sha1.c
│   ├── sha1.h
│   ├── sounds.c
│   ├── sounds.h
│   ├── st_lib.c
│   ├── st_lib.h
│   ├── st_stuff.c
│   ├── st_stuff.h
│   ├── statdump.c
│   ├── statdump.h
│   ├── stubs.c
│   ├── tables.c
│   ├── tables.h
│   ├── v_patch.h
│   ├── v_video.c
│   ├── v_video.h
│   ├── w_checksum.c
│   ├── w_checksum.h
│   ├── w_file.c
│   ├── w_file.h
│   ├── w_file_stdc.c
│   ├── w_file_stdc_unbuffered.c
│   ├── w_main.c
│   ├── w_main.h
│   ├── w_merge.h
│   ├── w_wad.c
│   ├── w_wad.h
│   ├── wi_stuff.c
│   ├── wi_stuff.h
│   ├── z_zone.c
│   └── z_zone.h
├── ipx/
│   ├── DOOMNET.C
│   ├── DOOMNET.H
│   ├── IPXNET.C
│   ├── IPXNET.H
│   ├── IPXSETUP.C
│   ├── IPXSTR.H
│   ├── IPX_FRCH.H
│   └── README
├── sersrc/
│   ├── DOOMNET.C
│   ├── DOOMNET.H
│   ├── PORT.C
│   ├── README.TXT
│   ├── SERSETUP.C
│   ├── SERSETUP.H
│   ├── SERSTR.H
│   └── SER_FRCH.H
└── sndserv/
    ├── Makefile
    ├── README.sndserv
    ├── linux.c
    ├── sounds.c
    ├── sounds.h
    ├── soundsrv.c
    ├── soundsrv.h
    ├── soundst.h
    ├── wadread.c
    └── wadread.h
Download .txt
SYMBOL INDEX (1477 symbols across 134 files)

FILE: fbdoom/am_map.c
  type fpoint_t (line 111) | typedef struct
  type fline_t (line 116) | typedef struct
  type mpoint_t (line 121) | typedef struct
  type mline_t (line 126) | typedef struct
  type islope_t (line 131) | typedef struct
  function AM_getIslope (line 274) | void
  function AM_activateNewScale (line 293) | void AM_activateNewScale(void)
  function AM_saveScaleAndLoc (line 308) | void AM_saveScaleAndLoc(void)
  function AM_restoreScaleAndLoc (line 319) | void AM_restoreScaleAndLoc(void)
  function AM_addMark (line 343) | void AM_addMark(void)
  function AM_findMinMaxBoundaries (line 355) | void AM_findMinMaxBoundaries(void)
  function AM_changeWindowLoc (line 395) | void AM_changeWindowLoc(void)
  function AM_initVariables (line 424) | void AM_initVariables(void)
  function AM_loadPics (line 480) | void AM_loadPics(void)
  function AM_unloadPics (line 493) | void AM_unloadPics(void)
  function AM_clearMarks (line 505) | void AM_clearMarks(void)
  function AM_LevelInit (line 518) | void AM_LevelInit(void)
  function AM_Stop (line 541) | void AM_Stop (void)
  function AM_Start (line 554) | void AM_Start (void)
  function AM_minOutWindowScale (line 573) | void AM_minOutWindowScale(void)
  function AM_maxOutWindowScale (line 583) | void AM_maxOutWindowScale(void)
  function boolean (line 594) | boolean
  function AM_changeWindowScale (line 742) | void AM_changeWindowScale(void)
  function AM_doFollowPlayer (line 761) | void AM_doFollowPlayer(void)
  function AM_updateLightLev (line 785) | void AM_updateLightLev(void)
  function AM_Ticker (line 806) | void AM_Ticker (void)
  function AM_clearFB (line 834) | void AM_clearFB(int color)
  function boolean (line 847) | boolean
  function AM_drawFline (line 983) | void
  function AM_drawMline (line 1061) | void
  function AM_drawGrid (line 1077) | void AM_drawGrid(int color)
  function AM_drawWalls (line 1123) | void AM_drawWalls(void)
  function AM_rotate (line 1178) | void
  function AM_drawLineCharacter (line 1197) | void
  function AM_drawPlayers (line 1246) | void AM_drawPlayers(void)
  function AM_drawThings (line 1290) | void
  function AM_drawMarks (line 1311) | void AM_drawMarks(void)
  function AM_drawCrosshair (line 1332) | void AM_drawCrosshair(int color)
  function AM_Drawer (line 1338) | void AM_Drawer (void)

FILE: fbdoom/d_event.c
  function D_PostEvent (line 35) | void D_PostEvent (event_t* ev)
  function event_t (line 43) | event_t *D_PopEvent(void)

FILE: fbdoom/d_event.h
  type evtype_t (line 32) | typedef enum
  type event_t (line 42) | typedef struct
  type buttoncode_t (line 74) | typedef enum
  type buttoncode2_t (line 106) | typedef enum

FILE: fbdoom/d_items.h
  type weaponinfo_t (line 28) | typedef struct

FILE: fbdoom/d_iwad.c
  function AddIWADDir (line 64) | static void AddIWADDir(char *dir)
  type registry_value_t (line 83) | typedef struct
  function CheckUninstallStrings (line 236) | static void CheckUninstallStrings(void)
  function CheckCollectorsEdition (line 270) | static void CheckCollectorsEdition(void)
  function CheckSteamEdition (line 297) | static void CheckSteamEdition(void)
  function CheckSteamGUSPatches (line 324) | static void CheckSteamGUSPatches(void)
  function CheckDOSDefaults (line 364) | static void CheckDOSDefaults(void)
  function boolean (line 391) | static boolean DirIsFile(char *path, char *filename)
  function GameMission_t (line 473) | static GameMission_t IdentifyIWADByName(char *name, int mask)
  function AddDoomWadPath (line 514) | static void AddDoomWadPath(void)
  function BuildIWADDirList (line 565) | static void BuildIWADDirList(void)
  function iwad_t (line 751) | const iwad_t **D_FindAllIWADs(int mask)

FILE: fbdoom/d_iwad.h
  type iwad_t (line 34) | typedef struct

FILE: fbdoom/d_loop.c
  type ticcmd_set_t (line 45) | typedef struct
  function GetAdjustedTime (line 119) | static int GetAdjustedTime(void)
  function boolean (line 136) | static boolean BuildNewTic(void)
  function NetUpdate (line 203) | void NetUpdate (void)
  function D_Disconnected (line 252) | static void D_Disconnected(void)
  function D_ReceiveTic (line 271) | void D_ReceiveTic(ticcmd_t *ticcmds, boolean *players_mask)
  function D_StartGameLoop (line 305) | void D_StartGameLoop(void)
  function BlockUntilStart (line 315) | static void BlockUntilStart(net_gamesettings_t *settings,
  function D_StartNetGame (line 340) | void D_StartNetGame(net_gamesettings_t *settings,
  function boolean (line 452) | boolean D_InitNetGame(net_connect_data_t *connect_data)
  function D_QuitNetGame (line 560) | void D_QuitNetGame (void)
  function GetLowTic (line 568) | static int GetLowTic(void)
  function OldNetSync (line 591) | static void OldNetSync(void)
  function boolean (line 642) | static boolean PlayersInGame(void)
  function TicdupSquash (line 672) | static void TicdupSquash(ticcmd_set_t *set)
  function SinglePlayerClear (line 689) | static void SinglePlayerClear(ticcmd_set_t *set)
  function TryRunTics (line 706) | void TryRunTics (void)
  function D_RegisterLoopCallbacks (line 823) | void D_RegisterLoopCallbacks(loop_interface_t *i)

FILE: fbdoom/d_loop.h
  type boolean (line 28) | typedef boolean (*netgame_startup_callback_t)(int ready_players,
  type loop_interface_t (line 31) | typedef struct

FILE: fbdoom/d_main.c
  function D_ProcessEvents (line 140) | void D_ProcessEvents (void)
  function D_Display (line 170) | void D_Display (void)
  function D_BindVariables (line 336) | void D_BindVariables(void)
  function boolean (line 389) | boolean D_GrabMouseCallback(void)
  function D_DoomLoop (line 409) | void D_DoomLoop (void)
  function D_PageTicker (line 474) | void D_PageTicker (void)
  function D_PageDrawer (line 485) | void D_PageDrawer (void)
  function D_AdvanceDemo (line 495) | void D_AdvanceDemo (void)
  function D_DoAdvanceDemo (line 505) | void D_DoAdvanceDemo (void)
  function D_StartTitle (line 593) | void D_StartTitle (void)
  function SetMissionForPackName (line 685) | static void SetMissionForPackName(char *pack_name)
  function D_IdentifyVersion (line 721) | void D_IdentifyVersion(void)
  function D_SetGameDescription (line 804) | void D_SetGameDescription(void)
  function boolean (line 867) | static boolean D_AddFile(char *filename)
  function PrintDehackedBanners (line 902) | void PrintDehackedBanners(void)
  function InitGameVersion (line 947) | static void InitGameVersion(void)
  function PrintGameVersion (line 1049) | void PrintGameVersion(void)
  function D_Endoom (line 1066) | static void D_Endoom(void)
  function LoadIwadDeh (line 1087) | static void LoadIwadDeh(void)
  function D_DoomMain (line 1160) | void D_DoomMain (void)

FILE: fbdoom/d_mode.c
  function boolean (line 50) | boolean D_ValidGameMode(GameMission_t mission, GameMode_t mode)
  function boolean (line 65) | boolean D_ValidEpisodeMap(GameMission_t mission, GameMode_t mode,
  function D_GetNumEpisodes (line 103) | int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode)
  function boolean (line 135) | boolean D_ValidGameVersion(GameMission_t mission, GameVersion_t version)
  function boolean (line 161) | boolean D_IsEpisodeMap(GameMission_t mission)

FILE: fbdoom/d_mode.h
  type GameMission_t (line 27) | typedef enum
  type GameMode_t (line 46) | typedef enum
  type GameVersion_t (line 57) | typedef enum
  type skill_t (line 79) | typedef enum

FILE: fbdoom/d_net.c
  function PlayerQuitGame (line 45) | static void PlayerQuitGame(player_t *player)
  function RunTic (line 71) | static void RunTic(ticcmd_t *cmds, boolean *ingame)
  function LoadGameSettings (line 108) | static void LoadGameSettings(net_gamesettings_t *settings)
  function SaveGameSettings (line 139) | static void SaveGameSettings(net_gamesettings_t *settings)
  function InitConnectData (line 159) | static void InitConnectData(net_connect_data_t *connect_data)
  function D_ConnectNetGame (line 215) | void D_ConnectNetGame(void)
  function D_CheckNetGame (line 240) | void D_CheckNetGame (void)

FILE: fbdoom/d_player.h
  type playerstate_t (line 48) | typedef enum
  type cheat_t (line 63) | typedef enum
  type player_t (line 78) | typedef struct player_s
  type wbplayerstruct_t (line 168) | typedef struct
  type wbstartstruct_t (line 182) | typedef struct

FILE: fbdoom/d_textur.h
  type pic_t (line 33) | typedef struct

FILE: fbdoom/d_think.h
  type actionf_t (line 39) | typedef union
  type actionf_t (line 54) | typedef actionf_t  think_t;
  type thinker_t (line 58) | typedef struct thinker_s

FILE: fbdoom/d_ticcmd.h
  type ticcmd_t (line 32) | typedef struct

FILE: fbdoom/doomdata.h
  type PACKEDATTR (line 57) | typedef struct
  type PACKEDATTR (line 66) | typedef struct
  type PACKEDATTR (line 81) | typedef struct
  type PACKEDATTR (line 138) | typedef	struct
  type PACKEDATTR (line 150) | typedef struct
  type PACKEDATTR (line 160) | typedef struct
  type PACKEDATTR (line 177) | typedef struct
  type PACKEDATTR (line 200) | typedef struct

FILE: fbdoom/doomdef.h
  type gamestate_t (line 50) | typedef enum
  type gameaction_t (line 58) | typedef enum
  type card_t (line 88) | typedef enum
  type weapontype_t (line 106) | typedef enum
  type ammotype_t (line 127) | typedef enum
  type powertype_t (line 140) | typedef enum
  type powerduration_t (line 159) | typedef enum

FILE: fbdoom/doomtype.h
  type boolean (line 69) | typedef bool boolean;
  type boolean (line 73) | typedef enum
  type byte (line 82) | typedef uint8_t byte;

FILE: fbdoom/dummy.c
  function I_InitTimidityConfig (line 43) | void I_InitTimidityConfig(void)

FILE: fbdoom/f_finale.c
  type finalestage_t (line 40) | typedef enum
  type textscreen_t (line 60) | typedef struct
  function F_StartFinale (line 108) | void F_StartFinale (void)
  function boolean (line 160) | boolean F_Responder (event_t *event)
  function F_Ticker (line 172) | void F_Ticker (void)
  function F_TextWrite (line 227) | void F_TextWrite (void)
  type castinfo_t (line 300) | typedef struct
  function F_StartCast (line 340) | void F_StartCast (void)
  function F_CastTicker (line 358) | void F_CastTicker (void)
  function boolean (line 465) | boolean F_CastResponder (event_t* ev)
  function F_CastPrint (line 486) | void F_CastPrint (char* text)
  function F_CastDrawer (line 541) | void F_CastDrawer (void)
  function F_DrawPatchCol (line 571) | void
  function F_BunnyScroll (line 606) | void F_BunnyScroll (void)
  function F_ArtScreenDrawer (line 661) | static void F_ArtScreenDrawer(void)
  function F_Drawer (line 702) | void F_Drawer (void)

FILE: fbdoom/f_wipe.c
  function wipe_shittyColMajorXform (line 42) | void
  function wipe_initColorXForm (line 64) | int
  function wipe_doColorXForm (line 74) | int
  function wipe_exitColorXForm (line 120) | int
  function wipe_initMelt (line 132) | int
  function wipe_doMelt (line 163) | int
  function wipe_exitMelt (line 218) | int
  function wipe_StartScreen (line 230) | int
  function wipe_EndScreen (line 242) | int
  function wipe_ScreenWipe (line 255) | int

FILE: fbdoom/g_game.c
  function G_CmdChecksum (line 233) | int G_CmdChecksum (ticcmd_t* cmd)
  function boolean (line 244) | static boolean WeaponSelectable(weapontype_t weapon)
  function G_NextWeapon (line 281) | static int G_NextWeapon(int direction)
  function G_BuildTiccmd (line 322) | void G_BuildTiccmd (ticcmd_t* cmd, int maketic)
  function G_DoLoadLevel (line 603) | void G_DoLoadLevel (void)
  function SetJoyButtons (line 675) | static void SetJoyButtons(unsigned int buttons_mask)
  function SetMouseButtons (line 703) | static void SetMouseButtons(unsigned int buttons_mask)
  function boolean (line 733) | boolean G_Responder (event_t* ev)
  function G_Ticker (line 854) | void G_Ticker (void)
  function G_InitPlayer (line 1039) | void G_InitPlayer (int player)
  function G_PlayerFinishLevel (line 1051) | void G_PlayerFinishLevel (int player)
  function G_PlayerReborn (line 1072) | void G_PlayerReborn (int player)
  function boolean (line 1115) | boolean
  function G_DeathMatchSpawnPlayer (line 1223) | void G_DeathMatchSpawnPlayer (int playernum)
  function G_DoReborn (line 1250) | void G_DoReborn (int playernum)
  function G_ScreenShot (line 1296) | void G_ScreenShot (void)
  function G_ExitLevel (line 1328) | void G_ExitLevel (void)
  function G_SecretExitLevel (line 1335) | void G_SecretExitLevel (void)
  function G_DoCompleted (line 1346) | void G_DoCompleted (void)
  function G_WorldDone (line 1494) | void G_WorldDone (void)
  function G_DoWorldDone (line 1519) | void G_DoWorldDone (void)
  function G_LoadGame (line 1539) | void G_LoadGame (char* name)
  function G_DoLoadGame (line 1548) | void G_DoLoadGame (void)
  function G_SaveGame (line 1600) | void
  function G_DoSaveGame (line 1610) | void G_DoSaveGame (void)
  function G_DeferedInitNew (line 1697) | void
  function G_DoNewGame (line 1710) | void G_DoNewGame (void)
  function G_InitNew (line 1726) | void
  function G_ReadDemoTiccmd (line 1898) | void G_ReadDemoTiccmd (ticcmd_t* cmd)
  function IncreaseDemoBuffer (line 1926) | static void IncreaseDemoBuffer(void)
  function G_WriteDemoTiccmd (line 1956) | void G_WriteDemoTiccmd (ticcmd_t* cmd)
  function G_RecordDemo (line 2010) | void G_RecordDemo (char *name)
  function G_VanillaVersionCode (line 2040) | int G_VanillaVersionCode(void)
  function G_BeginRecording (line 2058) | void G_BeginRecording (void)
  function G_DeferedPlayDemo (line 2107) | void G_DeferedPlayDemo (char* name)
  function G_DoPlayDemo (line 2152) | void G_DoPlayDemo (void)
  function G_TimeDemo (line 2220) | void G_TimeDemo (char* name)
  function boolean (line 2248) | boolean G_CheckDemoStatus (void)

FILE: fbdoom/gusconf.c
  type gus_config_t (line 34) | typedef struct
  function MappingIndex (line 43) | static unsigned int MappingIndex(void)
  function SplitLine (line 61) | static int SplitLine(char *line, char **fields, unsigned int max_fields)
  function ParseLine (line 108) | static void ParseLine(gus_config_t *config, char *line)
  function ParseDMXConfig (line 129) | static void ParseDMXConfig(char *dmxconf, gus_config_t *config)
  function FreeDMXConfig (line 165) | static void FreeDMXConfig(gus_config_t *config)
  function boolean (line 197) | static boolean WriteTimidityConfig(char *path, gus_config_t *config)
  function boolean (line 244) | boolean GUS_WriteConfig(char *path)

FILE: fbdoom/hu_lib.c
  function HUlib_init (line 36) | void HUlib_init(void)
  function HUlib_clearTextLine (line 40) | void HUlib_clearTextLine(hu_textline_t* t)
  function HUlib_initTextLine (line 47) | void
  function boolean (line 62) | boolean
  function boolean (line 80) | boolean HUlib_delCharFromTextLine(hu_textline_t* t)
  function HUlib_drawTextLine (line 93) | void
  function HUlib_eraseTextLine (line 137) | void HUlib_eraseTextLine(hu_textline_t* l)
  function HUlib_initSText (line 168) | void
  function HUlib_addLineToSText (line 192) | void HUlib_addLineToSText(hu_stext_t* s)
  function HUlib_addMessageToSText (line 208) | void
  function HUlib_drawSText (line 223) | void HUlib_drawSText(hu_stext_t* s)
  function HUlib_eraseSText (line 246) | void HUlib_eraseSText(hu_stext_t* s)
  function HUlib_initIText (line 261) | void
  function HUlib_delCharFromIText (line 278) | void HUlib_delCharFromIText(hu_itext_t* it)
  function HUlib_eraseLineFromIText (line 284) | void HUlib_eraseLineFromIText(hu_itext_t* it)
  function HUlib_resetIText (line 291) | void HUlib_resetIText(hu_itext_t* it)
  function HUlib_addPrefixToIText (line 297) | void
  function boolean (line 309) | boolean
  function HUlib_drawIText (line 329) | void HUlib_drawIText(hu_itext_t* it)
  function HUlib_eraseIText (line 340) | void HUlib_eraseIText(hu_itext_t* it)

FILE: fbdoom/hu_lib.h
  type hu_textline_t (line 36) | typedef struct
  type hu_stext_t (line 56) | typedef struct
  type hu_itext_t (line 72) | typedef struct

FILE: fbdoom/hu_stuff.c
  function HU_Init (line 286) | void HU_Init(void)
  function HU_Stop (line 303) | void HU_Stop(void)
  function HU_Start (line 308) | void HU_Start(void)
  function HU_Drawer (line 383) | void HU_Drawer(void)
  function HU_Erase (line 393) | void HU_Erase(void)
  function HU_Ticker (line 402) | void HU_Ticker(void)
  function HU_queueChatChar (line 482) | void HU_queueChatChar(char c)
  function HU_dequeueChatChar (line 495) | char HU_dequeueChatChar(void)
  function boolean (line 512) | boolean HU_Responder(event_t *ev)

FILE: fbdoom/i_cdmus.c
  function I_CDMusInit (line 38) | int I_CDMusInit(void)
  function I_CDMusPrintStartup (line 92) | void I_CDMusPrintStartup(void)
  function I_CDMusPlay (line 107) | int I_CDMusPlay(int track)
  function I_CDMusStop (line 130) | int I_CDMusStop(void)
  function I_CDMusResume (line 145) | int I_CDMusResume(void)
  function I_CDMusSetVolume (line 160) | int I_CDMusSetVolume(int volume)
  function I_CDMusFirstTrack (line 169) | int I_CDMusFirstTrack(void)
  function I_CDMusLastTrack (line 202) | int I_CDMusLastTrack(void)
  function I_CDMusTrackLength (line 219) | int I_CDMusTrackLength(int track_num)

FILE: fbdoom/i_endoom.c
  function I_Endoom (line 36) | void I_Endoom(byte *endoom_data)

FILE: fbdoom/i_input_sdl.c
  function TranslateKey (line 104) | static int TranslateKey(SDL_keysym *sym)
  function GetTypedChar (line 201) | static int GetTypedChar(SDL_Event *event)
  function UpdateShiftStatus (line 243) | static void UpdateShiftStatus(SDL_Event *event)
  function I_GetEvent (line 268) | void I_GetEvent(void)
  function I_StartTic (line 358) | void I_StartTic (void)
  function I_InitInput (line 363) | void I_InitInput(void)

FILE: fbdoom/i_input_tty.c
  function tty_is_kbd (line 235) | int tty_is_kbd(int fd)
  type termios (line 255) | struct termios
  function kbd_shutdown (line 258) | void kbd_shutdown(void)
  function kbd_init (line 277) | static int kbd_init(void)
  function kbd_read (line 361) | int kbd_read(int *pressed, unsigned char *key)
  function TranslateKey (line 379) | static unsigned char TranslateKey(unsigned char key)
  function GetTypedChar (line 392) | static unsigned char GetTypedChar(unsigned char key)
  function UpdateShiftStatus (line 413) | static void UpdateShiftStatus(int pressed, unsigned char key)
  function I_GetEvent (line 429) | void I_GetEvent(void)
  function I_InitInput (line 494) | void I_InitInput(void)

FILE: fbdoom/i_joystick.c
  function I_ShutdownJoystick (line 77) | void I_ShutdownJoystick(void)
  function boolean (line 90) | static boolean IsValidAxis(int axis)
  function I_InitJoystick (line 115) | void I_InitJoystick(void)
  function boolean (line 171) | static boolean IsAxisButton(int physbutton)
  function ReadButtonState (line 203) | static int ReadButtonState(int vbutton)
  function GetButtonsState (line 228) | static int GetButtonsState(void)
  function GetAxisState (line 248) | static int GetAxisState(int axis, int invert)
  function I_UpdateJoystick (line 321) | void I_UpdateJoystick(void)
  function I_BindJoystickVariables (line 339) | void I_BindJoystickVariables(void)

FILE: fbdoom/i_main.c
  function main (line 35) | int main(int argc, char **argv)

FILE: fbdoom/i_oplmusic.c
  type PACKEDATTR (line 49) | typedef struct
  type PACKEDATTR (line 59) | typedef struct
  type PACKEDATTR (line 68) | typedef struct
  type opl_channel_data_t (line 79) | typedef struct
  type opl_track_data_t (line 97) | typedef struct
  type opl_voice_t (line 108) | typedef struct opl_voice_s opl_voice_t;
  type opl_voice_s (line 110) | struct opl_voice_s
  function boolean (line 339) | static boolean LoadInstrumentTable(void)
  function opl_voice_t (line 364) | static opl_voice_t *GetFreeVoice(void)
  function RemoveVoiceFromAllocedList (line 390) | static void RemoveVoiceFromAllocedList(opl_voice_t *voice)
  function ReleaseVoice (line 413) | static void ReleaseVoice(opl_voice_t *voice)
  function LoadOperatorData (line 439) | static void LoadOperatorData(int operator, genmidi_op_t *data,
  function SetVoiceInstrument (line 463) | static void SetVoiceInstrument(opl_voice_t *voice,
  function SetVoiceVolume (line 507) | static void SetVoiceVolume(opl_voice_t *voice, unsigned int volume)
  function InitVoices (line 556) | static void InitVoices(void)
  function I_OPL_SetMusicVolume (line 581) | static void I_OPL_SetMusicVolume(int volume)
  function VoiceKeyOff (line 600) | static void VoiceKeyOff(opl_voice_t *voice)
  function KeyOffEvent (line 607) | static void KeyOffEvent(opl_track_data_t *track, midi_event_t *event)
  function CompareChannelPriorities (line 641) | static int CompareChannelPriorities(opl_channel_data_t *chan1,
  function opl_voice_t (line 654) | static opl_voice_t *ReplaceExistingVoice(opl_channel_data_t *channel)
  function FrequencyForVoice (line 715) | static unsigned int FrequencyForVoice(opl_voice_t *voice)
  function UpdateVoiceFrequency (line 790) | static void UpdateVoiceFrequency(opl_voice_t *voice)
  function VoiceKeyOn (line 812) | static void VoiceKeyOn(opl_channel_data_t *channel,
  function KeyOnEvent (line 870) | static void KeyOnEvent(opl_track_data_t *track, midi_event_t *event)
  function ProgramChangeEvent (line 929) | static void ProgramChangeEvent(opl_track_data_t *track, midi_event_t *ev...
  function SetChannelVolume (line 944) | static void SetChannelVolume(opl_channel_data_t *channel, unsigned int v...
  function AllNotesOff (line 962) | static void AllNotesOff(opl_channel_data_t *channel, unsigned int param)
  function ControllerEvent (line 976) | static void ControllerEvent(opl_track_data_t *track, midi_event_t *event)
  function PitchBendEvent (line 1013) | static void PitchBendEvent(opl_track_data_t *track, midi_event_t *event)
  function MetaSetTempo (line 1035) | static void MetaSetTempo(unsigned int tempo)
  function MetaEvent (line 1043) | static void MetaEvent(opl_track_data_t *track, midi_event_t *event)
  function ProcessEvent (line 1087) | static void ProcessEvent(opl_track_data_t *track, midi_event_t *event)
  function RestartSong (line 1133) | static void RestartSong(void *unused)
  function TrackTimerCallback (line 1149) | static void TrackTimerCallback(void *arg)
  function ScheduleTrack (line 1190) | static void ScheduleTrack(opl_track_data_t *track)
  function InitChannel (line 1208) | static void InitChannel(opl_track_data_t *track, opl_channel_data_t *cha...
  function StartTrack (line 1219) | static void StartTrack(midi_file_t *file, unsigned int track_num)
  function I_OPL_PlaySong (line 1239) | static void I_OPL_PlaySong(void *handle, boolean looping)
  function I_OPL_PauseSong (line 1272) | static void I_OPL_PauseSong(void)
  function I_OPL_ResumeSong (line 1298) | static void I_OPL_ResumeSong(void)
  function I_OPL_StopSong (line 1308) | static void I_OPL_StopSong(void)
  function I_OPL_UnRegisterSong (line 1349) | static void I_OPL_UnRegisterSong(void *handle)
  function boolean (line 1364) | static boolean IsMid(byte *mem, int len)
  function boolean (line 1369) | static boolean ConvertMus(byte *musdata, int len, char *filename)
  function boolean (line 1438) | static boolean I_OPL_MusicIsPlaying(void)
  function I_OPL_ShutdownMusic (line 1450) | static void I_OPL_ShutdownMusic(void)
  function boolean (line 1470) | static boolean I_OPL_InitMusic(void)
  function NumActiveChannels (line 1527) | static int NumActiveChannels(void)
  function ChannelInUse (line 1542) | static int ChannelInUse(opl_channel_data_t *channel)
  function I_OPL_DevMessages (line 1557) | void I_OPL_DevMessages(char *result, size_t result_len)

FILE: fbdoom/i_pcsound.c
  function PCSCallbackFunc (line 64) | static void PCSCallbackFunc(int *duration, int *freq)
  function boolean (line 106) | static boolean CachePCSLump(sfxinfo_t *sfxinfo)
  function boolean (line 151) | static boolean IsDisabledSound(sfxinfo_t *sfxinfo)
  function I_PCS_StartSound (line 174) | static int I_PCS_StartSound(sfxinfo_t *sfxinfo,
  function I_PCS_StopSound (line 215) | static void I_PCS_StopSound(int handle)
  function I_PCS_GetSfxLumpNum (line 242) | static int I_PCS_GetSfxLumpNum(sfxinfo_t* sfx)
  function boolean (line 259) | static boolean I_PCS_SoundIsPlaying(int handle)
  function boolean (line 274) | static boolean I_PCS_InitSound(boolean _use_sfx_prefix)
  function I_PCS_ShutdownSound (line 294) | static void I_PCS_ShutdownSound(void)
  function I_PCS_UpdateSound (line 302) | static void I_PCS_UpdateSound(void)
  function I_PCS_UpdateSoundParams (line 307) | void I_PCS_UpdateSoundParams(int channel, int vol, int sep)

FILE: fbdoom/i_scale.c
  function I_InitScale (line 61) | void I_InitScale(byte *_src_buffer, byte *_dest_buffer, int _dest_pitch)
  function boolean (line 75) | static boolean I_Scale1x(int x1, int y1, int x2, int y2)
  function boolean (line 105) | static boolean I_Scale2x(int x1, int y1, int x2, int y2)
  function boolean (line 146) | static boolean I_Scale3x(int x1, int y1, int x2, int y2)
  function boolean (line 191) | static boolean I_Scale4x(int x1, int y1, int x2, int y2)
  function boolean (line 240) | static boolean I_Scale5x(int x1, int y1, int x2, int y2)
  function FindNearestColor (line 295) | static int FindNearestColor(byte *palette, int r, int g, int b)
  function byte (line 332) | static byte *GenerateStretchTable(byte *palette, int pct)
  function I_InitStretchTables (line 361) | static void I_InitStretchTables(byte *palette)
  function I_InitSquashTable (line 387) | static void I_InitSquashTable(byte *palette)
  function I_ResetScaleTables (line 404) | void I_ResetScaleTables(byte *palette)
  function WriteBlendedLine1x (line 434) | static inline void WriteBlendedLine1x(byte *dest, byte *src1, byte *src2,
  function boolean (line 450) | static boolean I_Stretch1x(int x1, int y1, int x2, int y2)
  function WriteLine2x (line 507) | static inline void WriteLine2x(byte *dest, byte *src)
  function WriteBlendedLine2x (line 520) | static inline void WriteBlendedLine2x(byte *dest, byte *src1, byte *src2,
  function boolean (line 539) | static boolean I_Stretch2x(int x1, int y1, int x2, int y2)
  function WriteLine3x (line 620) | static inline void WriteLine3x(byte *dest, byte *src)
  function WriteBlendedLine3x (line 634) | static inline void WriteBlendedLine3x(byte *dest, byte *src1, byte *src2,
  function boolean (line 654) | static boolean I_Stretch3x(int x1, int y1, int x2, int y2)
  function WriteLine4x (line 759) | static inline void WriteLine4x(byte *dest, byte *src)
  function WriteBlendedLine4x (line 774) | static inline void WriteBlendedLine4x(byte *dest, byte *src1, byte *src2,
  function boolean (line 795) | static boolean I_Stretch4x(int x1, int y1, int x2, int y2)
  function WriteLine5x (line 924) | static inline void WriteLine5x(byte *dest, byte *src)
  function boolean (line 942) | static boolean I_Stretch5x(int x1, int y1, int x2, int y2)
  function WriteSquashedLine1x (line 1030) | static inline void WriteSquashedLine1x(byte *dest, byte *src)
  function boolean (line 1061) | static boolean I_Squash1x(int x1, int y1, int x2, int y2)
  function WriteSquashedLine2x (line 1102) | static inline void WriteSquashedLine2x(byte *dest, byte *src)
  function boolean (line 1160) | static boolean I_Squash2x(int x1, int y1, int x2, int y2)
  function WriteSquashedLine3x (line 1197) | static inline void WriteSquashedLine3x(byte *dest, byte *src)
  function boolean (line 1243) | static boolean I_Squash3x(int x1, int y1, int x2, int y2)
  function WriteSquashedLine4x (line 1279) | static inline void WriteSquashedLine4x(byte *dest, byte *src)
  function boolean (line 1354) | static boolean I_Squash4x(int x1, int y1, int x2, int y2)
  function WriteSquashedLine5x (line 1390) | static inline void WriteSquashedLine5x(byte *dest, byte *src)
  function boolean (line 1419) | static boolean I_Squash5x(int x1, int y1, int x2, int y2)

FILE: fbdoom/i_sdlmusic.c
  type subst_music_t (line 75) | typedef struct
  type file_metadata_t (line 82) | typedef struct
  function ParseVorbisTime (line 133) | static unsigned int ParseVorbisTime(unsigned int samplerate_hz, char *va...
  function ParseVorbisComment (line 169) | static void ParseVorbisComment(file_metadata_t *metadata, char *comment)
  function ParseVorbisComments (line 195) | static void ParseVorbisComments(file_metadata_t *metadata, FILE *fs)
  function ParseFlacStreaminfo (line 250) | static void ParseFlacStreaminfo(file_metadata_t *metadata, FILE *fs)
  function ParseFlacFile (line 269) | static void ParseFlacFile(file_metadata_t *metadata, FILE *fs)
  function ParseOggIdHeader (line 318) | static void ParseOggIdHeader(file_metadata_t *metadata, FILE *fs)
  function ParseOggFile (line 331) | static void ParseOggFile(file_metadata_t *metadata, FILE *fs)
  function ReadLoopPoints (line 369) | static void ReadLoopPoints(char *filename, file_metadata_t *metadata)
  function AddSubstituteMusic (line 459) | static void AddSubstituteMusic(subst_music_t *subst)
  function ParseHexDigit (line 467) | static int ParseHexDigit(char c)
  function boolean (line 621) | static boolean ReadSubstituteConfig(char *filename)
  function LoadSubstituteConfigs (line 660) | static void LoadSubstituteConfigs(void)
  function boolean (line 700) | static boolean IsMusicLump(int lumpnum)
  function DumpSubstituteConfig (line 723) | static void DumpSubstituteConfig(char *filename)
  function boolean (line 781) | static boolean WriteWrapperTimidityConfig(char *write_path)
  function I_InitTimidityConfig (line 813) | void I_InitTimidityConfig(void)
  function RemoveTimidityConfig (line 846) | static void RemoveTimidityConfig(void)
  function I_SDL_ShutdownMusic (line 857) | static void I_SDL_ShutdownMusic(void)
  function boolean (line 873) | static boolean SDLIsInitialized(void)
  function TrackPositionCallback (line 882) | void TrackPositionCallback(int chan, void *stream, int len, void *udata)
  function boolean (line 889) | static boolean I_SDL_InitMusic(void)
  function UpdateMusicVolume (line 986) | static void UpdateMusicVolume(void)
  function I_SDL_SetMusicVolume (line 1004) | static void I_SDL_SetMusicVolume(int volume)
  function I_SDL_PlaySong (line 1014) | static void I_SDL_PlaySong(void *handle, boolean looping)
  function I_SDL_PauseSong (line 1053) | static void I_SDL_PauseSong(void)
  function I_SDL_ResumeSong (line 1065) | static void I_SDL_ResumeSong(void)
  function I_SDL_StopSong (line 1077) | static void I_SDL_StopSong(void)
  function I_SDL_UnRegisterSong (line 1089) | static void I_SDL_UnRegisterSong(void *handle)
  function boolean (line 1108) | static boolean IsMid(byte *mem, int len)
  function boolean (line 1113) | static boolean ConvertMus(byte *musdata, int len, char *filename)
  function boolean (line 1220) | static boolean I_SDL_MusicIsPlaying(void)
  function GetMusicPosition (line 1231) | static double GetMusicPosition(void)
  function RestartCurrentTrack (line 1245) | static void RestartCurrentTrack(void)
  function I_SDL_PollMusic (line 1275) | static void I_SDL_PollMusic(void)

FILE: fbdoom/i_sdlsound.c
  type allocated_sound_t (line 48) | typedef struct allocated_sound_s allocated_sound_t;
  type allocated_sound_s (line 50) | struct allocated_sound_s
  function AllocatedSoundLink (line 93) | static void AllocatedSoundLink(allocated_sound_t *snd)
  function AllocatedSoundUnlink (line 112) | static void AllocatedSoundUnlink(allocated_sound_t *snd)
  function FreeAllocatedSound (line 133) | static void FreeAllocatedSound(allocated_sound_t *snd)
  function boolean (line 154) | static boolean FindAndFreeSound(void)
  function ReserveCacheSpace (line 180) | static void ReserveCacheSpace(size_t len)
  function Mix_Chunk (line 203) | static Mix_Chunk *AllocateSound(sfxinfo_t *sfxinfo, size_t len)
  function LockAllocatedSound (line 253) | static void LockAllocatedSound(allocated_sound_t *snd)
  function UnlockAllocatedSound (line 270) | static void UnlockAllocatedSound(allocated_sound_t *snd)
  function ReleaseSoundOnChannel (line 286) | static void ReleaseSoundOnChannel(int channel)
  function SRC_ConversionMode (line 304) | static int SRC_ConversionMode(void)
  function boolean (line 336) | static boolean ExpandSoundData_SRC(sfxinfo_t *sfxinfo,
  function boolean (line 448) | static boolean ConvertibleRatio(int freq1, int freq2)
  function WriteWAV (line 481) | static void WriteWAV(char *filename, byte *data,
  function boolean (line 530) | static boolean ExpandSoundData_SDL(sfxinfo_t *sfxinfo,
  function boolean (line 640) | static boolean CacheSFX(sfxinfo_t *sfxinfo)
  function GetSfxLumpName (line 714) | static void GetSfxLumpName(sfxinfo_t *sfx, char *buf, size_t buf_len)
  function I_SDL_PrecacheSounds (line 740) | static void I_SDL_PrecacheSounds(sfxinfo_t *sounds, int num_sounds)
  function I_SDL_PrecacheSounds (line 777) | static void I_SDL_PrecacheSounds(sfxinfo_t *sounds, int num_sounds)
  function boolean (line 786) | static boolean LockSound(sfxinfo_t *sfxinfo)
  function I_SDL_GetSfxLumpNum (line 808) | static int I_SDL_GetSfxLumpNum(sfxinfo_t *sfx)
  function I_SDL_UpdateSoundParams (line 817) | static void I_SDL_UpdateSoundParams(int handle, int vol, int sep)
  function I_SDL_StartSound (line 860) | static int I_SDL_StartSound(sfxinfo_t *sfxinfo, int channel, int vol, in...
  function I_SDL_StopSound (line 896) | static void I_SDL_StopSound(int handle)
  function boolean (line 912) | static boolean I_SDL_SoundIsPlaying(int handle)
  function I_SDL_UpdateSound (line 926) | static void I_SDL_UpdateSound(void)
  function I_SDL_ShutdownSound (line 944) | static void I_SDL_ShutdownSound(void)
  function GetSliceSize (line 960) | static int GetSliceSize(void)
  function boolean (line 984) | static boolean I_SDL_InitSound(boolean _use_sfx_prefix)

FILE: fbdoom/i_sound.c
  function boolean (line 114) | static boolean SndDeviceInList(snddevice_t device, snddevice_t *list,
  function InitSfxModule (line 133) | static void InitSfxModule(boolean use_sfx_prefix)
  function InitMusicModule (line 161) | static void InitMusicModule(void)
  function I_InitSound (line 193) | void I_InitSound(boolean use_sfx_prefix)
  function I_ShutdownSound (line 248) | void I_ShutdownSound(void)
  function I_GetSfxLumpNum (line 261) | int I_GetSfxLumpNum(sfxinfo_t *sfxinfo)
  function I_UpdateSound (line 273) | void I_UpdateSound(void)
  function CheckVolumeSeparation (line 286) | static void CheckVolumeSeparation(int *vol, int *sep)
  function I_UpdateSoundParams (line 307) | void I_UpdateSoundParams(int channel, int vol, int sep)
  function I_StartSound (line 316) | int I_StartSound(sfxinfo_t *sfxinfo, int channel, int vol, int sep)
  function I_StopSound (line 329) | void I_StopSound(int channel)
  function boolean (line 337) | boolean I_SoundIsPlaying(int channel)
  function I_PrecacheSounds (line 349) | void I_PrecacheSounds(sfxinfo_t *sounds, int num_sounds)
  function I_InitMusic (line 357) | void I_InitMusic(void)
  function I_ShutdownMusic (line 361) | void I_ShutdownMusic(void)
  function I_SetMusicVolume (line 366) | void I_SetMusicVolume(int volume)
  function I_PauseSong (line 374) | void I_PauseSong(void)
  function I_ResumeSong (line 382) | void I_ResumeSong(void)
  function I_UnRegisterSong (line 402) | void I_UnRegisterSong(void *handle)
  function I_PlaySong (line 410) | void I_PlaySong(void *handle, boolean looping)
  function I_StopSong (line 418) | void I_StopSong(void)
  function boolean (line 426) | boolean I_MusicIsPlaying(void)
  function I_BindSoundVariables (line 438) | void I_BindSoundVariables(void)

FILE: fbdoom/i_sound.h
  type sfxinfo_t (line 29) | typedef struct sfxinfo_struct	sfxinfo_t;
  type sfxinfo_struct (line 31) | struct sfxinfo_struct
  type musicinfo_t (line 72) | typedef struct
  type snddevice_t (line 88) | typedef enum
  type sound_module_t (line 105) | typedef struct
  type music_module_t (line 164) | typedef struct

FILE: fbdoom/i_sound_dummy.c
  function myioctl (line 157) | void
  function addsfx (line 261) | int
  function I_SetChannels (line 393) | void I_SetChannels()
  function I_SetSfxVolume (line 424) | void I_SetSfxVolume(int volume)
  function I_SetMusicVolume (line 435) | void I_SetMusicVolume(int volume)
  function I_GetSfxLumpNum (line 448) | int I_GetSfxLumpNum(sfxinfo_t* sfx)
  function I_StartSound (line 467) | int
  function I_StopSound (line 502) | void I_StopSound (int handle)
  function I_SoundIsPlaying (line 514) | int I_SoundIsPlaying(int handle)
  function I_UpdateSound (line 536) | void I_UpdateSound( void )
  function I_SubmitSound (line 662) | void
  function I_UpdateSoundParams (line 671) | void
  function I_ShutdownSound (line 690) | void I_ShutdownSound(void)
  function I_InitSound (line 734) | void
  function I_InitMusic (line 832) | void I_InitMusic(void)		{ }
  function I_ShutdownMusic (line 833) | void I_ShutdownMusic(void)	{ }
  function I_PlaySong (line 838) | void I_PlaySong(int handle, int looping)
  function I_PauseSong (line 845) | void I_PauseSong (int handle)
  function I_ResumeSong (line 851) | void I_ResumeSong (int handle)
  function I_StopSong (line 857) | void I_StopSong(int handle)
  function I_UnRegisterSong (line 866) | void I_UnRegisterSong(int handle)
  function I_RegisterSong (line 872) | int I_RegisterSong(void* data)
  function I_QrySongPlaying (line 881) | int I_QrySongPlaying(int handle)
  type sigset_t (line 899) | typedef     sigset_t        tSigSet;
  type tSigSet (line 901) | typedef     int             tSigSet;
  function I_HandleSoundTimer (line 911) | void I_HandleSoundTimer( int ignore )
  function I_SoundSetTimer (line 935) | int I_SoundSetTimer( int duration_of_tick )
  function I_SoundDelTimer (line 942) | void I_SoundDelTimer()

FILE: fbdoom/i_system.c
  type atexit_listentry_t (line 62) | typedef struct atexit_listentry_s atexit_listentry_t;
  type atexit_listentry_s (line 64) | struct atexit_listentry_s
  function I_AtExit (line 73) | void I_AtExit(atexit_func_t func, boolean run_on_error)
  function I_Tactile (line 87) | void I_Tactile(int on, int off, int total)
  function byte (line 95) | static byte *AutoAllocMemory(int *size, int default_ram, int min_ram)
  function byte (line 133) | byte *I_ZoneBase (int *size)
  function I_PrintBanner (line 166) | void I_PrintBanner(char *msg)
  function I_PrintDivider (line 177) | void I_PrintDivider(void)
  function I_PrintStartupBanner (line 189) | void I_PrintStartupBanner(char *gamedescription)
  function boolean (line 210) | boolean I_ConsoleStdout(void)
  function I_Quit (line 246) | void I_Quit (void)
  function ZenityAvailable (line 272) | static int ZenityAvailable(void)
  function ZenityErrorBox (line 323) | static int ZenityErrorBox(char *message)
  function I_Error (line 359) | void I_Error (char *error, ...)
  function boolean (line 499) | boolean I_GetMemoryValue(unsigned int offset, void *value, int size)

FILE: fbdoom/i_timer.c
  function I_GetTicks (line 33) | int I_GetTicks(void)
  function I_GetTime (line 42) | int  I_GetTime (void)
  function I_GetTimeMS (line 61) | int I_GetTimeMS(void)
  function I_Sleep (line 75) | void I_Sleep(int ms)
  function I_WaitVBL (line 81) | void I_WaitVBL(int count)
  function I_InitTimer (line 87) | void I_InitTimer(void)

FILE: fbdoom/i_video.c
  function boolean (line 290) | static boolean MouseShouldBeGrabbed()
  function I_SetGrabMouseCallback (line 331) | void I_SetGrabMouseCallback(grabmouse_callback_t func)
  function I_DisplayFPSDots (line 338) | void I_DisplayFPSDots(boolean dots_on)
  function UpdateFocus (line 349) | static void UpdateFocus(void)
  function SetShowCursor (line 368) | static void SetShowCursor(boolean show)
  function I_EnableLoadingDisk (line 396) | void I_EnableLoadingDisk(void)
  function TranslateKey (line 453) | static int TranslateKey(SDL_keysym *sym)
  function I_ShutdownGraphics (line 548) | void I_ShutdownGraphics(void)
  function I_GetEvent (line 561) | void __attribute__ ((weak)) I_GetEvent(void)
  function I_StartFrame (line 569) | void I_StartFrame (void)
  function UpdateMouseButtonState (line 574) | static void UpdateMouseButtonState(unsigned int button, boolean on)
  function AccelerateMouse (line 626) | static int AccelerateMouse(int val)
  function GetTypedChar (line 643) | static int GetTypedChar(SDL_Event *event)
  function UpdateShiftStatus (line 685) | static void UpdateShiftStatus(SDL_Event *event)
  function I_GetEvent (line 709) | void I_GetEvent(void)
  function CenterMouse (line 827) | static void CenterMouse(void)
  function I_ReadMouse (line 849) | static void I_ReadMouse(void)
  function I_StartTic (line 887) | void I_StartTic (void)
  function I_UpdateNoBlit (line 908) | void I_UpdateNoBlit (void)
  function UpdateGrab (line 913) | static void UpdateGrab(void)
  function boolean (line 955) | static boolean BlitArea(int x1, int y1, int x2, int y2)
  function UpdateRect (line 988) | static void UpdateRect(int x1, int y1, int x2, int y2)
  function I_BeginRead (line 1010) | void I_BeginRead(void)
  function I_EndRead (line 1038) | void I_EndRead(void)
  function I_FinishUpdate (line 1066) | void I_FinishUpdate (void)
  function I_ReadScreen (line 1149) | void I_ReadScreen (byte* scr)
  function I_SetPalette (line 1158) | void I_SetPalette (byte *doompalette)
  function I_GetPaletteIndex (line 1177) | int I_GetPaletteIndex(int r, int g, int b)
  function I_SetWindowTitle (line 1209) | void I_SetWindowTitle(char *title)
  function I_InitWindowTitle (line 1219) | void I_InitWindowTitle(void)
  function I_InitWindowIcon (line 1230) | void I_InitWindowIcon(void)
  function GetScreenModes (line 1268) | static void GetScreenModes(screen_mode_t ***modes_list, int *num_modes)
  function screen_mode_t (line 1284) | static screen_mode_t *I_FindScreenMode(int w, int h)
  function boolean (line 1343) | static boolean AutoAdjustFullscreen(void)
  function AutoAdjustWindowed (line 1423) | static void AutoAdjustWindowed(void)
  function AutoAdjustColorDepth (line 1453) | static void AutoAdjustColorDepth(void)
  function I_AutoAdjustSettings (line 1508) | static void I_AutoAdjustSettings(void)
  function SetScaleFactor (line 1552) | static void SetScaleFactor(int factor)
  function I_GraphicsCheckCommandLine (line 1573) | void I_GraphicsCheckCommandLine(void)
  function I_CheckIsScreensaver (line 1785) | void I_CheckIsScreensaver(void)
  function CreateCursors (line 1797) | static void CreateCursors(void)
  function SetSDLVideoDriver (line 1812) | static void SetSDLVideoDriver(void)
  function SetWindowPositionVars (line 1827) | static void SetWindowPositionVars(void)
  function SetVideoMode (line 1868) | static void SetVideoMode(screen_mode_t *mode, int w, int h)
  function ApplyWindowResize (line 1969) | static void ApplyWindowResize(unsigned int w, unsigned int h)
  function I_InitGraphics (line 1995) | void I_InitGraphics(void)
  function I_BindVideoVariables (line 2166) | void I_BindVideoVariables(void)

FILE: fbdoom/i_video.h
  type screen_mode_t (line 40) | typedef struct
  type boolean (line 92) | typedef boolean (*grabmouse_callback_t)(void);

FILE: fbdoom/i_video_fbdev.c
  type fb_var_screeninfo (line 53) | struct fb_var_screeninfo
  type color (line 57) | struct color {
  type color (line 64) | struct color
  type col_t (line 102) | typedef struct
  function cmap_to_rgb565 (line 113) | void cmap_to_rgb565(uint16_t * out, uint8_t * in, int in_pixels)
  function cmap_to_fb (line 134) | void cmap_to_fb(uint8_t * out, uint8_t * in, int in_pixels)
  function I_InitGraphics (line 161) | void I_InitGraphics (void)
  function I_ShutdownGraphics (line 209) | void I_ShutdownGraphics (void)
  function I_StartFrame (line 215) | void I_StartFrame (void)
  function I_GetEvent (line 220) | __attribute__ ((weak)) void I_GetEvent (void)
  function I_StartTic (line 390) | __attribute__ ((weak)) void I_StartTic (void)
  function I_UpdateNoBlit (line 395) | void I_UpdateNoBlit (void)
  function I_FinishUpdate (line 403) | void I_FinishUpdate (void)
  function I_ReadScreen (line 452) | void I_ReadScreen (byte* scr)
  function I_SetPalette (line 465) | void I_SetPalette (byte* palette)
  function I_GetPaletteIndex (line 498) | int I_GetPaletteIndex (int r, int g, int b)
  function I_BeginRead (line 534) | void I_BeginRead (void)
  function I_EndRead (line 538) | void I_EndRead (void)
  function I_SetWindowTitle (line 542) | void I_SetWindowTitle (char *title)
  function I_GraphicsCheckCommandLine (line 546) | void I_GraphicsCheckCommandLine (void)
  function I_SetGrabMouseCallback (line 550) | void I_SetGrabMouseCallback (grabmouse_callback_t func)
  function I_EnableLoadingDisk (line 554) | void I_EnableLoadingDisk(void)
  function I_BindVideoVariables (line 558) | void I_BindVideoVariables (void)
  function I_DisplayFPSDots (line 562) | void I_DisplayFPSDots (boolean dots_on)
  function I_CheckIsScreensaver (line 566) | void I_CheckIsScreensaver (void)

FILE: fbdoom/info.h
  type spritenum_t (line 27) | typedef enum
  type statenum_t (line 171) | typedef enum
  type state_t (line 1144) | typedef struct
  type mobjtype_t (line 1159) | typedef enum {
  type mobjinfo_t (line 1301) | typedef struct

FILE: fbdoom/m_argv.c
  function M_CheckParmWithArgs (line 43) | int M_CheckParmWithArgs(char *check, int num_args)
  function boolean (line 63) | boolean M_ParmExists(char *check)
  function M_CheckParm (line 68) | int M_CheckParm(char *check)
  function LoadResponseFile (line 75) | static void LoadResponseFile(int argv_index)
  function M_FindResponseFile (line 235) | void M_FindResponseFile(void)

FILE: fbdoom/m_bbox.c
  function M_ClearBox (line 29) | void M_ClearBox (fixed_t *box)
  function M_AddToBox (line 35) | void

FILE: fbdoom/m_cheat.c
  function cht_CheckCheat (line 34) | int
  function cht_GetParam (line 81) | void

FILE: fbdoom/m_cheat.h
  type cheatseq_t (line 35) | typedef struct

FILE: fbdoom/m_config.c
  type default_type_t (line 52) | typedef enum
  type default_t (line 61) | typedef struct
  type default_collection_t (line 88) | typedef struct
  function default_t (line 1563) | static default_t *SearchCollection(default_collection_t *collection, cha...
  function SaveDefaultCollection (line 1609) | static void SaveDefaultCollection(default_collection_t *collection)
  function ParseIntParameter (line 1716) | static int ParseIntParameter(char *strparm)
  function SetVariable (line 1728) | static void SetVariable(default_t *def, char *value)
  function LoadDefaultCollection (line 1771) | static void LoadDefaultCollection(default_collection_t *collection)
  function M_SetConfigFilenames (line 1836) | void M_SetConfigFilenames(char *main_config, char *extra_config)
  function M_SaveDefaults (line 1846) | void M_SaveDefaults (void)
  function M_SaveDefaultsAlternate (line 1856) | void M_SaveDefaultsAlternate(char *main, char *extra)
  function M_LoadDefaults (line 1881) | void M_LoadDefaults (void)
  function default_t (line 1937) | static default_t *GetDefaultForName(char *name)
  function M_BindVariable (line 1964) | void M_BindVariable(char *name, void *location)
  function boolean (line 1977) | boolean M_SetVariable(char *name, char *value)
  function M_GetIntVariable (line 1995) | int M_GetIntVariable(char *name)
  function M_GetFloatVariable (line 2025) | float M_GetFloatVariable(char *name)
  function M_SetConfigDir (line 2081) | void M_SetConfigDir(char *dir)

FILE: fbdoom/m_controls.c
  function M_BindBaseControls (line 204) | void M_BindBaseControls(void)
  function M_BindHereticControls (line 241) | void M_BindHereticControls(void)
  function M_BindHexenControls (line 256) | void M_BindHexenControls(void)
  function M_BindStrifeControls (line 272) | void M_BindStrifeControls(void)
  function M_BindWeaponControls (line 307) | void M_BindWeaponControls(void)
  function M_BindMapControls (line 328) | void M_BindMapControls(void)
  function M_BindMenuControls (line 344) | void M_BindMenuControls(void)
  function M_BindChatControls (line 375) | void M_BindChatControls(unsigned int num_players)
  function M_ApplyPlatformDefaults (line 394) | void M_ApplyPlatformDefaults(void)

FILE: fbdoom/m_fixed.c
  function fixed_t (line 33) | fixed_t
  function fixed_t (line 47) | fixed_t FixedDiv(fixed_t a, fixed_t b)

FILE: fbdoom/m_fixed.h
  type fixed_t (line 32) | typedef int fixed_t;

FILE: fbdoom/m_menu.c
  type menuitem_t (line 134) | typedef struct
  type menu_t (line 152) | typedef struct menu_s
  function M_ReadSaveStrings (line 504) | void M_ReadSaveStrings(void)
  function M_DrawLoad (line 531) | void M_DrawLoad(void)
  function M_DrawSaveLoadBorder (line 550) | void M_DrawSaveLoadBorder(int x,int y)
  function M_LoadSelect (line 573) | void M_LoadSelect(int choice)
  function M_LoadGame (line 586) | void M_LoadGame (int choice)
  function M_DrawSave (line 602) | void M_DrawSave(void)
  function M_DoSave (line 623) | void M_DoSave(int slot)
  function M_SaveSelect (line 636) | void M_SaveSelect(int choice)
  function M_SaveGame (line 651) | void M_SaveGame (int choice)
  function M_QuickSaveResponse (line 673) | void M_QuickSaveResponse(int key)
  function M_QuickSave (line 682) | void M_QuickSave(void)
  function M_QuickLoadResponse (line 710) | void M_QuickLoadResponse(int key)
  function M_QuickLoad (line 720) | void M_QuickLoad(void)
  function M_DrawReadThis1 (line 744) | void M_DrawReadThis1(void)
  function M_DrawReadThis2 (line 821) | void M_DrawReadThis2(void)
  function M_DrawSound (line 835) | void M_DrawSound(void)
  function M_Sound (line 846) | void M_Sound(int choice)
  function M_SfxVol (line 851) | void M_SfxVol(int choice)
  function M_MusicVol (line 868) | void M_MusicVol(int choice)
  function M_DrawMainMenu (line 891) | void M_DrawMainMenu(void)
  function M_DrawNewGame (line 903) | void M_DrawNewGame(void)
  function M_NewGame (line 909) | void M_NewGame(int choice)
  function M_DrawEpisode (line 931) | void M_DrawEpisode(void)
  function M_VerifyNightmare (line 936) | void M_VerifyNightmare(int key)
  function M_ChooseSkill (line 945) | void M_ChooseSkill(int choice)
  function M_Episode (line 957) | void M_Episode(int choice)
  function M_DrawOptions (line 988) | void M_DrawOptions(void)
  function M_Options (line 1008) | void M_Options(int choice)
  function M_ChangeMessages (line 1018) | void M_ChangeMessages(int choice)
  function M_EndGameResponse (line 1036) | void M_EndGameResponse(int key)
  function M_EndGame (line 1046) | void M_EndGame(int choice)
  function M_ReadThis (line 1070) | void M_ReadThis(int choice)
  function M_ReadThis2 (line 1076) | void M_ReadThis2(int choice)
  function M_FinishReadThis (line 1094) | void M_FinishReadThis(int choice)
  function M_QuitResponse (line 1132) | void M_QuitResponse(int key)
  function M_QuitDOOM (line 1170) | void M_QuitDOOM(int choice)
  function M_ChangeSensitivity (line 1181) | void M_ChangeSensitivity(int choice)
  function M_ChangeDetail (line 1199) | void M_ChangeDetail(int choice)
  function M_SizeDisplay (line 1215) | void M_SizeDisplay(int choice)
  function M_DrawThermo (line 1245) | void
  function M_DrawEmptyCell (line 1271) | void
  function M_DrawSelCell (line 1280) | void
  function M_StartMessage (line 1290) | void
  function M_StopMessage (line 1306) | void M_StopMessage(void)
  function M_StringWidth (line 1317) | int M_StringWidth(char* string)
  function M_StringHeight (line 1340) | int M_StringHeight(char* string)
  function M_WriteText (line 1358) | void
  function boolean (line 1405) | static boolean IsNullKey(int key)
  function boolean (line 1418) | boolean M_Responder (event_t* ev)
  function M_StartControlPanel (line 1901) | void M_StartControlPanel (void)
  function M_DrawOPLDev (line 1915) | static void M_DrawOPLDev(void)
  function M_Drawer (line 1953) | void M_Drawer (void)
  function M_ClearMenus (line 2043) | void M_ClearMenus (void)
  function M_SetupNextMenu (line 2056) | void M_SetupNextMenu(menu_t *menudef)
  function M_Ticker (line 2066) | void M_Ticker (void)
  function M_Init (line 2079) | void M_Init (void)

FILE: fbdoom/m_misc.c
  function M_MakeDirectory (line 55) | void M_MakeDirectory(char *path)
  function boolean (line 66) | boolean M_FileExists(char *filename)
  function M_FileLength (line 90) | long M_FileLength(FILE *handle)
  function boolean (line 112) | boolean M_WriteFile(char *name, void *source, int length)
  function M_ReadFile (line 136) | int M_ReadFile(char *name, byte **buffer)
  function boolean (line 190) | boolean M_StrToInt(const char *str, int *result)
  function M_ExtractFileBase (line 198) | void M_ExtractFileBase(char *path, char *dest)
  function M_ForceUppercase (line 243) | void M_ForceUppercase(char *text)
  function boolean (line 373) | boolean M_StringCopy(char *dest, const char *src, size_t dest_size)
  function boolean (line 394) | boolean M_StringConcat(char *dest, const char *src, size_t dest_size)
  function boolean (line 409) | boolean M_StringStartsWith(const char *s, const char *prefix)
  function boolean (line 417) | boolean M_StringEndsWith(const char *s, const char *suffix)
  function M_vsnprintf (line 482) | int M_vsnprintf(char *buf, size_t buf_len, const char *s, va_list args)
  function M_snprintf (line 508) | int M_snprintf(char *buf, size_t buf_len, const char *s, ...)

FILE: fbdoom/m_random.c
  function P_Random (line 50) | int P_Random (void)
  function M_Random (line 56) | int M_Random (void)
  function M_ClearRandom (line 62) | void M_ClearRandom (void)

FILE: fbdoom/memio.c
  type memfile_mode_t (line 27) | typedef enum {
  type _MEMFILE (line 32) | struct _MEMFILE {
  function MEMFILE (line 42) | MEMFILE *mem_fopen_read(void *buf, size_t buflen)
  function mem_fread (line 58) | size_t mem_fread(void *buf, size_t size, size_t nmemb, MEMFILE *stream)
  function MEMFILE (line 90) | MEMFILE *mem_fopen_write(void)
  function mem_fwrite (line 107) | size_t mem_fwrite(const void *ptr, size_t size, size_t nmemb, MEMFILE *s...
  function mem_get_buf (line 143) | void mem_get_buf(MEMFILE *stream, void **buf, size_t *buflen)
  function mem_fclose (line 149) | void mem_fclose(MEMFILE *stream)
  function mem_ftell (line 159) | long mem_ftell(MEMFILE *stream)
  function mem_fseek (line 164) | int mem_fseek(MEMFILE *stream, signed long position, mem_rel_t whence)

FILE: fbdoom/memio.h
  type MEMFILE (line 19) | typedef struct _MEMFILE MEMFILE;
  type mem_rel_t (line 21) | typedef enum

FILE: fbdoom/net_defs.h
  type net_module_t (line 47) | typedef struct _net_module_s net_module_t;
  type net_packet_t (line 48) | typedef struct _net_packet_s net_packet_t;
  type net_addr_t (line 49) | typedef struct _net_addr_s net_addr_t;
  type net_context_t (line 50) | typedef struct _net_context_s net_context_t;
  type _net_packet_s (line 52) | struct _net_packet_s
  type _net_module_s (line 60) | struct _net_module_s
  type _net_addr_s (line 95) | struct _net_addr_s
  type net_packet_type_t (line 111) | typedef enum
  type net_master_packet_type_t (line 131) | typedef enum
  type net_connect_data_t (line 147) | typedef struct
  type net_gamesettings_t (line 163) | typedef struct
  type net_ticdiff_t (line 202) | typedef struct
  type net_full_ticcmd_t (line 210) | typedef struct
  type net_querydata_t (line 220) | typedef struct
  type net_waitdata_t (line 233) | typedef struct

FILE: fbdoom/p_ceilng.c
  function T_MoveCeiling (line 45) | void T_MoveCeiling (ceiling_t* ceiling)
  function EV_DoCeiling (line 160) | int
  function P_AddActiveCeiling (line 240) | void P_AddActiveCeiling(ceiling_t* c)
  function P_RemoveActiveCeiling (line 259) | void P_RemoveActiveCeiling(ceiling_t* c)
  function P_ActivateInStasisCeiling (line 280) | void P_ActivateInStasisCeiling(line_t* line)
  function EV_CeilingCrushStop (line 303) | int	EV_CeilingCrushStop(line_t	*line)

FILE: fbdoom/p_doors.c
  function T_VerticalDoor (line 57) | void T_VerticalDoor (vldoor_t* door)
  function EV_DoLockedDoor (line 194) | int
  function EV_DoDoor (line 251) | int
  function EV_VerticalDoor (line 336) | void
  function P_SpawnDoorCloseIn30 (line 519) | void P_SpawnDoorCloseIn30 (sector_t* sec)
  function P_SpawnDoorRaiseIn5Mins (line 541) | void
  function P_InitSlidingDoorFrames (line 580) | void P_InitSlidingDoorFrames(void)
  function P_FindSlidingDoorType (line 624) | int P_FindSlidingDoorType(line_t*	line)
  function T_SlidingDoor (line 639) | void T_SlidingDoor (slidedoor_t*	door)
  function EV_SlidingDoor (line 726) | void

FILE: fbdoom/p_enemy.c
  type dirtype_t (line 44) | typedef enum
  function P_RecursiveSound (line 98) | void
  function P_NoiseAlert (line 151) | void
  function boolean (line 167) | boolean P_CheckMeleeRange (mobj_t*	actor)
  function boolean (line 190) | boolean P_CheckMissileRange (mobj_t* actor)
  function boolean (line 260) | boolean P_Move (mobj_t*	actor)
  function boolean (line 337) | boolean P_TryWalk (mobj_t* actor)
  function P_NewChaseDir (line 351) | void P_NewChaseDir (mobj_t*	actor)
  function boolean (line 486) | boolean
  function A_KeenDie (line 551) | void A_KeenDie (mobj_t* mo)
  function A_Look (line 589) | void A_Look (mobj_t* actor)
  function A_Chase (line 657) | void A_Chase (mobj_t*	actor)
  function A_FaceTarget (line 767) | void A_FaceTarget (mobj_t* actor)
  function A_PosAttack (line 787) | void A_PosAttack (mobj_t* actor)
  function A_SPosAttack (line 806) | void A_SPosAttack (mobj_t* actor)
  function A_CPosAttack (line 830) | void A_CPosAttack (mobj_t* actor)
  function A_CPosRefire (line 850) | void A_CPosRefire (mobj_t* actor)
  function A_SpidRefire (line 867) | void A_SpidRefire (mobj_t* actor)
  function A_BspiAttack (line 883) | void A_BspiAttack (mobj_t *actor)
  function A_TroopAttack (line 898) | void A_TroopAttack (mobj_t* actor)
  function A_SargAttack (line 920) | void A_SargAttack (mobj_t* actor)
  function A_HeadAttack (line 935) | void A_HeadAttack (mobj_t* actor)
  function A_CyberAttack (line 954) | void A_CyberAttack (mobj_t* actor)
  function A_BruisAttack (line 964) | void A_BruisAttack (mobj_t* actor)
  function A_SkelMissile (line 987) | void A_SkelMissile (mobj_t* actor)
  function A_Tracer (line 1006) | void A_Tracer (mobj_t* actor)
  function A_SkelWhoosh (line 1078) | void A_SkelWhoosh (mobj_t*	actor)
  function A_SkelFist (line 1086) | void A_SkelFist (mobj_t*	actor)
  function boolean (line 1114) | boolean PIT_VileCheck (mobj_t*	thing)
  function A_VileChase (line 1152) | void A_VileChase (mobj_t* actor)
  function A_VileStart (line 1218) | void A_VileStart (mobj_t* actor)
  function A_StartFire (line 1230) | void A_StartFire (mobj_t* actor)
  function A_FireCrackle (line 1236) | void A_FireCrackle (mobj_t* actor)
  function A_Fire (line 1242) | void A_Fire (mobj_t* actor)
  function A_VileTarget (line 1273) | void A_VileTarget (mobj_t*	actor)
  function A_VileAttack (line 1298) | void A_VileAttack (mobj_t* actor)
  function A_FatRaise (line 1339) | void A_FatRaise (mobj_t *actor)
  function A_FatAttack1 (line 1346) | void A_FatAttack1 (mobj_t* actor)
  function A_FatAttack2 (line 1366) | void A_FatAttack2 (mobj_t* actor)
  function A_FatAttack3 (line 1385) | void A_FatAttack3 (mobj_t*	actor)
  function A_SkullAttack (line 1415) | void A_SkullAttack (mobj_t* actor)
  function A_PainShootSkull (line 1445) | void
  function A_PainAttack (line 1508) | void A_PainAttack (mobj_t* actor)
  function A_PainDie (line 1518) | void A_PainDie (mobj_t* actor)
  function A_Scream (line 1531) | void A_Scream (mobj_t* actor)
  function A_XScream (line 1568) | void A_XScream (mobj_t* actor)
  function A_Pain (line 1573) | void A_Pain (mobj_t* actor)
  function A_Fall (line 1581) | void A_Fall (mobj_t *actor)
  function A_Explode (line 1594) | void A_Explode (mobj_t* thingy)
  function boolean (line 1605) | static boolean CheckBossEnd(mobjtype_t motype)
  function A_BossDeath (line 1656) | void A_BossDeath (mobj_t* mo)
  function A_Hoof (line 1757) | void A_Hoof (mobj_t* mo)
  function A_Metal (line 1763) | void A_Metal (mobj_t* mo)
  function A_BabyMetal (line 1769) | void A_BabyMetal (mobj_t* mo)
  function A_OpenShotgun2 (line 1775) | void
  function A_LoadShotgun2 (line 1783) | void
  function A_CloseShotgun2 (line 1796) | void
  function A_BrainAwake (line 1811) | void A_BrainAwake (mobj_t* mo)
  function A_BrainPain (line 1841) | void A_BrainPain (mobj_t*	mo)
  function A_BrainScream (line 1847) | void A_BrainScream (mobj_t*	mo)
  function A_BrainExplode (line 1873) | void A_BrainExplode (mobj_t* mo)
  function A_BrainDie (line 1894) | void A_BrainDie (mobj_t*	mo)
  function A_BrainSpit (line 1899) | void A_BrainSpit (mobj_t*	mo)
  function A_SpawnSound (line 1928) | void A_SpawnSound (mobj_t* mo)
  function A_SpawnFly (line 1934) | void A_SpawnFly (mobj_t* mo)
  function A_PlayerScream (line 1992) | void A_PlayerScream (mobj_t* mo)

FILE: fbdoom/p_floor.c
  function result_e (line 41) | result_e
  function T_MoveFloor (line 202) | void T_MoveFloor(floormove_t* floor)
  function EV_DoFloor (line 250) | int
  function EV_BuildStairs (line 443) | int

FILE: fbdoom/p_inter.c
  function boolean (line 65) | boolean
  function boolean (line 159) | boolean
  function boolean (line 222) | boolean
  function boolean (line 245) | boolean
  function P_GiveCard (line 267) | void
  function boolean (line 283) | boolean
  function P_TouchSpecialThing (line 332) | void
  function P_KillMobj (line 665) | void
  function P_DamageMobj (line 778) | void

FILE: fbdoom/p_lights.c
  function T_FireFlicker (line 39) | void T_FireFlicker (fireflicker_t* flick)
  function P_SpawnFireFlicker (line 61) | void P_SpawnFireFlicker (sector_t*	sector)
  function T_LightFlash (line 91) | void T_LightFlash (lightflash_t* flash)
  function P_SpawnLightFlash (line 117) | void P_SpawnLightFlash (sector_t*	sector)
  function T_StrobeFlash (line 148) | void T_StrobeFlash (strobe_t*		flash)
  function P_SpawnStrobeFlash (line 173) | void
  function EV_StartLightStrobing (line 208) | void EV_StartLightStrobing(line_t*	line)
  function EV_TurnTagLightsOff (line 229) | void EV_TurnTagLightsOff(line_t* line)
  function EV_LightTurnOn (line 263) | void
  function T_Glow (line 307) | void T_Glow(glow_t*	g)
  function P_SpawnGlowingLight (line 334) | void P_SpawnGlowingLight(sector_t*	sector)

FILE: fbdoom/p_local.h
  type divline_t (line 133) | typedef struct
  type intercept_t (line 142) | typedef struct
  type boolean (line 160) | typedef boolean (*traverser_t) (intercept_t *in);

FILE: fbdoom/p_map.c
  function boolean (line 97) | boolean PIT_StompThing (mobj_t* thing)
  function boolean (line 130) | boolean
  function boolean (line 206) | boolean PIT_CheckLine (line_t* ld)
  function boolean (line 275) | boolean PIT_CheckThing (mobj_t* thing)
  function boolean (line 401) | boolean
  function boolean (line 477) | boolean
  function boolean (line 557) | boolean P_ThingHeightClip (mobj_t* thing)
  function P_HitSlideLine (line 611) | void P_HitSlideLine (line_t* ld)
  function boolean (line 663) | boolean PTR_SlideTraverse (intercept_t* in)
  function P_SlideMove (line 722) | void P_SlideMove (mobj_t* mo)
  function boolean (line 842) | boolean
  function boolean (line 928) | boolean PTR_ShootTraverse (intercept_t* in)
  function fixed_t (line 1067) | fixed_t
  function P_LineAttack (line 1109) | void
  function boolean (line 1142) | boolean	PTR_UseTraverse (intercept_t* in)
  function P_UseLines (line 1177) | void P_UseLines (player_t*	player)
  function boolean (line 1211) | boolean PIT_RadiusAttack (mobj_t* thing)
  function P_RadiusAttack (line 1252) | void
  function boolean (line 1304) | boolean PIT_ChangeSector (mobj_t*	thing)
  function boolean (line 1367) | boolean
  function SpechitOverrun (line 1391) | static void SpechitOverrun(line_t *ld)

FILE: fbdoom/p_maputl.c
  function fixed_t (line 43) | fixed_t
  function P_PointOnLineSide (line 60) | int
  function P_BoxOnLineSide (line 104) | int
  function P_PointOnDivlineSide (line 155) | int
  function P_MakeDivline (line 205) | void
  function fixed_t (line 225) | fixed_t
  function P_LineOpening (line 295) | void P_LineOpening (line_t* linedef)
  function P_UnsetThingPosition (line 342) | void P_UnsetThingPosition (mobj_t* thing)
  function P_SetThingPosition (line 390) | void
  function boolean (line 466) | boolean
  function boolean (line 507) | boolean
  function boolean (line 558) | boolean
  function boolean (line 614) | boolean PIT_AddThingIntercepts (mobj_t* thing)
  function boolean (line 681) | boolean
  type intercepts_overrun_t (line 738) | typedef struct
  function InterceptsMemoryOverrun (line 782) | static void InterceptsMemoryOverrun(int location, int value)
  function InterceptsOverrun (line 827) | static void InterceptsOverrun(int num_intercepts, intercept_t *intercept)
  function boolean (line 860) | boolean

FILE: fbdoom/p_mobj.c
  function boolean (line 47) | boolean
  function P_ExplodeMissile (line 84) | void P_ExplodeMissile (mobj_t* mo)
  function P_XYMovement (line 108) | void P_XYMovement (mobj_t* mo)
  function P_ZMovement (line 240) | void P_ZMovement (mobj_t* mo)
  function P_NightmareRespawn (line 382) | void
  function P_MobjThinker (line 441) | void P_MobjThinker (mobj_t* mobj)
  function mobj_t (line 505) | mobj_t*
  function P_RemoveMobj (line 572) | void P_RemoveMobj (mobj_t* mobj)
  function P_RespawnSpecials (line 604) | void P_RespawnSpecials (void)
  function P_SpawnPlayer (line 668) | void P_SpawnPlayer (mapthing_t* mthing)
  function P_SpawnMapThing (line 739) | void P_SpawnMapThing (mapthing_t* mthing)
  function P_SpawnPuff (line 850) | void
  function P_SpawnBlood (line 877) | void
  function P_CheckMissileSpawn (line 907) | void P_CheckMissileSpawn (mobj_t* th)
  function mobj_t (line 929) | mobj_t *P_SubstNullMobj(mobj_t *mobj)
  function mobj_t (line 949) | mobj_t*
  function P_SpawnPlayerMissile (line 995) | void

FILE: fbdoom/p_mobj.h
  type mobjflag_t (line 111) | typedef enum
  type mobj_t (line 201) | typedef struct mobj_s

FILE: fbdoom/p_plats.c
  function T_PlatRaise (line 45) | void T_PlatRaise(plat_t* plat)
  function EV_DoPlat (line 128) | int
  function P_ActivateInStasis (line 248) | void P_ActivateInStasis(int tag)
  function EV_StopPlat (line 263) | void EV_StopPlat(line_t* line)
  function P_AddActivePlat (line 278) | void P_AddActivePlat(plat_t* plat)
  function P_RemoveActivePlat (line 291) | void P_RemoveActivePlat(plat_t* plat)

FILE: fbdoom/p_pspr.c
  function P_SetPsprite (line 49) | void
  function P_CalcSwing (line 103) | void P_CalcSwing (player_t*	player)
  function P_BringUpWeapon (line 129) | void P_BringUpWeapon (player_t* player)
  function boolean (line 152) | boolean P_CheckAmmo (player_t* player)
  function P_FireWeapon (line 237) | void P_FireWeapon (player_t* player)
  function P_DropWeapon (line 256) | void P_DropWeapon (player_t* player)
  function A_WeaponReady (line 272) | void
  function A_ReFire (line 334) | void A_ReFire
  function A_CheckReload (line 356) | void
  function A_Lower (line 375) | void
  function A_Raise (line 413) | void
  function A_GunFlash (line 439) | void
  function A_Punch (line 458) | void
  function A_Saw (line 492) | void
  function DecreaseAmmo (line 542) | static void DecreaseAmmo(player_t *player, int ammonum, int amount)
  function A_FireMissile (line 558) | void
  function A_FireBFG (line 571) | void
  function A_FirePlasma (line 586) | void
  function P_BulletSlope (line 610) | void P_BulletSlope (mobj_t*	mo)
  function P_GunShot (line 634) | void
  function A_FirePistol (line 655) | void
  function A_FireShotgun (line 677) | void
  function A_FireShotgun2 (line 704) | void
  function A_FireCGun (line 741) | void
  function A_Light0 (line 770) | void A_Light0 (player_t *player, pspdef_t *psp)
  function A_Light1 (line 775) | void A_Light1 (player_t *player, pspdef_t *psp)
  function A_Light2 (line 780) | void A_Light2 (player_t *player, pspdef_t *psp)
  function A_BFGSpray (line 790) | void A_BFGSpray (mobj_t* mo)
  function A_BFGsound (line 826) | void
  function P_SetupPsprites (line 840) | void P_SetupPsprites (player_t* player)
  function P_MovePsprites (line 860) | void P_MovePsprites (player_t* player)

FILE: fbdoom/p_pspr.h
  type psprnum_t (line 54) | typedef enum
  type pspdef_t (line 62) | typedef struct

FILE: fbdoom/p_saveg.c
  function byte (line 81) | static byte saveg_read8(void)
  function saveg_write8 (line 99) | static void saveg_write8(byte value)
  function saveg_read16 (line 112) | static short saveg_read16(void)
  function saveg_write16 (line 122) | static void saveg_write16(short value)
  function saveg_read32 (line 128) | static int saveg_read32(void)
  function saveg_write32 (line 140) | static void saveg_write32(int value)
  function saveg_read_pad (line 150) | static void saveg_read_pad(void)
  function saveg_write_pad (line 166) | static void saveg_write_pad(void)
  function saveg_writep (line 190) | static void saveg_writep(void *p)
  function saveg_read_mapthing_t (line 208) | static void saveg_read_mapthing_t(mapthing_t *str)
  function saveg_write_mapthing_t (line 226) | static void saveg_write_mapthing_t(mapthing_t *str)
  function saveg_read_actionf_t (line 248) | static void saveg_read_actionf_t(actionf_t *str)
  function saveg_write_actionf_t (line 254) | static void saveg_write_actionf_t(actionf_t *str)
  function saveg_read_thinker_t (line 273) | static void saveg_read_thinker_t(thinker_t *str)
  function saveg_write_thinker_t (line 285) | static void saveg_write_thinker_t(thinker_t *str)
  function saveg_read_mobj_t (line 301) | static void saveg_read_mobj_t(mobj_t *str)
  function saveg_write_mobj_t (line 421) | static void saveg_write_mobj_t(mobj_t *str)
  function saveg_read_ticcmd_t (line 541) | static void saveg_read_ticcmd_t(ticcmd_t *str)
  function saveg_write_ticcmd_t (line 563) | static void saveg_write_ticcmd_t(ticcmd_t *str)
  function saveg_read_pspdef_t (line 589) | static void saveg_read_pspdef_t(pspdef_t *str)
  function saveg_write_pspdef_t (line 615) | static void saveg_write_pspdef_t(pspdef_t *str)
  function saveg_read_player_t (line 641) | static void saveg_read_player_t(player_t *str)
  function saveg_write_player_t (line 772) | static void saveg_write_player_t(player_t *str)
  function saveg_read_ceiling_t (line 908) | static void saveg_read_ceiling_t(ceiling_t *str)
  function saveg_write_ceiling_t (line 944) | static void saveg_write_ceiling_t(ceiling_t *str)
  function saveg_read_vldoor_t (line 981) | static void saveg_read_vldoor_t(vldoor_t *str)
  function saveg_write_vldoor_t (line 1011) | static void saveg_write_vldoor_t(vldoor_t *str)
  function saveg_read_floormove_t (line 1042) | static void saveg_read_floormove_t(floormove_t *str)
  function saveg_write_floormove_t (line 1075) | static void saveg_write_floormove_t(floormove_t *str)
  function saveg_read_plat_t (line 1109) | static void saveg_read_plat_t(plat_t *str)
  function saveg_write_plat_t (line 1151) | static void saveg_write_plat_t(plat_t *str)
  function saveg_read_lightflash_t (line 1194) | static void saveg_read_lightflash_t(lightflash_t *str)
  function saveg_write_lightflash_t (line 1221) | static void saveg_write_lightflash_t(lightflash_t *str)
  function saveg_read_strobe_t (line 1249) | static void saveg_read_strobe_t(strobe_t *str)
  function saveg_write_strobe_t (line 1276) | static void saveg_write_strobe_t(strobe_t *str)
  function saveg_read_glow_t (line 1304) | static void saveg_read_glow_t(glow_t *str)
  function saveg_write_glow_t (line 1325) | static void saveg_write_glow_t(glow_t *str)
  function P_WriteSaveGameHeader (line 1347) | void P_WriteSaveGameHeader(char *description)
  function boolean (line 1379) | boolean P_ReadSaveGameHeader(void)
  function boolean (line 1419) | boolean P_ReadSaveGameEOF(void)
  function P_WriteSaveGameEOF (line 1432) | void P_WriteSaveGameEOF(void)
  function P_ArchivePlayers (line 1440) | void P_ArchivePlayers (void)
  function P_UnArchivePlayers (line 1460) | void P_UnArchivePlayers (void)
  function P_ArchiveWorld (line 1484) | void P_ArchiveWorld (void)
  function P_UnArchiveWorld (line 1532) | void P_UnArchiveWorld (void)
  type thinkerclass_t (line 1581) | typedef enum
  function P_ArchiveThinkers (line 1592) | void P_ArchiveThinkers (void)
  function P_UnArchiveThinkers (line 1620) | void P_UnArchiveThinkers (void)
  function P_ArchiveSpecials (line 1704) | void P_ArchiveSpecials (void)
  function P_UnArchiveSpecials (line 1793) | void P_UnArchiveSpecials (void)

FILE: fbdoom/p_setup.c
  function P_LoadVertexes (line 118) | void P_LoadVertexes (int lump)
  function sector_t (line 153) | sector_t* GetSectorAtNullAddress(void)
  function P_LoadSegs (line 172) | void P_LoadSegs (int lump)
  function P_LoadSubsectors (line 236) | void P_LoadSubsectors (int lump)
  function P_LoadSectors (line 265) | void P_LoadSectors (int lump)
  function P_LoadNodes (line 298) | void P_LoadNodes (int lump)
  function P_LoadThings (line 335) | void P_LoadThings (int lump)
  function P_LoadLineDefs (line 392) | void P_LoadLineDefs (int lump)
  function P_LoadSideDefs (line 473) | void P_LoadSideDefs (int lump)
  function P_LoadBlockMap (line 504) | void P_LoadBlockMap (int lump)
  function P_GroupLines (line 545) | void P_GroupLines (void)
  function PadRejectArray (line 661) | static void PadRejectArray(byte *array, unsigned int len)
  function P_LoadReject (line 712) | static void P_LoadReject(int lumpnum)
  function P_SetupLevel (line 743) | void
  function P_Init (line 847) | void P_Init (void)

FILE: fbdoom/p_sight.c
  function P_DivlineSide (line 47) | int
  function fixed_t (line 101) | fixed_t
  function boolean (line 128) | boolean P_CrossSubsector (int num)
  function boolean (line 258) | boolean P_CrossBSPNode (int bspnum)
  function boolean (line 300) | boolean

FILE: fbdoom/p_spec.c
  type anim_t (line 55) | typedef struct
  type animdef_t (line 68) | typedef struct
  function P_InitPicAnims (line 143) | void P_InitPicAnims (void)
  function side_t (line 202) | side_t*
  function sector_t (line 218) | sector_t*
  function twoSided (line 233) | int
  function sector_t (line 249) | sector_t*
  function fixed_t (line 269) | fixed_t	P_FindLowestFloorSurrounding(sector_t* sec)
  function fixed_t (line 296) | fixed_t	P_FindHighestFloorSurrounding(sector_t *sec)
  function fixed_t (line 329) | fixed_t
  function fixed_t (line 391) | fixed_t
  function fixed_t (line 417) | fixed_t	P_FindHighestCeilingSurrounding(sector_t* sec)
  function P_FindSectorFromLineTag (line 443) | int
  function P_FindMinSurroundingLight (line 463) | int
  function P_CrossSpecialLine (line 501) | void
  function P_ShootSpecialLine (line 968) | void
  function P_PlayerInSpecialSector (line 1019) | void P_PlayerInSpecialSector (player_t* player)
  function P_UpdateSpecials (line 1093) | void P_UpdateSpecials (void)
  function DonutOverrun (line 1178) | static void DonutOverrun(fixed_t *s3_floorheight, short *s3_floorpic,
  function EV_DoDonut (line 1257) | int EV_DoDonut(line_t*	line)
  function P_SpawnSpecials (line 1374) | void P_SpawnSpecials (void)

FILE: fbdoom/p_spec.h
  type fireflicker_t (line 121) | typedef struct
  type lightflash_t (line 133) | typedef struct
  type strobe_t (line 147) | typedef struct
  type glow_t (line 162) | typedef struct
  type switchlist_t (line 206) | typedef struct
  type bwhere_e (line 215) | typedef enum
  type button_t (line 224) | typedef struct
  type plat_e (line 259) | typedef enum
  type plattype_e (line 270) | typedef enum
  type plat_t (line 282) | typedef struct
  type vldoor_e (line 325) | typedef enum
  type vldoor_t (line 340) | typedef struct
  type sd_e (line 394) | typedef enum
  type sdt_e (line 404) | typedef enum
  type slidedoor_t (line 415) | typedef struct
  type slidename_t (line 431) | typedef struct
  type slideframe_t (line 446) | typedef struct
  type ceiling_e (line 477) | typedef enum
  type ceiling_t (line 490) | typedef struct
  type floor_e (line 534) | typedef enum
  type stair_e (line 572) | typedef enum
  type floormove_t (line 581) | typedef struct
  type result_e (line 599) | typedef enum

FILE: fbdoom/p_switch.c
  function P_InitSwitchList (line 101) | void P_InitSwitchList(void)
  function P_StartButton (line 148) | void
  function P_ChangeSwitchTexture (line 194) | void
  function boolean (line 269) | boolean

FILE: fbdoom/p_telept.c
  function EV_Teleport (line 41) | int

FILE: fbdoom/p_tick.c
  function P_InitThinkers (line 46) | void P_InitThinkers (void)
  function P_AddThinker (line 58) | void P_AddThinker (thinker_t* thinker)
  function P_RemoveThinker (line 73) | void P_RemoveThinker (thinker_t* thinker)
  function P_AllocateThinker (line 85) | void P_AllocateThinker (thinker_t*	thinker)
  function P_RunThinkers (line 94) | void P_RunThinkers (void)
  function P_Ticker (line 123) | void P_Ticker (void)

FILE: fbdoom/p_user.c
  function P_Thrust (line 51) | void
  function P_CalcHeight (line 70) | void P_CalcHeight (player_t* player)
  function P_MovePlayer (line 141) | void P_MovePlayer (player_t* player)
  function P_DeathThink (line 175) | void P_DeathThink (player_t* player)
  function P_PlayerThink (line 229) | void P_PlayerThink (player_t* player)

FILE: fbdoom/r_bsp.c
  function R_ClearDrawSegs (line 61) | void R_ClearDrawSegs (void)
  type cliprange_t (line 73) | typedef	struct
  function R_ClipSolidWallSegment (line 96) | void
  function R_ClipPassWallSegment (line 189) | void
  function R_ClearClipSegs (line 238) | void R_ClearClipSegs (void)
  function R_AddLine (line 252) | void R_AddLine (seg_t*	line)
  function boolean (line 374) | boolean R_CheckBBox (fixed_t*	bspcoord)
  function R_Subsector (line 490) | void R_Subsector (int num)
  function R_RenderBSPNode (line 545) | void R_RenderBSPNode (int bspnum)

FILE: fbdoom/r_data.c
  type PACKEDATTR (line 59) | typedef struct
  type PACKEDATTR (line 74) | typedef struct
  type texpatch_t (line 89) | typedef struct
  type texture_t (line 104) | typedef struct texture_s texture_t;
  type texture_s (line 106) | struct texture_s
  function R_DrawColumnInCache (line 185) | void
  function R_GenerateComposite (line 226) | void R_GenerateComposite (int texnum)
  function R_GenerateLookup (line 294) | void R_GenerateLookup (int texnum)
  function byte (line 382) | byte*
  function GenerateTextureHashTable (line 404) | static void GenerateTextureHashTable(void)
  function R_InitTextures (line 451) | void R_InitTextures (void)
  function R_InitFlats (line 633) | void R_InitFlats (void)
  function R_InitSpriteLumps (line 655) | void R_InitSpriteLumps (void)
  function R_InitColormaps (line 685) | void R_InitColormaps (void)
  function R_InitData (line 703) | void R_InitData (void)
  function R_FlatNumForName (line 720) | int R_FlatNumForName (char* name)
  function R_CheckTextureNumForName (line 744) | int	R_CheckTextureNumForName (char *name)
  function R_TextureNumForName (line 775) | int	R_TextureNumForName (char* name)
  function R_PrecacheLevel (line 800) | void R_PrecacheLevel (void)

FILE: fbdoom/r_defs.h
  type vertex_t (line 67) | typedef struct
  type line_s (line 76) | struct line_s
  type degenmobj_t (line 84) | typedef struct
  type sector_t (line 97) | typedef	struct
  type side_t (line 140) | typedef struct
  type slopetype_t (line 164) | typedef enum
  type line_t (line 175) | typedef struct line_s
  type subsector_t (line 223) | typedef struct subsector_s
  type seg_t (line 236) | typedef struct
  type node_t (line 261) | typedef struct
  type byte (line 298) | typedef byte	lighttable_t;
  type drawseg_t (line 306) | typedef struct drawseg_s
  type vissprite_t (line 338) | typedef struct vissprite_s
  type spriteframe_t (line 390) | typedef struct
  type spritedef_t (line 411) | typedef struct
  type visplane_t (line 423) | typedef struct

FILE: fbdoom/r_draw.c
  function R_DrawColumn (line 102) | void R_DrawColumn (void)
  function R_DrawColumn (line 152) | void R_DrawColumn (void)
  function R_DrawColumnLow (line 208) | void R_DrawColumnLow (void)
  function R_DrawFuzzColumn (line 283) | void R_DrawFuzzColumn (void)
  function R_DrawFuzzColumnLow (line 342) | void R_DrawFuzzColumnLow (void)
  function R_DrawTranslatedColumn (line 424) | void R_DrawTranslatedColumn (void)
  function R_DrawTranslatedColumnLow (line 468) | void R_DrawTranslatedColumnLow (void)
  function R_InitTranslationTables (line 530) | void R_InitTranslationTables (void)
  function R_DrawSpan (line 590) | void R_DrawSpan (void)
  function R_DrawSpan (line 646) | void R_DrawSpan (void)
  function R_DrawSpanLow (line 719) | void R_DrawSpanLow (void)
  function R_InitBuffer (line 776) | void
  function R_FillBackScreen (line 812) | void R_FillBackScreen (void)
  function R_VideoErase (line 918) | void
  function R_DrawViewBorder (line 941) | void R_DrawViewBorder (void)

FILE: fbdoom/r_main.c
  function R_AddPointToBox (line 122) | void
  function R_PointOnSide (line 145) | int
  function R_PointOnSegSide (line 198) | int
  function angle_t (line 275) | angle_t
  function angle_t (line 361) | angle_t
  function fixed_t (line 375) | fixed_t
  function R_InitPointToAngle (line 422) | void R_InitPointToAngle (void)
  function fixed_t (line 449) | fixed_t R_ScaleFromGlobalAngle (angle_t visangle)
  function R_InitTables (line 505) | void R_InitTables (void)
  function R_InitTextureMapping (line 540) | void R_InitTextureMapping (void)
  function R_InitLightTables (line 610) | void R_InitLightTables (void)
  function R_SetViewSize (line 653) | void
  function R_ExecuteSetViewSize (line 667) | void R_ExecuteSetViewSize (void)
  function R_Init (line 767) | void R_Init (void)
  function subsector_t (line 793) | subsector_t*
  function R_SetupFrame (line 823) | void R_SetupFrame (player_t* player)
  function R_RenderPlayerView (line 863) | void R_RenderPlayerView (player_t* player)

FILE: fbdoom/r_plane.c
  function R_InitPlanes (line 94) | void R_InitPlanes (void)
  function R_MapPlane (line 113) | void
  function R_ClearPlanes (line 178) | void R_ClearPlanes (void)
  function visplane_t (line 210) | visplane_t*
  function visplane_t (line 258) | visplane_t*
  function R_MakeSpans (line 323) | void
  function R_DrawPlanes (line 360) | void R_DrawPlanes (void)

FILE: fbdoom/r_segs.c
  function R_RenderMaskedSegRange (line 95) | void
  function R_RenderSegLoop (line 199) | void R_RenderSegLoop (void)
  function R_StoreWallRange (line 371) | void

FILE: fbdoom/r_sky.c
  function R_InitSkyMap (line 47) | void R_InitSkyMap (void)

FILE: fbdoom/r_things.c
  type maskdraw_t (line 48) | typedef struct
  function R_InstallSpriteLump (line 99) | void
  function R_InitSpriteDefs (line 171) | void R_InitSpriteDefs (char** namelist)
  function R_InitSprites (line 291) | void R_InitSprites (char** namelist)
  function R_ClearSprites (line 309) | void R_ClearSprites (void)
  function vissprite_t (line 320) | vissprite_t* R_NewVisSprite (void)
  function R_DrawMaskedColumn (line 343) | void R_DrawMaskedColumn (column_t* column)
  function R_DrawVisSprite (line 388) | void
  function R_ProjectSprite (line 444) | void R_ProjectSprite (mobj_t* thing)
  function R_AddSprites (line 605) | void R_AddSprites (sector_t* sec)
  function R_DrawPSprite (line 638) | void R_DrawPSprite (pspdef_t* psp)
  function R_DrawPlayerSprites (line 738) | void R_DrawPlayerSprites (void)
  function R_SortVisSprites (line 779) | void R_SortVisSprites (void)
  function R_DrawSprite (line 837) | void R_DrawSprite (vissprite_t* spr)
  function R_DrawMasked (line 951) | void R_DrawMasked (void)

FILE: fbdoom/s_sound.c
  type channel_t (line 66) | typedef struct
  function S_Init (line 114) | void S_Init(int sfxVolume, int musicVolume)
  function S_Shutdown (line 146) | void S_Shutdown(void)
  function S_StopChannel (line 152) | static void S_StopChannel(int cnum)
  function S_Start (line 191) | void S_Start(void)
  function S_StopSound (line 243) | void S_StopSound(mobj_t *origin)
  function S_GetChannel (line 262) | static int S_GetChannel(mobj_t *origin, sfxinfo_t *sfxinfo)
  function S_AdjustSoundParams (line 323) | static int S_AdjustSoundParams(mobj_t *listener, mobj_t *source,
  function S_StartSound (line 391) | void S_StartSound(void *origin_p, int sfx_id)
  function S_PauseSound (line 482) | void S_PauseSound(void)
  function S_ResumeSound (line 491) | void S_ResumeSound(void)
  function S_UpdateSounds (line 504) | void S_UpdateSounds(mobj_t *listener)
  function S_SetMusicVolume (line 571) | void S_SetMusicVolume(int volume)
  function S_SetSfxVolume (line 582) | void S_SetSfxVolume(int volume)
  function S_StartMusic (line 596) | void S_StartMusic(int m_id)
  function S_ChangeMusic (line 601) | void S_ChangeMusic(int musicnum, int looping)
  function boolean (line 649) | boolean S_MusicPlaying(void)
  function S_StopMusic (line 654) | void S_StopMusic(void)

FILE: fbdoom/sha1.c
  function SHA1_Init (line 40) | void SHA1_Init(sha1_context_t *hd)
  function Transform (line 55) | static void Transform(sha1_context_t *hd, byte *data)
  function SHA1_Update (line 198) | void SHA1_Update(sha1_context_t *hd, byte *inbuf, size_t inlen)
  function SHA1_Final (line 238) | void SHA1_Final(sha1_digest_t digest, sha1_context_t *hd)
  function SHA1_UpdateInt32 (line 303) | void SHA1_UpdateInt32(sha1_context_t *context, unsigned int val)
  function SHA1_UpdateString (line 315) | void SHA1_UpdateString(sha1_context_t *context, char *str)

FILE: fbdoom/sha1.h
  type sha1_context_t (line 23) | typedef struct sha1_context_s sha1_context_t;
  type byte (line 24) | typedef byte sha1_digest_t[20];
  type sha1_context_s (line 26) | struct sha1_context_s {

FILE: fbdoom/sounds.h
  type musicenum_t (line 35) | typedef enum
  type sfxenum_t (line 113) | typedef enum

FILE: fbdoom/st_lib.c
  function STlib_init (line 51) | void STlib_init(void)
  function STlib_initNum (line 58) | void
  function STlib_drawNum (line 83) | void
  function STlib_updateNum (line 145) | void
  function STlib_initPercent (line 155) | void
  function STlib_updatePercent (line 172) | void
  function STlib_initMultIcon (line 185) | void
  function STlib_updateMultIcon (line 204) | void
  function STlib_initBinIcon (line 235) | void
  function STlib_updateBinIcon (line 254) | void

FILE: fbdoom/st_lib.h
  type st_number_t (line 32) | typedef struct
  type st_percent_t (line 64) | typedef struct
  type st_multicon_t (line 77) | typedef struct
  type st_binicon_t (line 106) | typedef struct

FILE: fbdoom/st_stuff.c
  function ST_refreshBackground (line 416) | void ST_refreshBackground(void)
  function boolean (line 438) | boolean
  function ST_calcPainOffset (line 665) | int ST_calcPainOffset(void)
  function ST_updateFaceWidget (line 688) | void ST_updateFaceWidget(void)
  function ST_updateWidgets (line 860) | void ST_updateWidgets(void)
  function ST_Ticker (line 924) | void ST_Ticker (void)
  function ST_doPaletteStuff (line 936) | void ST_doPaletteStuff(void)
  function ST_drawWidgets (line 1001) | void ST_drawWidgets(boolean refresh)
  function ST_doRefresh (line 1036) | void ST_doRefresh(void)
  function ST_diffDraw (line 1049) | void ST_diffDraw(void)
  function ST_Drawer (line 1055) | void ST_Drawer (boolean fullscreen, boolean refresh)
  function ST_loadUnloadGraphics (line 1076) | static void ST_loadUnloadGraphics(load_callback_t callback)
  function ST_loadCallback (line 1162) | static void ST_loadCallback(char *lumpname, patch_t **variable)
  function ST_loadGraphics (line 1167) | void ST_loadGraphics(void)
  function ST_loadData (line 1172) | void ST_loadData(void)
  function ST_unloadCallback (line 1178) | static void ST_unloadCallback(char *lumpname, patch_t **variable)
  function ST_unloadGraphics (line 1184) | void ST_unloadGraphics(void)
  function ST_unloadData (line 1189) | void ST_unloadData(void)
  function ST_initData (line 1194) | void ST_initData(void)
  function ST_createWidgets (line 1227) | void ST_createWidgets(void)
  function ST_Start (line 1389) | void ST_Start (void)
  function ST_Stop (line 1401) | void ST_Stop (void)
  function ST_Init (line 1411) | void ST_Init (void)

FILE: fbdoom/st_stuff.h
  type st_stateenum_t (line 57) | typedef enum
  type st_chatstateenum_t (line 66) | typedef enum

FILE: fbdoom/statdump.c
  function DiscoverGamemode (line 71) | static void DiscoverGamemode(wbstartstruct_t *stats, int num_stats)
  function GetNumPlayers (line 130) | static int GetNumPlayers(wbstartstruct_t *stats)
  function PrintBanner (line 150) | static void PrintBanner(FILE *stream)
  function PrintPercentage (line 155) | static void PrintPercentage(FILE *stream, int amount, int total)
  function PrintPlayerStats (line 180) | static void PrintPlayerStats(FILE *stream, wbstartstruct_t *stats,
  function PrintFragsTable (line 213) | static void PrintFragsTable(FILE *stream, wbstartstruct_t *stats)
  function PrintLevelName (line 272) | static void PrintLevelName(FILE *stream, int episode, int level)
  function PrintStats (line 301) | static void PrintStats(FILE *stream, wbstartstruct_t *stats)
  function StatCopy (line 333) | void StatCopy(wbstartstruct_t *stats)
  function StatDump (line 343) | void StatDump(void)

FILE: fbdoom/stubs.c
  function in_addr_t (line 8) | in_addr_t inet_addr(const char *cp)

FILE: fbdoom/tables.c
  function SlopeDiv (line 41) | int SlopeDiv(unsigned int num, unsigned int den)

FILE: fbdoom/tables.h
  type angle_t (line 81) | typedef unsigned angle_t;

FILE: fbdoom/v_patch.h
  type PACKEDATTR (line 29) | typedef struct
  type PACKEDATTR (line 40) | typedef struct
  type post_t (line 47) | typedef post_t	column_t;

FILE: fbdoom/v_video.c
  function V_MarkRect (line 69) | void V_MarkRect(int x, int y, int width, int height)
  function V_CopyRect (line 85) | void V_CopyRect(int srcx, int srcy, byte *source,
  function V_SetPatchClipCallback (line 129) | void V_SetPatchClipCallback(vpatchclipfunc_t func)
  function V_DrawPatch (line 139) | void V_DrawPatch(int x, int y, patch_t *patch)
  function V_DrawPatchFlipped (line 203) | void V_DrawPatchFlipped(int x, int y, patch_t *patch)
  function V_DrawPatchDirect (line 268) | void V_DrawPatchDirect(int x, int y, patch_t *patch)
  function V_DrawTLPatch (line 279) | void V_DrawTLPatch(int x, int y, patch_t * patch)
  function V_DrawXlaPatch (line 329) | void V_DrawXlaPatch(int x, int y, patch_t * patch)
  function V_DrawAltTLPatch (line 378) | void V_DrawAltTLPatch(int x, int y, patch_t * patch)
  function V_DrawShadowedPatch (line 428) | void V_DrawShadowedPatch(int x, int y, patch_t *patch)
  function V_LoadTintTable (line 482) | void V_LoadTintTable(void)
  function V_LoadXlaTable (line 493) | void V_LoadXlaTable(void)
  function V_DrawBlock (line 503) | void V_DrawBlock(int x, int y, int width, int height, byte *src)
  function V_DrawFilledBox (line 529) | void V_DrawFilledBox(int x, int y, int w, int h, int c)
  function V_DrawHorizLine (line 549) | void V_DrawHorizLine(int x, int y, int w, int c)
  function V_DrawVertLine (line 562) | void V_DrawVertLine(int x, int y, int h, int c)
  function V_DrawBox (line 576) | void V_DrawBox(int x, int y, int w, int h, int c)
  function V_DrawRawScreen (line 589) | void V_DrawRawScreen(byte *raw)
  function V_Init (line 597) | void V_Init (void)
  function V_UseBuffer (line 606) | void V_UseBuffer(byte *buffer)
  function V_RestoreBuffer (line 613) | void V_RestoreBuffer(void)
  type PACKEDATTR (line 622) | typedef struct
  function WritePCXfile (line 653) | void WritePCXfile(char *filename, byte *data,
  function error_fn (line 711) | static void error_fn(png_structp p, png_const_charp s)
  function warning_fn (line 716) | static void warning_fn(png_structp p, png_const_charp s)
  function WritePNGfile (line 721) | void WritePNGfile(char *filename, byte *data,
  function V_ScreenShot (line 791) | void V_ScreenShot(char *format)
  function V_DrawMouseSpeedBox (line 846) | void V_DrawMouseSpeedBox(int speed)

FILE: fbdoom/v_video.h
  type boolean (line 44) | typedef boolean (*vpatchclipfunc_t)(patch_t *, int, int);

FILE: fbdoom/w_checksum.c
  function GetFileNumber (line 31) | static int GetFileNumber(wad_file_t *handle)
  function ChecksumAddLump (line 57) | static void ChecksumAddLump(sha1_context_t *sha1_context, lumpinfo_t *lump)
  function W_Checksum (line 68) | void W_Checksum(sha1_digest_t digest)

FILE: fbdoom/w_file.c
  function wad_file_t (line 49) | wad_file_t *W_OpenFile(char *path)
  function W_CloseFile (line 81) | void W_CloseFile(wad_file_t *wad)
  function W_Read (line 86) | size_t W_Read(wad_file_t *wad, unsigned int offset,

FILE: fbdoom/w_file.h
  type wad_file_t (line 26) | typedef struct _wad_file_s wad_file_t;
  type wad_file_class_t (line 28) | typedef struct
  type _wad_file_s (line 46) | struct _wad_file_s

FILE: fbdoom/w_file_stdc.c
  type stdc_wad_file_t (line 25) | typedef struct
  function wad_file_t (line 33) | static wad_file_t *W_StdC_OpenFile(char *path)
  function W_StdC_CloseFile (line 56) | static void W_StdC_CloseFile(wad_file_t *wad)
  function W_StdC_Read (line 69) | size_t W_StdC_Read(wad_file_t *wad, unsigned int offset,

FILE: fbdoom/w_file_stdc_unbuffered.c
  type stdc_wad_file_t (line 31) | typedef struct
  function W_StdC_FileLength (line 39) | static unsigned int W_StdC_FileLength(int fd)
  function wad_file_t (line 56) | static wad_file_t *W_StdC_OpenFile(char *path)
  function W_StdC_CloseFile (line 79) | static void W_StdC_CloseFile(wad_file_t *wad)
  function W_StdC_Read (line 92) | size_t W_StdC_Read(wad_file_t *wad, unsigned int offset,

FILE: fbdoom/w_main.c
  function boolean (line 30) | boolean W_ParseCommandLine(void)

FILE: fbdoom/w_wad.c
  type PACKEDATTR (line 39) | typedef struct
  type PACKEDATTR (line 48) | typedef struct
  function W_LumpNameHash (line 70) | unsigned int W_LumpNameHash(const char *s)
  function ExtendLumpInfo (line 87) | static void ExtendLumpInfo(int newnumlumps)
  function wad_file_t (line 139) | wad_file_t *W_AddFile (char *filename)
  function W_NumLumps (line 244) | int W_NumLumps (void)
  function W_CheckNumForName (line 256) | int W_CheckNumForName (char* name)
  function W_GetNumForName (line 306) | int W_GetNumForName (char* name)
  function W_LumpLength (line 325) | int W_LumpLength (unsigned int lump)
  function W_ReadLump (line 342) | void W_ReadLump(unsigned int lump, void *dest)
  function W_ReleaseLumpNum (line 444) | void W_ReleaseLumpNum(int lumpnum)
  function W_ReleaseLumpName (line 465) | void W_ReleaseLumpName(char *name)
  function W_Profile (line 478) | void W_Profile (void)
  function W_GenerateHashTable (line 539) | void W_GenerateHashTable(void)
  function W_CheckCorrectIWAD (line 586) | void W_CheckCorrectIWAD(GameMission_t mission)

FILE: fbdoom/w_wad.h
  type lumpinfo_t (line 39) | typedef struct lumpinfo_s lumpinfo_t;
  type lumpinfo_s (line 41) | struct lumpinfo_s

FILE: fbdoom/wi_stuff.c
  type animenum_t (line 109) | typedef enum
  type point_t (line 117) | typedef struct
  type anim_t (line 129) | typedef struct
  function WI_slamBackground (line 402) | void WI_slamBackground(void)
  function boolean (line 409) | boolean WI_Responder(event_t* ev)
  function WI_drawLF (line 416) | void WI_drawLF(void)
  function WI_drawEL (line 452) | void WI_drawEL(void)
  function WI_drawOnLnode (line 470) | void
  function WI_initAnimatedBack (line 519) | void WI_initAnimatedBack(void)
  function WI_updateAnimatedBack (line 548) | void WI_updateAnimatedBack(void)
  function WI_drawAnimatedBack (line 599) | void WI_drawAnimatedBack(void)
  function WI_drawNum (line 627) | int
  function WI_drawPercent (line 684) | void
  function WI_drawTime (line 703) | void
  function WI_End (line 740) | void WI_End(void)
  function WI_initNoState (line 746) | void WI_initNoState(void)
  function WI_updateNoState (line 753) | void WI_updateNoState(void) {
  function WI_initShowNextLoc (line 772) | void WI_initShowNextLoc(void)
  function WI_updateShowNextLoc (line 781) | void WI_updateShowNextLoc(void)
  function WI_drawShowNextLoc (line 791) | void WI_drawShowNextLoc(void)
  function WI_drawNoState (line 832) | void WI_drawNoState(void)
  function WI_fragSum (line 838) | int WI_fragSum(int playernum)
  function WI_initDeathmatchStats (line 869) | void WI_initDeathmatchStats(void)
  function WI_updateDeathmatchStats (line 898) | void WI_updateDeathmatchStats(void)
  function WI_drawDeathmatchStats (line 1001) | void WI_drawDeathmatchStats(void)
  function WI_initNetgameStats (line 1089) | void WI_initNetgameStats(void)
  function WI_updateNetgameStats (line 1117) | void WI_updateNetgameStats(void)
  function WI_drawNetgameStats (line 1272) | void WI_drawNetgameStats(void)
  function WI_initStats (line 1329) | void WI_initStats(void)
  function WI_updateStats (line 1341) | void WI_updateStats(void)
  function WI_drawStats (line 1447) | void WI_drawStats(void)
  function WI_checkForAccelerate (line 1481) | void WI_checkForAccelerate(void)
  function WI_Ticker (line 1514) | void WI_Ticker(void)
  function WI_loadUnloadData (line 1554) | static void WI_loadUnloadData(load_callback_t callback)
  function WI_loadCallback (line 1704) | static void WI_loadCallback(char *name, patch_t **variable)
  function WI_loadData (line 1709) | void WI_loadData(void)
  function WI_unloadCallback (line 1735) | static void WI_unloadCallback(char *name, patch_t **variable)
  function WI_unloadData (line 1741) | void WI_unloadData(void)
  function WI_Drawer (line 1752) | void WI_Drawer (void)
  function WI_initVariables (line 1776) | void WI_initVariables(wbstartstruct_t* wbstartstruct)
  function WI_Start (line 1818) | void WI_Start(wbstartstruct_t* wbstartstruct)

FILE: fbdoom/wi_stuff.h
  type stateenum_t (line 28) | typedef enum

FILE: fbdoom/z_zone.c
  type memblock_t (line 39) | typedef struct memblock_s
  type memzone_t (line 50) | typedef struct
  function Z_ClearZone (line 71) | void Z_ClearZone (memzone_t* zone)
  function Z_Init (line 97) | void Z_Init (void)
  function Z_Free (line 126) | void Z_Free (void* ptr)
  function Z_FreeTags (line 297) | void
  function Z_DumpHeap (line 327) | void
  function Z_FileDumpHeap (line 367) | void Z_FileDumpHeap (FILE* f)
  function Z_CheckHeap (line 400) | void Z_CheckHeap (void)
  function Z_ChangeTag2 (line 429) | void Z_ChangeTag2(void *ptr, int tag, char *file, int line)
  function Z_ChangeUser (line 446) | void Z_ChangeUser(void *ptr, void **user)
  function Z_FreeMemory (line 466) | int Z_FreeMemory (void)
  function Z_ZoneSize (line 484) | unsigned int Z_ZoneSize(void)

FILE: ipx/DOOMNET.C
  function LaunchDOOM (line 40) | void LaunchDOOM (void)

FILE: ipx/DOOMNET.H
  type doomcom_t (line 19) | typedef struct

FILE: ipx/IPXNET.C
  function OpenSocket (line 39) | int OpenSocket(short socketNumber)
  function CloseSocket (line 51) | void CloseSocket(short socketNumber)
  function ListenForPacket (line 58) | void ListenForPacket(ECB *ecb)
  function GetLocalAddress (line 69) | void GetLocalAddress (void)
  function InitNetwork (line 87) | void InitNetwork (void)
  function ShutdownNetwork (line 158) | void ShutdownNetwork (void)
  function SendPacket (line 174) | void SendPacket (int destination)
  function ShortSwap (line 208) | unsigned short ShortSwap (unsigned short i)
  function GetPacket (line 223) | int GetPacket (void)

FILE: ipx/IPXNET.H
  type doomdata_t (line 4) | typedef struct
  type setupdata_t (line 17) | typedef struct
  type BYTE (line 27) | typedef unsigned char BYTE;
  type WORD (line 28) | typedef unsigned short WORD;
  type LONG (line 29) | typedef unsigned long LONG;
  type IPXPacket (line 31) | typedef struct IPXPacketStructure
  type localadr_t (line 48) | typedef struct
  type nodeadr_t (line 54) | typedef struct
  type ECB (line 59) | typedef struct ECBStructure
  type packet_t (line 82) | typedef struct

FILE: ipx/IPXSETUP.C
  function Error (line 37) | void Error (char *error, ...)
  function CheckParm (line 65) | int CheckParm(char *parm)
  function interrupt (line 85) | void interrupt NetISR (void)
  function LookForNodes (line 112) | void LookForNodes (void)
  function FindResponseFile (line 261) | void FindResponseFile (void)
  function main (line 337) | void main (void)

FILE: sersrc/DOOMNET.C
  function CheckParm (line 35) | int CheckParm (char *check)
  function LaunchDOOM (line 65) | void LaunchDOOM (void)

FILE: sersrc/DOOMNET.H
  type doomcom_t (line 21) | typedef struct

FILE: sersrc/PORT.C
  type SREGS (line 15) | struct	SREGS
  function GetUart (line 43) | void GetUart (void)
  function InitPort (line 103) | void InitPort (void)
  function ShutdownPort (line 233) | void ShutdownPort ( void )
  function read_byte (line 256) | int read_byte( void )
  function write_byte (line 268) | void write_byte( int c )
  function isr_8250 (line 287) | void interrupt isr_8250(void)
  function isr_16550 (line 348) | void interrupt isr_16550(void)
  function jump_start (line 416) | void jump_start( void )

FILE: sersrc/SERSETUP.C
  function I_Error (line 28) | void I_Error(char *string)
  function write_buffer (line 42) | void write_buffer( char *buffer, unsigned int count )
  function Error (line 68) | void Error (char *error, ...)
  function boolean (line 122) | boolean ReadPacket (void)
  function WritePacket (line 181) | void WritePacket (char *buffer, int len)
  function interrupt (line 212) | void interrupt NetISR (void)
  function Connect (line 248) | void Connect (void)
  function ModemCommand (line 367) | void ModemCommand (char *str)
  function ModemResponse (line 396) | void ModemResponse (char *resp)
  function ReadLine (line 440) | void ReadLine (FILE *f, char *dest)
  function ReadModemCfg (line 463) | void ReadModemCfg (void)
  function Dial (line 493) | void Dial (void)
  function Answer (line 519) | void Answer (void)
  function FindResponseFile (line 537) | void FindResponseFile (void)
  function main (line 614) | void main(void)

FILE: sersrc/SERSETUP.H
  type boolean (line 20) | typedef enum {false, true} boolean;
  type byte (line 21) | typedef unsigned char byte;
  type que_t (line 86) | typedef struct

FILE: sndserv/linux.c
  function myioctl (line 49) | void
  function I_InitMusic (line 67) | void I_InitMusic(void)
  function I_InitSound (line 71) | void
  function I_SubmitOutputBuffer (line 101) | void
  function I_ShutdownSound (line 109) | void I_ShutdownSound(void)
  function I_ShutdownMusic (line 116) | void I_ShutdownMusic(void)

FILE: sndserv/sounds.h
  type musicenum_t (line 45) | typedef enum
  type sfxenum_t (line 123) | typedef enum

FILE: sndserv/soundsrv.c
  type wadinfo_t (line 63) | typedef struct wadinfo_struct
  type filelump_t (line 73) | typedef struct filelump_struct
  function derror (line 136) | static void derror(char* msg)
  function mix (line 142) | int mix(void)
  function grabdata (line 303) | void
  type timeval (line 405) | struct timeval
  type timezone (line 408) | struct timezone
  function updatesounds (line 410) | void updatesounds(void)
  function addsfx (line 418) | int
  function outputushort (line 512) | void outputushort(int num)
  function initdata (line 537) | void initdata(void)
  function quit (line 573) | void quit(void)
  function main (line 587) | int

FILE: sndserv/soundst.h
  type musicinfo_t (line 71) | typedef struct
  type sfxinfo_t (line 92) | typedef struct sfxinfo_struct	sfxinfo_t;
  type sfxinfo_struct (line 94) | struct sfxinfo_struct
  type channel_t (line 128) | typedef struct

FILE: sndserv/wadread.c
  type wadinfo_t (line 57) | typedef struct wadinfo_struct
  type filelump_t (line 65) | typedef struct filelump_struct
  type lumpinfo_t (line 73) | typedef struct lumpinfo_struct
  function SwapLONG (line 107) | unsigned long SwapLONG(unsigned long x)
  function SwapSHORT (line 116) | unsigned short SwapSHORT(unsigned short x)
  function derror (line 127) | static void derror(char* msg)
  function strupr (line 134) | void strupr (char *s)
  function filelength (line 140) | int filelength (int handle)
  function openwad (line 152) | void openwad(char* wadname)
Condensed preview — 215 files, each showing path, character count, and a content snippet. Download the .json file or copy for the full structured content (1,989K chars).
[
  {
    "path": "README.TXT",
    "chars": 3888,
    "preview": "================\n= fbDOOM =\n================\n\nAdaptation of the original DOOM\nto be easily portable to framebuffer devic"
  },
  {
    "path": "fbdoom/Makefile",
    "chars": 1853,
    "preview": "################################################################\n#\n# $Id:$\n#\n# $Log:$\n#\n\nCROSS_COMPILE ?= #arm-linux-gnu"
  },
  {
    "path": "fbdoom/am_map.c",
    "chars": 27807,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/am_map.h",
    "chars": 1243,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/config.h",
    "chars": 2778,
    "preview": "/* config.hin.  Generated from configure.ac by autoheader.  */\n\n/* Define to 1 if you have the <dev/isa/spkrio.h> header"
  },
  {
    "path": "fbdoom/d_englsh.h",
    "chars": 21755,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_event.c",
    "chars": 1427,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_event.h",
    "chars": 3186,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_items.c",
    "chars": 1868,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_items.h",
    "chars": 989,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_iwad.c",
    "chars": 18774,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/d_iwad.h",
    "chars": 1636,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/d_loop.c",
    "chars": 16671,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_loop.h",
    "chars": 2365,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_main.c",
    "chars": 44847,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_main.h",
    "chars": 1015,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_mode.c",
    "chars": 4865,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/d_mode.h",
    "chars": 2942,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_net.c",
    "chars": 6704,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_player.h",
    "chars": 4457,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_textur.h",
    "chars": 928,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_think.h",
    "chars": 1481,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/d_ticcmd.h",
    "chars": 1544,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 1993-2008 Raven Software\n// Copyright(C) 2005-2014 Simon "
  },
  {
    "path": "fbdoom/deh_main.h",
    "chars": 1493,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/deh_misc.h",
    "chars": 3071,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/deh_str.h",
    "chars": 1195,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/doom.h",
    "chars": 1738,
    "preview": "/*\n * doom.h\n *\n *  Created on: 18.02.2015\n *      Author: Florian\n */\n\n\n#ifndef SRC_CHOCDOOM_DOOM_H_\n#define SRC_CHOCDO"
  },
  {
    "path": "fbdoom/doomdata.h",
    "chars": 4679,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/doomdef.c",
    "chars": 803,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/doomdef.h",
    "chars": 3114,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/doomfeatures.h",
    "chars": 1018,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/doomkeys.h",
    "chars": 2604,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/doomstat.c",
    "chars": 959,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/doomstat.h",
    "chars": 6786,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/doomtype.h",
    "chars": 2344,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/dstrings.c",
    "chars": 2303,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/dstrings.h",
    "chars": 948,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/dummy.c",
    "chars": 1964,
    "preview": "/*\n * dummy.c\n *\n *  Created on: 16.02.2015\n *      Author: Florian\n */\n\n\n/*--------------------------------------------"
  },
  {
    "path": "fbdoom/f_finale.c",
    "chars": 14691,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/f_finale.h",
    "chars": 918,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/f_wipe.c",
    "chars": 5076,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/f_wipe.h",
    "chars": 1163,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/g_game.c",
    "chars": 53214,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/g_game.h",
    "chars": 1916,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/gusconf.c",
    "chars": 5745,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/gusconf.h",
    "chars": 800,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/hu_lib.c",
    "chars": 6244,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/hu_lib.h",
    "chars": 3630,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/hu_stuff.c",
    "chars": 12234,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/hu_stuff.h",
    "chars": 1342,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_cdmus.c",
    "chars": 4272,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 1993-2008 Raven Software\n//\n// This program is free softw"
  },
  {
    "path": "fbdoom/i_cdmus.h",
    "chars": 1351,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 1993-2008 Raven Software\n//\n// This program is free softw"
  },
  {
    "path": "fbdoom/i_endoom.c",
    "chars": 1638,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/i_endoom.h",
    "chars": 811,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_input_sdl.c",
    "chars": 10339,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_input_tty.c",
    "chars": 12303,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_input_tty.h",
    "chars": 109,
    "preview": "#ifndef __I_INPUT_TTY__\n#define __I_INPUT_TTY__\nvoid kbd_shutdown(void);\n#endif /* #ifndef __I_INPUT_TTY__ */"
  },
  {
    "path": "fbdoom/i_joystick.c",
    "chars": 8015,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/i_joystick.h",
    "chars": 2511,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/i_main.c",
    "chars": 1170,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_oplmusic.c",
    "chars": 40402,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_pcsound.c",
    "chars": 6935,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/i_scale.c",
    "chars": 32663,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_scale.h",
    "chars": 1606,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_sdlmusic.c",
    "chars": 30420,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_sdlsound.c",
    "chars": 26520,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n// Copyright(C) 2008 David Flater\n"
  },
  {
    "path": "fbdoom/i_sound.c",
    "chars": 9737,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_sound.h",
    "chars": 5265,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_sound_dummy.c",
    "chars": 20811,
    "preview": "// Emacs style mode select   -*- C++ -*- \n//----------------------------------------------------------------------------"
  },
  {
    "path": "fbdoom/i_swap.h",
    "chars": 1410,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_system.c",
    "chars": 12545,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_system.h",
    "chars": 2140,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_timer.c",
    "chars": 1694,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_timer.h",
    "chars": 1038,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_video.c",
    "chars": 51101,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_video.h",
    "chars": 4607,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/i_video_fbdev.c",
    "chars": 12726,
    "preview": "// Emacs style mode select   -*- C++ -*- \n//----------------------------------------------------------------------------"
  },
  {
    "path": "fbdoom/icon.c",
    "chars": 18782,
    "preview": "static int icon_w = 32;\nstatic int icon_h = 32;\n\nstatic unsigned char icon_data[] = {\n    0x00,0x00,0x00,  0x00,0x00,0x0"
  },
  {
    "path": "fbdoom/info.c",
    "chars": 139548,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/info.h",
    "chars": 21728,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_argv.c",
    "chars": 5223,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_argv.h",
    "chars": 1222,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_bbox.c",
    "chars": 1108,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_bbox.h",
    "chars": 961,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_cheat.c",
    "chars": 2171,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_cheat.h",
    "chars": 1277,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_config.c",
    "chars": 47375,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 1993-2008 Raven Software\n// Copyright(C) 2005-2014 Simon "
  },
  {
    "path": "fbdoom/m_config.h",
    "chars": 1213,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_controls.c",
    "chars": 12542,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 1993-2008 Raven Software\n// Copyright(C) 2005-2014 Simon "
  },
  {
    "path": "fbdoom/m_controls.h",
    "chars": 3925,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 1993-2008 Raven Software\n// Copyright(C) 2005-2014 Simon "
  },
  {
    "path": "fbdoom/m_fixed.c",
    "chars": 1142,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_fixed.h",
    "chars": 908,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_menu.c",
    "chars": 39347,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_menu.h",
    "chars": 1473,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_misc.c",
    "chars": 10650,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 1993-2008 Raven Software\n// Copyright(C) 2005-2014 Simon "
  },
  {
    "path": "fbdoom/m_misc.h",
    "chars": 1796,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_random.c",
    "chars": 2402,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/m_random.h",
    "chars": 909,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/memio.c",
    "chars": 3617,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/memio.h",
    "chars": 1206,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/net_client.h",
    "chars": 1619,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/net_dedicated.h",
    "chars": 704,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/net_defs.h",
    "chars": 5916,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/net_gui.h",
    "chars": 830,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/net_io.h",
    "chars": 1251,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/net_loop.h",
    "chars": 821,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/net_packet.h",
    "chars": 1527,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/net_query.h",
    "chars": 1515,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/net_sdl.h",
    "chars": 742,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/net_server.h",
    "chars": 1108,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/p_ceilng.c",
    "chars": 6053,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_doors.c",
    "chars": 16417,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_enemy.c",
    "chars": 37354,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_floor.c",
    "chars": 11290,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_inter.c",
    "chars": 18939,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_inter.h",
    "chars": 708,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_lights.c",
    "chars": 6512,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_local.h",
    "chars": 6408,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_map.c",
    "chars": 31710,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard, Andrey Budko\n//\n// This program i"
  },
  {
    "path": "fbdoom/p_maputl.c",
    "chars": 20059,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n// Copyright(C) 2005, 2006 Andrey "
  },
  {
    "path": "fbdoom/p_mobj.c",
    "chars": 21322,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_mobj.h",
    "chars": 8672,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_plats.c",
    "chars": 6375,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_pspr.c",
    "chars": 16908,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_pspr.h",
    "chars": 1548,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_saveg.c",
    "chars": 36266,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_saveg.h",
    "chars": 1569,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_setup.c",
    "chars": 19002,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_setup.h",
    "chars": 865,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_sight.c",
    "chars": 7178,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_spec.c",
    "chars": 29251,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_spec.h",
    "chars": 9364,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_switch.c",
    "chars": 13307,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_telept.c",
    "chars": 2868,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_tick.c",
    "chars": 2799,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_tick.h",
    "chars": 797,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/p_user.c",
    "chars": 8151,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_bsp.c",
    "chars": 11028,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_bsp.h",
    "chars": 1369,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_data.c",
    "chars": 20090,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_data.h",
    "chars": 1260,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_defs.h",
    "chars": 8139,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_draw.c",
    "chars": 21724,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_draw.h",
    "chars": 2178,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_local.h",
    "chars": 1140,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_main.c",
    "chars": 15531,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_main.h",
    "chars": 2928,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_plane.c",
    "chars": 8160,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_plane.h",
    "chars": 1431,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_segs.c",
    "chars": 16890,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_segs.h",
    "chars": 780,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_sky.c",
    "chars": 1198,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_sky.h",
    "chars": 931,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_state.h",
    "chars": 2348,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_things.c",
    "chars": 20586,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/r_things.h",
    "chars": 1551,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/s_sound.c",
    "chars": 14465,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/s_sound.h",
    "chars": 1909,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/sha1.c",
    "chars": 8641,
    "preview": "/* sha1.c - SHA1 hash function\n *\tCopyright (C) 1998, 1999, 2000, 2001 Free Software Foundation, Inc.\n *\n * Please see b"
  },
  {
    "path": "fbdoom/sha1.h",
    "chars": 1174,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/sounds.c",
    "chars": 5113,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/sounds.h",
    "chars": 3803,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/st_lib.c",
    "chars": 4691,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/st_lib.h",
    "chars": 3320,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/st_stuff.c",
    "chars": 29750,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/st_stuff.h",
    "chars": 1957,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/statdump.c",
    "chars": 8416,
    "preview": " /*\n\n Copyright(C) 2005-2014 Simon Howard\n\n This program is free software; you can redistribute it and/or\n modify it und"
  },
  {
    "path": "fbdoom/statdump.h",
    "chars": 679,
    "preview": " /*\n\n Copyright(C) 2005-2014 Simon Howard\n\n This program is free software; you can redistribute it and/or\n modify it und"
  },
  {
    "path": "fbdoom/stubs.c",
    "chars": 174,
    "preview": "\n#include <sys/socket.h>\n#include <netinet/in.h>\n#include <arpa/inet.h>\n#include <string.h>\n\n//XXX FIXME\nin_addr_t inet_"
  },
  {
    "path": "fbdoom/tables.c",
    "chars": 130242,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/tables.h",
    "chars": 2423,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 1993-2008 Raven Software\n// Copyright(C) 2005-2014 Simon "
  },
  {
    "path": "fbdoom/v_patch.h",
    "chars": 1470,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/v_video.c",
    "chars": 20873,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 1993-2008 Raven Software\n// Copyright(C) 2005-2014 Simon "
  },
  {
    "path": "fbdoom/v_video.h",
    "chars": 2998,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/w_checksum.c",
    "chars": 2219,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/w_checksum.h",
    "chars": 812,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/w_file.c",
    "chars": 1874,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/w_file.h",
    "chars": 2031,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/w_file_stdc.c",
    "chars": 2148,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/w_file_stdc_unbuffered.c",
    "chars": 2793,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/w_main.c",
    "chars": 4607,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/w_main.h",
    "chars": 743,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/w_merge.h",
    "chars": 1220,
    "preview": "//\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free software; you can redistribute it and/or\n// modify "
  },
  {
    "path": "fbdoom/w_wad.c",
    "chars": 12774,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/w_wad.h",
    "chars": 1606,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/wi_stuff.c",
    "chars": 33830,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/wi_stuff.h",
    "chars": 1164,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/z_zone.c",
    "chars": 10396,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "fbdoom/z_zone.h",
    "chars": 2096,
    "preview": "//\n// Copyright(C) 1993-1996 Id Software, Inc.\n// Copyright(C) 2005-2014 Simon Howard\n//\n// This program is free softwar"
  },
  {
    "path": "ipx/DOOMNET.C",
    "chars": 1642,
    "preview": "//#define DOOM2\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <string.h>\n#include <process.h>\n#include <conio.h>\n#inc"
  },
  {
    "path": "ipx/DOOMNET.H",
    "chars": 1778,
    "preview": "// doomnet.h\n\n#define PEL_WRITE_ADR   0x3c8\n#define PEL_DATA        0x3c9\n\n#define I_ColorBlack(r,g,b) {outp(PEL_WRITE_A"
  },
  {
    "path": "ipx/IPXNET.C",
    "chars": 5992,
    "preview": "// ipxnet.c\n\n#include <stdio.h>\n#include <stdlib.h>\n#include <dos.h>\n#include <string.h>\n#include <process.h>\n#include <"
  },
  {
    "path": "ipx/IPXNET.H",
    "chars": 2871,
    "preview": "// ipxnet.h\n\n\ntypedef struct\n{\n     char private[512];\n} doomdata_t;\n\n\n#include \"DoomNet.h\"\n\n//========================="
  },
  {
    "path": "ipx/IPXSETUP.C",
    "chars": 8155,
    "preview": "// ipxsetup.c\n\n#define DOOM2\n\n#include <conio.h>\n#include <stdio.h>\n#include <stdlib.h>\n#include <dos.h>\n#include <strin"
  },
  {
    "path": "ipx/IPXSTR.H",
    "chars": 1027,
    "preview": "#define STR_NETABORT\t\"Network game synchronization aborted.\"\n#define STR_UNKNOWN\t\t\"Got an unknown game packet during set"
  },
  {
    "path": "ipx/IPX_FRCH.H",
    "chars": 1105,
    "preview": "#define STR_NETABORT\t\"Synchronisation du jeu sur rseau annule.\"\n#define STR_UNKNOWN\t\"Paquet de jeu inconnu durant la con"
  },
  {
    "path": "ipx/README",
    "chars": 52,
    "preview": "This is the source for the DOOM ipx network driver.\n"
  },
  {
    "path": "sersrc/DOOMNET.C",
    "chars": 2354,
    "preview": "#include <stdio.h>\n#include <io.h>\n#include <stdlib.h>\n#include <string.h>\n#include <process.h>\n#include <dos.h>\n#includ"
  },
  {
    "path": "sersrc/DOOMNET.H",
    "chars": 1458,
    "preview": "// doomnet.h\n\n\n#define PEL_WRITE_ADR   0x3c8\n#define PEL_DATA        0x3c9\n\n#define I_ColorBlack(r,g,b) {outp(PEL_WRITE_"
  },
  {
    "path": "sersrc/PORT.C",
    "chars": 6911,
    "preview": "// port.c\n\n#include \"doomnet.h\"\n#include \"sersetup.h\"\n//#include \"serstr.h\"\n#include \"ser_frch.h\"\t\t// FRENCH VERSION\n\n\nv"
  }
]

// ... and 15 more files (download for full content)

About this extraction

This page contains the full source code of the maximevince/fbDOOM GitHub repository, extracted and formatted as plain text for AI agents and large language models (LLMs). The extraction includes 215 files (1.8 MB), approximately 603.3k tokens, and a symbol index with 1477 extracted functions, classes, methods, constants, and types. Use this with OpenClaw, Claude, ChatGPT, Cursor, Windsurf, or any other AI tool that accepts text input. You can copy the full output to your clipboard or download it as a .txt file.

Extracted by GitExtract — free GitHub repo to text converter for AI. Built by Nikandr Surkov.

Copied to clipboard!