├── README.TXT ├── frosted-doom ├── 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_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 /README.TXT: -------------------------------------------------------------------------------- 1 | ================ 2 | = FROSTED DOOM = 3 | ================ 4 | 5 | Port of original DOOM to Frosted operating system. 6 | Frosted does not yet have a framebuffer nor sound driver, 7 | so for the moment, it just compiles and links... 8 | 9 | 10 | Original readme 11 | =============== 12 | 13 | Here it is, at long last. The DOOM source code is released for your 14 | non-profit use. You still need real DOOM data to work with this code. 15 | If you don't actually own a real copy of one of the DOOMs, you should 16 | still be able to find them at software stores. 17 | 18 | Many thanks to Bernd Kreimeier for taking the time to clean up the 19 | project and make sure that it actually works. Projects tends to rot if 20 | you leave it alone for a few years, and it takes effort for someone to 21 | deal with it again. 22 | 23 | The bad news: this code only compiles and runs on linux. We couldn't 24 | release the dos code because of a copyrighted sound library we used 25 | (wow, was that a mistake -- I write my own sound code now), and I 26 | honestly don't even know what happened to the port that microsoft did 27 | to windows. 28 | 29 | Still, the code is quite portable, and it should be straightforward to 30 | bring it up on just about any platform. 31 | 32 | I wrote this code a long, long time ago, and there are plenty of things 33 | that seem downright silly in retrospect (using polar coordinates for 34 | clipping comes to mind), but overall it should still be a usefull base 35 | to experiment and build on. 36 | 37 | The basic rendering concept -- horizontal and vertical lines of constant 38 | Z with fixed light shading per band was dead-on, but the implementation 39 | could be improved dramatically from the original code if it were 40 | revisited. The way the rendering proceded from walls to floors to 41 | sprites could be collapsed into a single front-to-back walk of the bsp 42 | tree to collect information, then draw all the contents of a subsector 43 | on the way back up the tree. It requires treating floors and ceilings 44 | as polygons, rather than just the gaps between walls, and it requires 45 | clipping sprite billboards into subsector fragments, but it would be 46 | The Right Thing. 47 | 48 | The movement and line of sight checking against the lines is one of the 49 | bigger misses that I look back on. It is messy code that had some 50 | failure cases, and there was a vastly simpler (and faster) solution 51 | sitting in front of my face. I used the BSP tree for rendering things, 52 | but I didn't realize at the time that it could also be used for 53 | environment testing. Replacing the line of sight test with a bsp line 54 | clip would be pretty easy. Sweeping volumes for movement gets a bit 55 | tougher, and touches on many of the challenges faced in quake / quake2 56 | with edge bevels on polyhedrons. 57 | 58 | Some project ideas: 59 | 60 | Port it to your favorite operating system. 61 | 62 | Add some rendering features -- transparency, look up / down, slopes, 63 | etc. 64 | 65 | Add some game features -- weapons, jumping, ducking, flying, etc. 66 | 67 | Create a packet server based internet game. 68 | 69 | Create a client / server based internet game. 70 | 71 | Do a 3D accelerated version. On modern hardware (fast pentium + 3DFX) 72 | you probably wouldn't even need to be clever -- you could just draw the 73 | entire level and get reasonable speed. With a touch of effort, it should 74 | easily lock at 60 fps (well, there are some issues with DOOM's 35 hz 75 | timebase...). The biggest issues would probably be the non-power of two 76 | texture sizes and the walls composed of multiple textures. 77 | 78 | 79 | I don't have a real good guess at how many people are going to be 80 | playing with this, but if significant projects are undertaken, it would 81 | be cool to see a level of community cooperation. I know that most early 82 | projects are going to be rough hacks done in isolation, but I would be 83 | very pleased to see a coordinated 'net release of an improved, backwards 84 | compatable version of DOOM on multiple platforms next year. 85 | 86 | Have fun. 87 | 88 | John Carmack 89 | 12-23-97 90 | -------------------------------------------------------------------------------- /frosted-doom/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################ 2 | # 3 | # $Id:$ 4 | # 5 | # $Log:$ 6 | # 7 | 8 | ARM?=1 9 | 10 | ifeq ($(V),1) 11 | VB='' 12 | else 13 | VB=@ 14 | endif 15 | 16 | ifeq ($(ARM),1) 17 | CROSS_COMPILE = arm-frosted-eabi- 18 | OBJS+=$(OBJDIR)/i_video_fbdev.o 19 | CFLAGS+=-mthumb -mlittle-endian -mthumb-interwork -ffunction-sections -fdata-sections -mcpu=cortex-m3 20 | CFLAGS+=-DCORE_M3 -D__frosted__ 21 | # COMPILER FLAGS -- No gcc libraries 22 | CFLAGS+=-nostartfiles 23 | # COMPILER FLAGS -- GOT/PIC 24 | CFLAGS+=-fPIC -mlong-calls -fno-common -msingle-pic-base -mno-pic-data-is-text-relative -Wstack-usage=1024 25 | # LINKER FLAGS 26 | LDFLAGS+=-fPIC -mlong-calls -fno-common -Wl,-elf2flt -lgloss 27 | else 28 | CFLAGS+=-m32 -fsanitize=address -Wunused-const-variable=0 29 | LIBS+=-lXext -lX11 -lnsl -lm -lSDL 30 | OBJS+=$(OBJDIR)/i_video.o 31 | endif 32 | 33 | CC= $(CROSS_COMPILE)gcc # gcc or g++ 34 | CFLAGS+=-ggdb3 -Os 35 | LDFLAGS+=-Wl,--gc-sections 36 | CFLAGS+=-ggdb3 -Wall -DNORMALUNIX -DLINUX -DSNDSERV # -DUSEASM 37 | LIBS+=-lm -lc 38 | 39 | # subdirectory for objects 40 | OBJDIR=build 41 | OUTPUT=fdoom 42 | 43 | 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 44 | OBJS += $(addprefix $(OBJDIR)/, $(SRC_DOOM)) 45 | 46 | all: $(OUTPUT) 47 | 48 | clean: 49 | rm -rf $(OBJDIR) 50 | rm -f $(OUTPUT) 51 | rm -f $(OUTPUT).gdb 52 | rm -f $(OUTPUT).map 53 | 54 | $(OUTPUT): $(OBJS) 55 | @echo [Linking $@] 56 | $(VB)$(CC) $(CFLAGS) $(LDFLAGS) $(OBJS) \ 57 | -o $(OUTPUT) $(LIBS) -Wl,-Map,$(OUTPUT).map 58 | @echo [Size] 59 | -$(CROSS_COMPILE)size $(OUTPUT) 60 | -$(CROSS_COMPILE)flthdr $(OUTPUT) 61 | 62 | $(OBJS): | $(OBJDIR) 63 | 64 | $(OBJDIR): 65 | mkdir -p $(OBJDIR) 66 | 67 | $(OBJDIR)/%.o: %.c 68 | @echo [Compiling $<] 69 | $(VB)$(CC) $(CFLAGS) -c $< -o $@ 70 | 71 | print: 72 | @echo OBJS: $(OBJS) 73 | 74 | ############################################################# 75 | # 76 | ############################################################# 77 | 78 | -------------------------------------------------------------------------------- /frosted-doom/am_map.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // AutoMap module. 17 | // 18 | 19 | #ifndef __AMMAP_H__ 20 | #define __AMMAP_H__ 21 | 22 | #include "d_event.h" 23 | #include "m_cheat.h" 24 | 25 | // Used by ST StatusBar stuff. 26 | #define AM_MSGHEADER (('a'<<24)+('m'<<16)) 27 | #define AM_MSGENTERED (AM_MSGHEADER | ('e'<<8)) 28 | #define AM_MSGEXITED (AM_MSGHEADER | ('x'<<8)) 29 | 30 | 31 | // Called by main loop. 32 | boolean AM_Responder (event_t* ev); 33 | 34 | // Called by main loop. 35 | void AM_Ticker (void); 36 | 37 | // Called by main loop, 38 | // called instead of view drawer if automap active. 39 | void AM_Drawer (void); 40 | 41 | // Called to force the automap to quit 42 | // if the level is completed while it is up. 43 | void AM_Stop (void); 44 | 45 | 46 | extern cheatseq_t cheat_amap; 47 | 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /frosted-doom/config.h: -------------------------------------------------------------------------------- 1 | /* config.hin. Generated from configure.ac by autoheader. */ 2 | 3 | /* Define to 1 if you have the header file. */ 4 | #undef HAVE_DEV_ISA_SPKRIO_H 5 | 6 | /* Define to 1 if you have the header file. */ 7 | #undef HAVE_DEV_SPEAKER_SPEAKER_H 8 | 9 | /* Define to 1 if you have the header file. */ 10 | #define HAVE_INTTYPES_H 1 11 | 12 | /* Define to 1 if you have the `ioperm' function. */ 13 | #undef HAVE_IOPERM 14 | 15 | /* Define to 1 if you have the `amd64' library (-lamd64). */ 16 | #undef HAVE_LIBAMD64 17 | 18 | /* Define to 1 if you have the `i386' library (-li386). */ 19 | #undef HAVE_LIBI386 20 | 21 | /* Define to 1 if you have the `m' library (-lm). */ 22 | #undef HAVE_LIBM 23 | 24 | /* Define to 1 if you have the `png' library (-lpng). */ 25 | #undef HAVE_LIBPNG 26 | 27 | /* Define to 1 if you have the `samplerate' library (-lsamplerate). */ 28 | #undef HAVE_LIBSAMPLERATE 29 | 30 | /* Define to 1 if you have the `z' library (-lz). */ 31 | #undef HAVE_LIBZ 32 | 33 | /* Define to 1 if you have the header file. */ 34 | #undef HAVE_LINUX_KD_H 35 | 36 | /* Define to 1 if you have the header file. */ 37 | #undef HAVE_MEMORY_H 38 | 39 | /* Define to 1 if you have the `mmap' function. */ 40 | #undef HAVE_MMAP 41 | 42 | /* Define to 1 if you have the `sched_setaffinity' function. */ 43 | #undef HAVE_SCHED_SETAFFINITY 44 | 45 | /* Define to 1 if you have the header file. */ 46 | #define HAVE_STDINT_H 1 47 | 48 | /* Define to 1 if you have the header file. */ 49 | #define HAVE_STDLIB_H 1 50 | 51 | /* Define to 1 if you have the header file. */ 52 | #define HAVE_STRINGS_H 1 53 | 54 | /* Define to 1 if you have the header file. */ 55 | #define HAVE_STRING_H 1 56 | 57 | /* Define to 1 if you have the header file. */ 58 | #undef HAVE_SYS_STAT_H 59 | 60 | /* Define to 1 if you have the header file. */ 61 | #define HAVE_SYS_TYPES_H 1 62 | 63 | /* Define to 1 if you have the header file. */ 64 | #undef HAVE_UNISTD_H 65 | 66 | /* Name of package */ 67 | #define PACKAGE "Doom" 68 | 69 | /* Define to the address where bug reports for this package should be sent. */ 70 | #undef PACKAGE_BUGREPORT 71 | 72 | /* Define to the full name of this package. */ 73 | #define PACKAGE_NAME "FDoom" 74 | 75 | /* Define to the full name and version of this package. */ 76 | #define PACKAGE_STRING "FDoom 0.1" 77 | 78 | /* Define to the one symbol short name of this package. */ 79 | #define PACKAGE_TARNAME "fdoom.tar" 80 | 81 | /* Define to the home page for this package. */ 82 | #define PACKAGE_URL "" 83 | 84 | /* Define to the version of this package. */ 85 | #define PACKAGE_VERSION 0.1 86 | 87 | /* Change this when you create your awesome forked version */ 88 | #define PROGRAM_PREFIX "fdoom" 89 | 90 | /* Define to 1 if you have the ANSI C header files. */ 91 | #define STDC_HEADERS 1 92 | 93 | /* Version number of package */ 94 | #define VERSION 0.1 95 | 96 | /* Define to 1 if you want to compile the unmodified code */ 97 | #undef ORIGCODE 98 | 99 | /* Define to the directory where all game files are located */ 100 | #define FILES_DIR "/mnt" 101 | -------------------------------------------------------------------------------- /frosted-doom/d_event.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // 16 | // DESCRIPTION: Event handling. 17 | // 18 | // Events are asynchronous inputs generally generated by the game user. 19 | // Events can be discarded if no responder claims them 20 | // 21 | 22 | #include 23 | #include "d_event.h" 24 | 25 | #define MAXEVENTS 64 26 | 27 | static event_t events[MAXEVENTS]; 28 | static int eventhead; 29 | static int eventtail; 30 | 31 | // 32 | // D_PostEvent 33 | // Called by the I/O functions when input is detected 34 | // 35 | void D_PostEvent (event_t* ev) 36 | { 37 | events[eventhead] = *ev; 38 | eventhead = (eventhead + 1) % MAXEVENTS; 39 | } 40 | 41 | // Read an event from the queue. 42 | 43 | event_t *D_PopEvent(void) 44 | { 45 | event_t *result; 46 | 47 | // No more events waiting. 48 | 49 | if (eventtail == eventhead) 50 | { 51 | return NULL; 52 | } 53 | 54 | result = &events[eventtail]; 55 | 56 | // Advance to the next event in the queue. 57 | 58 | eventtail = (eventtail + 1) % MAXEVENTS; 59 | 60 | return result; 61 | } 62 | 63 | 64 | -------------------------------------------------------------------------------- /frosted-doom/d_event.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // 17 | // 18 | 19 | 20 | #ifndef __D_EVENT__ 21 | #define __D_EVENT__ 22 | 23 | 24 | #include "doomtype.h" 25 | 26 | 27 | // 28 | // Event handling. 29 | // 30 | 31 | // Input event types. 32 | typedef enum 33 | { 34 | ev_keydown, 35 | ev_keyup, 36 | ev_mouse, 37 | ev_joystick, 38 | ev_quit 39 | } evtype_t; 40 | 41 | // Event structure. 42 | typedef struct 43 | { 44 | evtype_t type; 45 | 46 | // Event-related data that depends on the type of event: 47 | // 48 | // ev_keydown/ev_keyup: 49 | // data1: Key code (from doomkeys.h) of the key that was 50 | // pressed or released. 51 | // data2: Ascii text of the character that was pressed, 52 | // shifted appropriately (eg. '$' if 4 was pressed 53 | // while shift was held). 54 | // 55 | // ev_mouse: 56 | // data1: Bitfield of buttons currently held down. 57 | // (bit 0 = left; bit 1 = right; bit 2 = middle). 58 | // data2: X axis mouse movement (turn). 59 | // data3: Y axis mouse movement (forward/backward). 60 | // 61 | // ev_joystick: 62 | // data1: Bitfield of buttons currently pressed. 63 | // data2: X axis mouse movement (turn). 64 | // data3: Y axis mouse movement (forward/backward). 65 | // data4: Third axis mouse movement (strafe). 66 | 67 | int data1, data2, data3, data4; 68 | } event_t; 69 | 70 | 71 | // 72 | // Button/action code definitions. 73 | // 74 | typedef enum 75 | { 76 | // Press "Fire". 77 | BT_ATTACK = 1, 78 | // Use button, to open doors, activate switches. 79 | BT_USE = 2, 80 | 81 | // Flag: game events, not really buttons. 82 | BT_SPECIAL = 128, 83 | BT_SPECIALMASK = 3, 84 | 85 | // Flag, weapon change pending. 86 | // If true, the next 3 bits hold weapon num. 87 | BT_CHANGE = 4, 88 | // The 3bit weapon mask and shift, convenience. 89 | BT_WEAPONMASK = (8+16+32), 90 | BT_WEAPONSHIFT = 3, 91 | 92 | // Pause the game. 93 | BTS_PAUSE = 1, 94 | // Save the game at each console. 95 | BTS_SAVEGAME = 2, 96 | 97 | // Savegame slot numbers 98 | // occupy the second byte of buttons. 99 | BTS_SAVEMASK = (4+8+16), 100 | BTS_SAVESHIFT = 2, 101 | 102 | } buttoncode_t; 103 | 104 | // villsa [STRIFE] Strife specific buttons 105 | // TODO - not finished 106 | typedef enum 107 | { 108 | // Player view look up 109 | BT2_LOOKUP = 1, 110 | // Player view look down 111 | BT2_LOOKDOWN = 2, 112 | // Center player's view 113 | BT2_CENTERVIEW = 4, 114 | // Use inventory item 115 | BT2_INVUSE = 8, 116 | // Drop inventory item 117 | BT2_INVDROP = 16, 118 | // Jump up and down 119 | BT2_JUMP = 32, 120 | // Use medkit 121 | BT2_HEALTH = 128, 122 | 123 | } buttoncode2_t; 124 | 125 | 126 | 127 | 128 | // Called by IO functions when input is detected. 129 | void D_PostEvent (event_t *ev); 130 | 131 | // Read an event from the event queue 132 | 133 | event_t *D_PopEvent(void); 134 | 135 | 136 | #endif 137 | 138 | -------------------------------------------------------------------------------- /frosted-doom/d_items.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // 17 | 18 | 19 | // We are referring to sprite numbers. 20 | #include "info.h" 21 | 22 | #include "d_items.h" 23 | 24 | 25 | // 26 | // PSPRITE ACTIONS for waepons. 27 | // This struct controls the weapon animations. 28 | // 29 | // Each entry is: 30 | // ammo/amunition type 31 | // upstate 32 | // downstate 33 | // readystate 34 | // atkstate, i.e. attack/fire/hit frame 35 | // flashstate, muzzle flash 36 | // 37 | weaponinfo_t weaponinfo[NUMWEAPONS] = 38 | { 39 | { 40 | // fist 41 | am_noammo, 42 | S_PUNCHUP, 43 | S_PUNCHDOWN, 44 | S_PUNCH, 45 | S_PUNCH1, 46 | S_NULL 47 | }, 48 | { 49 | // pistol 50 | am_clip, 51 | S_PISTOLUP, 52 | S_PISTOLDOWN, 53 | S_PISTOL, 54 | S_PISTOL1, 55 | S_PISTOLFLASH 56 | }, 57 | { 58 | // shotgun 59 | am_shell, 60 | S_SGUNUP, 61 | S_SGUNDOWN, 62 | S_SGUN, 63 | S_SGUN1, 64 | S_SGUNFLASH1 65 | }, 66 | { 67 | // chaingun 68 | am_clip, 69 | S_CHAINUP, 70 | S_CHAINDOWN, 71 | S_CHAIN, 72 | S_CHAIN1, 73 | S_CHAINFLASH1 74 | }, 75 | { 76 | // missile launcher 77 | am_misl, 78 | S_MISSILEUP, 79 | S_MISSILEDOWN, 80 | S_MISSILE, 81 | S_MISSILE1, 82 | S_MISSILEFLASH1 83 | }, 84 | { 85 | // plasma rifle 86 | am_cell, 87 | S_PLASMAUP, 88 | S_PLASMADOWN, 89 | S_PLASMA, 90 | S_PLASMA1, 91 | S_PLASMAFLASH1 92 | }, 93 | { 94 | // bfg 9000 95 | am_cell, 96 | S_BFGUP, 97 | S_BFGDOWN, 98 | S_BFG, 99 | S_BFG1, 100 | S_BFGFLASH1 101 | }, 102 | { 103 | // chainsaw 104 | am_noammo, 105 | S_SAWUP, 106 | S_SAWDOWN, 107 | S_SAW, 108 | S_SAW1, 109 | S_NULL 110 | }, 111 | { 112 | // super shotgun 113 | am_shell, 114 | S_DSGUNUP, 115 | S_DSGUNDOWN, 116 | S_DSGUN, 117 | S_DSGUN1, 118 | S_DSGUNFLASH1 119 | }, 120 | }; 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | -------------------------------------------------------------------------------- /frosted-doom/d_items.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Items: key cards, artifacts, weapon, ammunition. 17 | // 18 | 19 | 20 | #ifndef __D_ITEMS__ 21 | #define __D_ITEMS__ 22 | 23 | #include "doomdef.h" 24 | 25 | 26 | 27 | // Weapon info: sprite frames, ammunition use. 28 | typedef struct 29 | { 30 | ammotype_t ammo; 31 | int upstate; 32 | int downstate; 33 | int readystate; 34 | int atkstate; 35 | int flashstate; 36 | 37 | } weaponinfo_t; 38 | 39 | extern weaponinfo_t weaponinfo[NUMWEAPONS]; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /frosted-doom/d_iwad.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Find IWAD and initialize according to IWAD type. 16 | // 17 | 18 | 19 | #ifndef __D_IWAD__ 20 | #define __D_IWAD__ 21 | 22 | #include "d_mode.h" 23 | 24 | #define IWAD_MASK_DOOM ((1 << doom) \ 25 | | (1 << doom2) \ 26 | | (1 << pack_tnt) \ 27 | | (1 << pack_plut) \ 28 | | (1 << pack_chex) \ 29 | | (1 << pack_hacx)) 30 | #define IWAD_MASK_HERETIC (1 << heretic) 31 | #define IWAD_MASK_HEXEN (1 << hexen) 32 | #define IWAD_MASK_STRIFE (1 << strife) 33 | 34 | typedef struct 35 | { 36 | char *name; 37 | GameMission_t mission; 38 | GameMode_t mode; 39 | char *description; 40 | } iwad_t; 41 | 42 | char *D_FindWADByName(char *filename); 43 | char *D_TryFindWADByName(char *filename); 44 | char *D_FindIWAD(int mask, GameMission_t *mission); 45 | const iwad_t **D_FindAllIWADs(int mask); 46 | char *D_SaveGameIWADName(GameMission_t gamemission); 47 | char *D_SuggestIWADName(GameMission_t mission, GameMode_t mode); 48 | char *D_SuggestGameName(GameMission_t mission, GameMode_t mode); 49 | void D_CheckCorrectIWAD(GameMission_t mission); 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /frosted-doom/d_loop.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Main loop stuff. 17 | // 18 | 19 | #ifndef __D_LOOP__ 20 | #define __D_LOOP__ 21 | 22 | #include "net_defs.h" 23 | 24 | // Callback function invoked while waiting for the netgame to start. 25 | // The callback is invoked when new players are ready. The callback 26 | // should return true, or return false to abort startup. 27 | 28 | typedef boolean (*netgame_startup_callback_t)(int ready_players, 29 | int num_players); 30 | 31 | typedef struct 32 | { 33 | // Read events from the event queue, and process them. 34 | 35 | void (*ProcessEvents)(); 36 | 37 | // Given the current input state, fill in the fields of the specified 38 | // ticcmd_t structure with data for a new tic. 39 | 40 | void (*BuildTiccmd)(ticcmd_t *cmd, int maketic); 41 | 42 | // Advance the game forward one tic, using the specified player input. 43 | 44 | void (*RunTic)(ticcmd_t *cmds, boolean *ingame); 45 | 46 | // Run the menu (runs independently of the game). 47 | 48 | void (*RunMenu)(); 49 | } loop_interface_t; 50 | 51 | // Register callback functions for the main loop code to use. 52 | void D_RegisterLoopCallbacks(loop_interface_t *i); 53 | 54 | // Create any new ticcmds and broadcast to other players. 55 | void NetUpdate (void); 56 | 57 | // Broadcasts special packets to other players 58 | // to notify of game exit 59 | void D_QuitNetGame (void); 60 | 61 | //? how many ticks to run? 62 | void TryRunTics (void); 63 | 64 | // Called at start of game loop to initialize timers 65 | void D_StartGameLoop(void); 66 | 67 | // Initialize networking code and connect to server. 68 | 69 | boolean D_InitNetGame(net_connect_data_t *connect_data); 70 | 71 | // Start game with specified settings. The structure will be updated 72 | // with the actual settings for the game. 73 | 74 | void D_StartNetGame(net_gamesettings_t *settings, 75 | netgame_startup_callback_t callback); 76 | 77 | extern boolean singletics; 78 | extern int gametic, ticdup; 79 | 80 | #endif 81 | 82 | -------------------------------------------------------------------------------- /frosted-doom/d_main.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // System specific interface stuff. 17 | // 18 | 19 | 20 | #ifndef __D_MAIN__ 21 | #define __D_MAIN__ 22 | 23 | #include "doomdef.h" 24 | 25 | 26 | 27 | 28 | // Read events from all input devices 29 | 30 | void D_ProcessEvents (void); 31 | 32 | 33 | // 34 | // BASE LEVEL 35 | // 36 | void D_PageTicker (void); 37 | void D_PageDrawer (void); 38 | void D_AdvanceDemo (void); 39 | void D_DoAdvanceDemo (void); 40 | void D_StartTitle (void); 41 | 42 | // 43 | // GLOBAL VARIABLES 44 | // 45 | 46 | extern gameaction_t gameaction; 47 | 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /frosted-doom/d_mode.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Functions and definitions relating to the game type and operational 17 | // mode. 18 | // 19 | 20 | #ifndef __D_MODE__ 21 | #define __D_MODE__ 22 | 23 | #include "doomtype.h" 24 | 25 | // The "mission" controls what game we are playing. 26 | 27 | typedef enum 28 | { 29 | doom, // Doom 1 30 | doom2, // Doom 2 31 | pack_tnt, // Final Doom: TNT: Evilution 32 | pack_plut, // Final Doom: The Plutonia Experiment 33 | pack_chex, // Chex Quest (modded doom) 34 | pack_hacx, // Hacx (modded doom2) 35 | heretic, // Heretic 36 | hexen, // Hexen 37 | strife, // Strife 38 | 39 | none 40 | } GameMission_t; 41 | 42 | // The "mode" allows more accurate specification of the game mode we are 43 | // in: eg. shareware vs. registered. So doom1.wad and doom.wad are the 44 | // same mission, but a different mode. 45 | 46 | typedef enum 47 | { 48 | shareware, // Doom/Heretic shareware 49 | registered, // Doom/Heretic registered 50 | commercial, // Doom II/Hexen 51 | retail, // Ultimate Doom 52 | indetermined // Unknown. 53 | } GameMode_t; 54 | 55 | // What version are we emulating? 56 | 57 | typedef enum 58 | { 59 | exe_doom_1_2, // Doom 1.2: shareware and registered 60 | exe_doom_1_666, // Doom 1.666: for shareware, registered and commercial 61 | exe_doom_1_7, // Doom 1.7/1.7a: " 62 | exe_doom_1_8, // Doom 1.8: " 63 | exe_doom_1_9, // Doom 1.9: " 64 | exe_hacx, // Hacx 65 | exe_ultimate, // Ultimate Doom (retail) 66 | exe_final, // Final Doom 67 | exe_final2, // Final Doom (alternate exe) 68 | exe_chex, // Chex Quest executable (based on Final Doom) 69 | 70 | exe_heretic_1_3, // Heretic 1.3 71 | 72 | exe_hexen_1_1, // Hexen 1.1 73 | exe_strife_1_2, // Strife v1.2 74 | exe_strife_1_31 // Strife v1.31 75 | } GameVersion_t; 76 | 77 | // Skill level. 78 | 79 | typedef enum 80 | { 81 | sk_noitems = -1, // the "-skill 0" hack 82 | sk_baby = 0, 83 | sk_easy, 84 | sk_medium, 85 | sk_hard, 86 | sk_nightmare 87 | } skill_t; 88 | 89 | boolean D_ValidGameMode(GameMission_t mission, GameMode_t mode); 90 | boolean D_ValidGameVersion(GameMission_t mission, GameVersion_t version); 91 | boolean D_ValidEpisodeMap(GameMission_t mission, GameMode_t mode, 92 | int episode, int map); 93 | int D_GetNumEpisodes(GameMission_t mission, GameMode_t mode); 94 | boolean D_IsEpisodeMap(GameMission_t mission); 95 | char *D_GameMissionString(GameMission_t mission); 96 | 97 | #endif /* #ifndef __D_MODE__ */ 98 | 99 | -------------------------------------------------------------------------------- /frosted-doom/d_textur.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Typedefs related to to textures etc., 17 | // isolated here to make it easier separating modules. 18 | // 19 | 20 | 21 | #ifndef __D_TEXTUR__ 22 | #define __D_TEXTUR__ 23 | 24 | #include "doomtype.h" 25 | 26 | 27 | 28 | 29 | // 30 | // Flats? 31 | // 32 | // a pic is an unmasked block of pixels 33 | typedef struct 34 | { 35 | byte width; 36 | byte height; 37 | byte data; 38 | } pic_t; 39 | 40 | 41 | 42 | 43 | #endif 44 | -------------------------------------------------------------------------------- /frosted-doom/d_think.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // MapObj data. Map Objects or mobjs are actors, entities, 17 | // thinker, take-your-pick... anything that moves, acts, or 18 | // suffers state changes of more or less violent nature. 19 | // 20 | 21 | 22 | #ifndef __D_THINK__ 23 | #define __D_THINK__ 24 | 25 | 26 | 27 | 28 | 29 | // 30 | // Experimental stuff. 31 | // To compile this as "ANSI C with classes" 32 | // we will need to handle the various 33 | // action functions cleanly. 34 | // 35 | typedef void (*actionf_v)(); 36 | typedef void (*actionf_p1)( void* ); 37 | typedef void (*actionf_p2)( void*, void* ); 38 | 39 | typedef union 40 | { 41 | actionf_v acv; 42 | actionf_p1 acp1; 43 | actionf_p2 acp2; 44 | 45 | } actionf_t; 46 | 47 | 48 | 49 | 50 | 51 | // Historically, "think_t" is yet another 52 | // function pointer to a routine to handle 53 | // an actor. 54 | typedef actionf_t think_t; 55 | 56 | 57 | // Doubly linked list of actors. 58 | typedef struct thinker_s 59 | { 60 | struct thinker_s* prev; 61 | struct thinker_s* next; 62 | think_t function; 63 | 64 | } thinker_t; 65 | 66 | 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /frosted-doom/d_ticcmd.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 1993-2008 Raven Software 4 | // Copyright(C) 2005-2014 Simon Howard 5 | // 6 | // This program is free software; you can redistribute it and/or 7 | // modify it under the terms of the GNU General Public License 8 | // as published by the Free Software Foundation; either version 2 9 | // of the License, or (at your option) any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // DESCRIPTION: 17 | // System specific interface stuff. 18 | // 19 | 20 | 21 | #ifndef __D_TICCMD__ 22 | #define __D_TICCMD__ 23 | 24 | #include "doomtype.h" 25 | 26 | 27 | // The data sampled per tick (single player) 28 | // and transmitted to other peers (multiplayer). 29 | // Mainly movements/button commands per game tick, 30 | // plus a checksum for internal state consistency. 31 | 32 | typedef struct 33 | { 34 | signed char forwardmove; // *2048 for move 35 | signed char sidemove; // *2048 for move 36 | short angleturn; // <<16 for angle delta 37 | byte chatchar; 38 | byte buttons; 39 | // villsa [STRIFE] according to the asm, 40 | // consistancy is a short, not a byte 41 | byte consistancy; // checks for net game 42 | 43 | // villsa - Strife specific: 44 | 45 | byte buttons2; 46 | int inventory; 47 | 48 | // Heretic/Hexen specific: 49 | 50 | byte lookfly; // look/fly up/down/centering 51 | byte arti; // artitype_t to use 52 | } ticcmd_t; 53 | 54 | 55 | 56 | #endif 57 | -------------------------------------------------------------------------------- /frosted-doom/deh_main.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Dehacked entrypoint and common code 16 | // 17 | 18 | #ifndef DEH_MAIN_H 19 | #define DEH_MAIN_H 20 | 21 | #include "doomtype.h" 22 | #include "doomfeatures.h" 23 | #include "deh_str.h" 24 | #include "sha1.h" 25 | 26 | // These are the limits that dehacked uses (from dheinit.h in the dehacked 27 | // source). If these limits are exceeded, it does not generate an error, but 28 | // a warning is displayed. 29 | 30 | #define DEH_VANILLA_NUMSTATES 966 31 | #define DEH_VANILLA_NUMSFX 107 32 | 33 | void DEH_ParseCommandLine(void); 34 | int DEH_LoadFile(char *filename); 35 | int DEH_LoadLump(int lumpnum, boolean allow_long, boolean allow_error); 36 | int DEH_LoadLumpByName(char *name, boolean allow_long, boolean allow_error); 37 | 38 | boolean DEH_ParseAssignment(char *line, char **variable_name, char **value); 39 | 40 | void DEH_Checksum(sha1_digest_t digest); 41 | 42 | extern boolean deh_allow_extended_strings; 43 | extern boolean deh_allow_long_strings; 44 | extern boolean deh_allow_long_cheats; 45 | extern boolean deh_apply_cheats; 46 | 47 | #endif /* #ifndef DEH_MAIN_H */ 48 | 49 | -------------------------------------------------------------------------------- /frosted-doom/deh_misc.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Parses "Misc" sections in dehacked files 16 | // 17 | 18 | #ifndef DEH_MISC_H 19 | #define DEH_MISC_H 20 | 21 | #include "doomfeatures.h" 22 | 23 | #define DEH_DEFAULT_INITIAL_HEALTH 100 24 | #define DEH_DEFAULT_INITIAL_BULLETS 50 25 | #define DEH_DEFAULT_MAX_HEALTH 200 26 | #define DEH_DEFAULT_MAX_ARMOR 200 27 | #define DEH_DEFAULT_GREEN_ARMOR_CLASS 1 28 | #define DEH_DEFAULT_BLUE_ARMOR_CLASS 2 29 | #define DEH_DEFAULT_MAX_SOULSPHERE 200 30 | #define DEH_DEFAULT_SOULSPHERE_HEALTH 100 31 | #define DEH_DEFAULT_MEGASPHERE_HEALTH 200 32 | #define DEH_DEFAULT_GOD_MODE_HEALTH 100 33 | #define DEH_DEFAULT_IDFA_ARMOR 200 34 | #define DEH_DEFAULT_IDFA_ARMOR_CLASS 2 35 | #define DEH_DEFAULT_IDKFA_ARMOR 200 36 | #define DEH_DEFAULT_IDKFA_ARMOR_CLASS 2 37 | #define DEH_DEFAULT_BFG_CELLS_PER_SHOT 40 38 | #define DEH_DEFAULT_SPECIES_INFIGHTING 0 39 | 40 | #ifdef FEATURE_DEHACKED 41 | 42 | extern int deh_initial_health; 43 | extern int deh_initial_bullets; 44 | extern int deh_max_health; 45 | extern int deh_max_armor; 46 | extern int deh_green_armor_class; 47 | extern int deh_blue_armor_class; 48 | extern int deh_max_soulsphere; 49 | extern int deh_soulsphere_health; 50 | extern int deh_megasphere_health; 51 | extern int deh_god_mode_health; 52 | extern int deh_idfa_armor; 53 | extern int deh_idfa_armor_class; 54 | extern int deh_idkfa_armor; 55 | extern int deh_idkfa_armor_class; 56 | extern int deh_bfg_cells_per_shot; 57 | extern int deh_species_infighting; 58 | 59 | #else 60 | 61 | // If dehacked is disabled, hard coded values 62 | 63 | #define deh_initial_health DEH_DEFAULT_INITIAL_HEALTH 64 | #define deh_initial_bullets DEH_DEFAULT_INITIAL_BULLETS 65 | #define deh_max_health DEH_DEFAULT_MAX_HEALTH 66 | #define deh_max_armor DEH_DEFAULT_MAX_ARMOR 67 | #define deh_green_armor_class DEH_DEFAULT_GREEN_ARMOR_CLASS 68 | #define deh_blue_armor_class DEH_DEFAULT_BLUE_ARMOR_CLASS 69 | #define deh_max_soulsphere DEH_DEFAULT_MAX_SOULSPHERE 70 | #define deh_soulsphere_health DEH_DEFAULT_SOULSPHERE_HEALTH 71 | #define deh_megasphere_health DEH_DEFAULT_MEGASPHERE_HEALTH 72 | #define deh_god_mode_health DEH_DEFAULT_GOD_MODE_HEALTH 73 | #define deh_idfa_armor DEH_DEFAULT_IDFA_ARMOR 74 | #define deh_idfa_armor_class DEH_DEFAULT_IDFA_ARMOR_CLASS 75 | #define deh_idkfa_armor DEH_DEFAULT_IDKFA_ARMOR 76 | #define deh_idkfa_armor_class DEH_DEFAULT_IDKFA_ARMOR_CLASS 77 | #define deh_bfg_cells_per_shot DEH_DEFAULT_BFG_CELLS_PER_SHOT 78 | #define deh_species_infighting DEH_DEFAULT_SPECIES_INFIGHTING 79 | 80 | #endif 81 | 82 | #endif /* #ifndef DEH_MISC_H */ 83 | 84 | -------------------------------------------------------------------------------- /frosted-doom/deh_str.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Dehacked string replacements 16 | // 17 | 18 | #ifndef DEH_STR_H 19 | #define DEH_STR_H 20 | 21 | #include 22 | 23 | #include "doomfeatures.h" 24 | 25 | // Used to do dehacked text substitutions throughout the program 26 | 27 | #ifdef FEATURE_DEHACKED 28 | 29 | char *DEH_String(char *s); 30 | void DEH_printf(char *fmt, ...); 31 | void DEH_fprintf(FILE *fstream, char *fmt, ...); 32 | void DEH_snprintf(char *buffer, size_t len, char *fmt, ...); 33 | void DEH_AddStringReplacement(char *from_text, char *to_text); 34 | 35 | 36 | #else 37 | 38 | #define DEH_String(x) (x) 39 | #define DEH_printf printf 40 | #define DEH_fprintf fprintf 41 | #define DEH_snprintf snprintf 42 | #define DEH_AddStringReplacement(x, y) 43 | 44 | #endif 45 | 46 | #endif /* #ifndef DEH_STR_H */ 47 | 48 | -------------------------------------------------------------------------------- /frosted-doom/doom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * doom.h 3 | * 4 | * Created on: 18.02.2015 5 | * Author: Florian 6 | */ 7 | 8 | 9 | #ifndef SRC_CHOCDOOM_DOOM_H_ 10 | #define SRC_CHOCDOOM_DOOM_H_ 11 | 12 | /*---------------------------------------------------------------------* 13 | * additional includes * 14 | *---------------------------------------------------------------------*/ 15 | 16 | /*---------------------------------------------------------------------* 17 | * global definitions * 18 | *---------------------------------------------------------------------*/ 19 | 20 | /*---------------------------------------------------------------------* 21 | * type declarations * 22 | *---------------------------------------------------------------------*/ 23 | 24 | /*---------------------------------------------------------------------* 25 | * function prototypes * 26 | *---------------------------------------------------------------------*/ 27 | 28 | void D_DoomMain (void); 29 | 30 | /*---------------------------------------------------------------------* 31 | * global data * 32 | *---------------------------------------------------------------------*/ 33 | 34 | /*---------------------------------------------------------------------* 35 | * inline functions and function-like macros * 36 | *---------------------------------------------------------------------*/ 37 | 38 | /*---------------------------------------------------------------------* 39 | * eof * 40 | *---------------------------------------------------------------------*/ 41 | 42 | #endif /* SRC_CHOCDOOM_DOOM_H_ */ 43 | -------------------------------------------------------------------------------- /frosted-doom/doomdef.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // DoomDef - basic defines for DOOM, e.g. Version, game mode 17 | // and skill level, and display parameters. 18 | // 19 | 20 | 21 | 22 | #include "doomdef.h" 23 | 24 | // Location for any defines turned variables. 25 | 26 | // None. 27 | 28 | 29 | -------------------------------------------------------------------------------- /frosted-doom/doomdef.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Internally used data structures for virtually everything, 17 | // lots of other stuff. 18 | // 19 | 20 | #ifndef __DOOMDEF__ 21 | #define __DOOMDEF__ 22 | 23 | #include 24 | #include 25 | 26 | #include "doomtype.h" 27 | #include "i_timer.h" 28 | #include "d_mode.h" 29 | 30 | // 31 | // Global parameters/defines. 32 | // 33 | // DOOM version 34 | #define DOOM_VERSION 109 35 | 36 | // Version code for cph's longtics hack ("v1.91") 37 | #define DOOM_191_VERSION 111 38 | 39 | 40 | // If rangecheck is undefined, 41 | // most parameter validation debugging code will not be compiled 42 | #define RANGECHECK 43 | 44 | // The maximum number of players, multiplayer/networking. 45 | #define MAXPLAYERS 4 46 | 47 | // The current state of the game: whether we are 48 | // playing, gazing at the intermission screen, 49 | // the game final animation, or a demo. 50 | typedef enum 51 | { 52 | GS_LEVEL, 53 | GS_INTERMISSION, 54 | GS_FINALE, 55 | GS_DEMOSCREEN, 56 | } gamestate_t; 57 | 58 | typedef enum 59 | { 60 | ga_nothing, 61 | ga_loadlevel, 62 | ga_newgame, 63 | ga_loadgame, 64 | ga_savegame, 65 | ga_playdemo, 66 | ga_completed, 67 | ga_victory, 68 | ga_worlddone, 69 | ga_screenshot 70 | } gameaction_t; 71 | 72 | // 73 | // Difficulty/skill settings/filters. 74 | // 75 | 76 | // Skill flags. 77 | #define MTF_EASY 1 78 | #define MTF_NORMAL 2 79 | #define MTF_HARD 4 80 | 81 | // Deaf monsters/do not react to sound. 82 | #define MTF_AMBUSH 8 83 | 84 | 85 | // 86 | // Key cards. 87 | // 88 | typedef enum 89 | { 90 | it_bluecard, 91 | it_yellowcard, 92 | it_redcard, 93 | it_blueskull, 94 | it_yellowskull, 95 | it_redskull, 96 | 97 | NUMCARDS 98 | 99 | } card_t; 100 | 101 | 102 | 103 | // The defined weapons, 104 | // including a marker indicating 105 | // user has not changed weapon. 106 | typedef enum 107 | { 108 | wp_fist, 109 | wp_pistol, 110 | wp_shotgun, 111 | wp_chaingun, 112 | wp_missile, 113 | wp_plasma, 114 | wp_bfg, 115 | wp_chainsaw, 116 | wp_supershotgun, 117 | 118 | NUMWEAPONS, 119 | 120 | // No pending weapon change. 121 | wp_nochange 122 | 123 | } weapontype_t; 124 | 125 | 126 | // Ammunition types defined. 127 | typedef enum 128 | { 129 | am_clip, // Pistol / chaingun ammo. 130 | am_shell, // Shotgun / double barreled shotgun. 131 | am_cell, // Plasma rifle, BFG. 132 | am_misl, // Missile launcher. 133 | NUMAMMO, 134 | am_noammo // Unlimited for chainsaw / fist. 135 | 136 | } ammotype_t; 137 | 138 | 139 | // Power up artifacts. 140 | typedef enum 141 | { 142 | pw_invulnerability, 143 | pw_strength, 144 | pw_invisibility, 145 | pw_ironfeet, 146 | pw_allmap, 147 | pw_infrared, 148 | NUMPOWERS 149 | 150 | } powertype_t; 151 | 152 | 153 | 154 | // 155 | // Power up durations, 156 | // how many seconds till expiration, 157 | // assuming TICRATE is 35 ticks/second. 158 | // 159 | typedef enum 160 | { 161 | INVULNTICS = (30*TICRATE), 162 | INVISTICS = (60*TICRATE), 163 | INFRATICS = (120*TICRATE), 164 | IRONTICS = (60*TICRATE) 165 | 166 | } powerduration_t; 167 | 168 | #endif // __DOOMDEF__ 169 | -------------------------------------------------------------------------------- /frosted-doom/doomfeatures.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // List of features which can be enabled/disabled to slim down the 16 | // program. 17 | // 18 | 19 | #ifndef DOOM_FEATURES_H 20 | #define DOOM_FEATURES_H 21 | 22 | // Enables wad merging (the '-merge' command line parameter) 23 | 24 | #undef FEATURE_WAD_MERGE 25 | 26 | // Enables dehacked support ('-deh') 27 | 28 | #undef FEATURE_DEHACKED 29 | 30 | // Enables multiplayer support (network games) 31 | 32 | #undef FEATURE_MULTIPLAYER 33 | 34 | // Enables sound output 35 | 36 | #undef FEATURE_SOUND 37 | 38 | #endif /* #ifndef DOOM_FEATURES_H */ 39 | 40 | 41 | -------------------------------------------------------------------------------- /frosted-doom/doomkeys.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Key definitions 17 | // 18 | 19 | #ifndef __DOOMKEYS__ 20 | #define __DOOMKEYS__ 21 | 22 | // 23 | // DOOM keyboard definition. 24 | // This is the stuff configured by Setup.Exe. 25 | // Most key data are simple ascii (uppercased). 26 | // 27 | #define KEY_RIGHTARROW 0xae 28 | #define KEY_LEFTARROW 0xac 29 | #define KEY_UPARROW 0xad 30 | #define KEY_DOWNARROW 0xaf 31 | #define KEY_STRAFE_L 0xa0 32 | #define KEY_STRAFE_R 0xa1 33 | #define KEY_USE 0xa2 34 | #define KEY_FIRE 0xa3 35 | #define KEY_ESCAPE 27 36 | #define KEY_ENTER 13 37 | #define KEY_TAB 9 38 | #define KEY_F1 (0x80+0x3b) 39 | #define KEY_F2 (0x80+0x3c) 40 | #define KEY_F3 (0x80+0x3d) 41 | #define KEY_F4 (0x80+0x3e) 42 | #define KEY_F5 (0x80+0x3f) 43 | #define KEY_F6 (0x80+0x40) 44 | #define KEY_F7 (0x80+0x41) 45 | #define KEY_F8 (0x80+0x42) 46 | #define KEY_F9 (0x80+0x43) 47 | #define KEY_F10 (0x80+0x44) 48 | #define KEY_F11 (0x80+0x57) 49 | #define KEY_F12 (0x80+0x58) 50 | 51 | #define KEY_BACKSPACE 0x7f 52 | #define KEY_PAUSE 0xff 53 | 54 | #define KEY_EQUALS 0x3d 55 | #define KEY_MINUS 0x2d 56 | 57 | #define KEY_RSHIFT (0x80+0x36) 58 | #define KEY_RCTRL (0x80+0x1d) 59 | #define KEY_RALT (0x80+0x38) 60 | 61 | #define KEY_LALT KEY_RALT 62 | 63 | // new keys: 64 | 65 | #define KEY_CAPSLOCK (0x80+0x3a) 66 | #define KEY_NUMLOCK (0x80+0x45) 67 | #define KEY_SCRLCK (0x80+0x46) 68 | #define KEY_PRTSCR (0x80+0x59) 69 | 70 | #define KEY_HOME (0x80+0x47) 71 | #define KEY_END (0x80+0x4f) 72 | #define KEY_PGUP (0x80+0x49) 73 | #define KEY_PGDN (0x80+0x51) 74 | #define KEY_INS (0x80+0x52) 75 | #define KEY_DEL (0x80+0x53) 76 | 77 | #define KEYP_0 0 78 | #define KEYP_1 KEY_END 79 | #define KEYP_2 KEY_DOWNARROW 80 | #define KEYP_3 KEY_PGDN 81 | #define KEYP_4 KEY_LEFTARROW 82 | #define KEYP_5 '5' 83 | #define KEYP_6 KEY_RIGHTARROW 84 | #define KEYP_7 KEY_HOME 85 | #define KEYP_8 KEY_UPARROW 86 | #define KEYP_9 KEY_PGUP 87 | 88 | #define KEYP_DIVIDE '/' 89 | #define KEYP_PLUS '+' 90 | #define KEYP_MINUS '-' 91 | #define KEYP_MULTIPLY '*' 92 | #define KEYP_PERIOD 0 93 | #define KEYP_EQUALS KEY_EQUALS 94 | #define KEYP_ENTER KEY_ENTER 95 | 96 | #endif // __DOOMKEYS__ 97 | 98 | -------------------------------------------------------------------------------- /frosted-doom/doomstat.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Put all global tate variables here. 17 | // 18 | 19 | #include 20 | 21 | #include "doomstat.h" 22 | 23 | 24 | // Game Mode - identify IWAD as shareware, retail etc. 25 | GameMode_t gamemode = indetermined; 26 | GameMission_t gamemission = doom; 27 | GameVersion_t gameversion = exe_final2; 28 | char *gamedescription; 29 | 30 | // Set if homebrew PWAD stuff has been added. 31 | boolean modifiedgame; 32 | 33 | 34 | 35 | 36 | -------------------------------------------------------------------------------- /frosted-doom/doomtype.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Simple basic typedefs, isolated here to make it easier 17 | // separating modules. 18 | // 19 | 20 | 21 | #ifndef __DOOMTYPE__ 22 | #define __DOOMTYPE__ 23 | 24 | // #define macros to provide functions missing in Windows. 25 | // Outside Windows, we use strings.h for str[n]casecmp. 26 | 27 | 28 | #ifdef _WIN32 29 | 30 | #define strcasecmp stricmp 31 | #define strncasecmp strnicmp 32 | 33 | #else 34 | 35 | #include 36 | 37 | #endif 38 | 39 | 40 | // 41 | // The packed attribute forces structures to be packed into the minimum 42 | // space necessary. If this is not done, the compiler may align structure 43 | // fields differently to optimize memory access, inflating the overall 44 | // structure size. It is important to use the packed attribute on certain 45 | // structures where alignment is important, particularly data read/written 46 | // to disk. 47 | // 48 | 49 | #ifdef __GNUC__ 50 | #define PACKEDATTR __attribute__((packed)) 51 | #else 52 | #define PACKEDATTR 53 | #endif 54 | 55 | // C99 integer types; with gcc we just use this. Other compilers 56 | // should add conditional statements that define the C99 types. 57 | 58 | // What is really wanted here is stdint.h; however, some old versions 59 | // of Solaris don't have stdint.h and only have inttypes.h (the 60 | // pre-standardisation version). inttypes.h is also in the C99 61 | // standard and defined to include stdint.h, so include this. 62 | 63 | #include 64 | 65 | #ifdef __cplusplus 66 | 67 | // Use builtin bool type with C++. 68 | 69 | typedef bool boolean; 70 | 71 | #else 72 | 73 | typedef enum 74 | { 75 | false = 0, 76 | true = 1, 77 | undef = 0xFFFFFFFF 78 | } boolean; 79 | 80 | #endif 81 | 82 | typedef uint8_t byte; 83 | 84 | #include 85 | 86 | #ifdef _WIN32 87 | 88 | #define DIR_SEPARATOR '\\' 89 | #define DIR_SEPARATOR_S "\\" 90 | #define PATH_SEPARATOR ';' 91 | 92 | #else 93 | 94 | #define DIR_SEPARATOR '/' 95 | #define DIR_SEPARATOR_S "/" 96 | #define PATH_SEPARATOR ':' 97 | 98 | #endif 99 | 100 | #define arrlen(array) (sizeof(array) / sizeof(*array)) 101 | 102 | #endif 103 | 104 | -------------------------------------------------------------------------------- /frosted-doom/dstrings.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Globally defined strings. 17 | // 18 | 19 | 20 | 21 | #include "dstrings.h" 22 | 23 | char *doom1_endmsg[] = 24 | { 25 | "are you sure you want to\nquit this great game?", 26 | "please don't leave, there's more\ndemons to toast!", 27 | "let's beat it -- this is turning\ninto a bloodbath!", 28 | "i wouldn't leave if i were you.\ndos is much worse.", 29 | "you're trying to say you like dos\nbetter than me, right?", 30 | "don't leave yet -- there's a\ndemon around that corner!", 31 | "ya know, next time you come in here\ni'm gonna toast ya.", 32 | "go ahead and leave. see if i care.", 33 | }; 34 | 35 | char *doom2_endmsg[] = 36 | { 37 | // QuitDOOM II messages 38 | "are you sure you want to\nquit this great game?", 39 | "you want to quit?\nthen, thou hast lost an eighth!", 40 | "don't go now, there's a \ndimensional shambler waiting\nat the dos prompt!", 41 | "get outta here and go back\nto your boring programs.", 42 | "if i were your boss, i'd \n deathmatch ya in a minute!", 43 | "look, bud. you leave now\nand you forfeit your body count!", 44 | "just leave. when you come\nback, i'll be waiting with a bat.", 45 | "you're lucky i don't smack\nyou for thinking about leaving.", 46 | }; 47 | 48 | #if 0 49 | 50 | // UNUSED messages included in the source release 51 | 52 | char* endmsg[] = 53 | { 54 | // DOOM1 55 | QUITMSG, 56 | // FinalDOOM? 57 | "fuck you, pussy!\nget the fuck out!", 58 | "you quit and i'll jizz\nin your cystholes!", 59 | "if you leave, i'll make\nthe lord drink my jizz.", 60 | "hey, ron! can we say\n'fuck' in the game?", 61 | "i'd leave: this is just\nmore monsters and levels.\nwhat a load.", 62 | "suck it down, asshole!\nyou're a fucking wimp!", 63 | "don't quit now! we're \nstill spending your money!", 64 | 65 | // Internal debug. Different style, too. 66 | "THIS IS NO MESSAGE!\nPage intentionally left blank." 67 | }; 68 | 69 | #endif 70 | 71 | 72 | 73 | 74 | -------------------------------------------------------------------------------- /frosted-doom/dstrings.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // 16 | // DESCRIPTION: 17 | // DOOM strings, by language. 18 | // 19 | 20 | 21 | #ifndef __DSTRINGS__ 22 | #define __DSTRINGS__ 23 | 24 | 25 | // All important printed strings. 26 | 27 | #include "d_englsh.h" 28 | 29 | // Misc. other strings. 30 | #define SAVEGAMENAME "doomsav" 31 | 32 | 33 | // QuitDOOM messages 34 | // 8 per each game type 35 | #define NUM_QUITMESSAGES 8 36 | 37 | extern char *doom1_endmsg[]; 38 | extern char *doom2_endmsg[]; 39 | 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /frosted-doom/dummy.c: -------------------------------------------------------------------------------- 1 | /* 2 | * dummy.c 3 | * 4 | * Created on: 16.02.2015 5 | * Author: Florian 6 | */ 7 | 8 | 9 | /*---------------------------------------------------------------------* 10 | * include files * 11 | *---------------------------------------------------------------------*/ 12 | 13 | #include "doomtype.h" 14 | 15 | /*---------------------------------------------------------------------* 16 | * local definitions * 17 | *---------------------------------------------------------------------*/ 18 | 19 | /*---------------------------------------------------------------------* 20 | * external declarations * 21 | *---------------------------------------------------------------------*/ 22 | 23 | /*---------------------------------------------------------------------* 24 | * public data * 25 | *---------------------------------------------------------------------*/ 26 | 27 | boolean net_client_connected = false; 28 | 29 | boolean drone = false; 30 | 31 | /*---------------------------------------------------------------------* 32 | * private data * 33 | *---------------------------------------------------------------------*/ 34 | 35 | /*---------------------------------------------------------------------* 36 | * private functions * 37 | *---------------------------------------------------------------------*/ 38 | 39 | /*---------------------------------------------------------------------* 40 | * public functions * 41 | *---------------------------------------------------------------------*/ 42 | 43 | void I_InitTimidityConfig(void) 44 | { 45 | } 46 | 47 | /*---------------------------------------------------------------------* 48 | * eof * 49 | *---------------------------------------------------------------------*/ 50 | -------------------------------------------------------------------------------- /frosted-doom/f_finale.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // 17 | // 18 | 19 | 20 | #ifndef __F_FINALE__ 21 | #define __F_FINALE__ 22 | 23 | 24 | #include "doomtype.h" 25 | #include "d_event.h" 26 | // 27 | // FINALE 28 | // 29 | 30 | // Called by main loop. 31 | boolean F_Responder (event_t* ev); 32 | 33 | // Called by main loop. 34 | void F_Ticker (void); 35 | 36 | // Called by main loop. 37 | void F_Drawer (void); 38 | 39 | 40 | void F_StartFinale (void); 41 | 42 | 43 | 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /frosted-doom/f_wipe.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Mission start screen wipe/melt, special effects. 17 | // 18 | 19 | 20 | #ifndef __F_WIPE_H__ 21 | #define __F_WIPE_H__ 22 | 23 | // 24 | // SCREEN WIPE PACKAGE 25 | // 26 | 27 | enum 28 | { 29 | // simple gradual pixel change for 8-bit only 30 | wipe_ColorXForm, 31 | 32 | // weird screen melt 33 | wipe_Melt, 34 | 35 | wipe_NUMWIPES 36 | }; 37 | 38 | int 39 | wipe_StartScreen 40 | ( int x, 41 | int y, 42 | int width, 43 | int height ); 44 | 45 | 46 | int 47 | wipe_EndScreen 48 | ( int x, 49 | int y, 50 | int width, 51 | int height ); 52 | 53 | 54 | int 55 | wipe_ScreenWipe 56 | ( int wipeno, 57 | int x, 58 | int y, 59 | int width, 60 | int height, 61 | int ticks ); 62 | 63 | #endif 64 | -------------------------------------------------------------------------------- /frosted-doom/g_game.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Duh. 17 | // 18 | 19 | 20 | #ifndef __G_GAME__ 21 | #define __G_GAME__ 22 | 23 | #include "doomdef.h" 24 | #include "d_event.h" 25 | #include "d_ticcmd.h" 26 | 27 | 28 | // 29 | // GAME 30 | // 31 | void G_DeathMatchSpawnPlayer (int playernum); 32 | 33 | void G_InitNew (skill_t skill, int episode, int map); 34 | 35 | // Can be called by the startup code or M_Responder. 36 | // A normal game starts at map 1, 37 | // but a warp test can start elsewhere 38 | void G_DeferedInitNew (skill_t skill, int episode, int map); 39 | 40 | void G_DeferedPlayDemo (char* demo); 41 | 42 | // Can be called by the startup code or M_Responder, 43 | // calls P_SetupLevel or W_EnterWorld. 44 | void G_LoadGame (char* name); 45 | 46 | void G_DoLoadGame (void); 47 | 48 | // Called by M_Responder. 49 | void G_SaveGame (int slot, char* description); 50 | 51 | // Only called by startup code. 52 | void G_RecordDemo (char* name); 53 | 54 | void G_BeginRecording (void); 55 | 56 | void G_PlayDemo (char* name); 57 | void G_TimeDemo (char* name); 58 | boolean G_CheckDemoStatus (void); 59 | 60 | void G_ExitLevel (void); 61 | void G_SecretExitLevel (void); 62 | 63 | void G_WorldDone (void); 64 | 65 | // Read current data from inputs and build a player movement command. 66 | 67 | void G_BuildTiccmd (ticcmd_t *cmd, int maketic); 68 | 69 | void G_Ticker (void); 70 | boolean G_Responder (event_t* ev); 71 | 72 | void G_ScreenShot (void); 73 | 74 | void G_DrawMouseSpeedBox(void); 75 | int G_VanillaVersionCode(void); 76 | 77 | extern int vanilla_savegame_limit; 78 | extern int vanilla_demo_limit; 79 | #endif 80 | 81 | -------------------------------------------------------------------------------- /frosted-doom/gusconf.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // GUS emulation code. 16 | // 17 | 18 | #ifndef __GUSCONF_H__ 19 | #define __GUSCONF_H__ 20 | 21 | #include "doomtype.h" 22 | 23 | extern char *gus_patch_path; 24 | extern unsigned int gus_ram_kb; 25 | 26 | boolean GUS_WriteConfig(char *path); 27 | 28 | #endif /* #ifndef __GUSCONF_H__ */ 29 | 30 | -------------------------------------------------------------------------------- /frosted-doom/hu_stuff.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: Head up display 16 | // 17 | 18 | #ifndef __HU_STUFF_H__ 19 | #define __HU_STUFF_H__ 20 | 21 | #include "d_event.h" 22 | 23 | 24 | // 25 | // Globally visible constants. 26 | // 27 | #define HU_FONTSTART '!' // the first font characters 28 | #define HU_FONTEND '_' // the last font characters 29 | 30 | // Calculate # of glyphs in font. 31 | #define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1) 32 | 33 | #define HU_BROADCAST 5 34 | 35 | #define HU_MSGX 0 36 | #define HU_MSGY 0 37 | #define HU_MSGWIDTH 64 // in characters 38 | #define HU_MSGHEIGHT 1 // in lines 39 | 40 | #define HU_MSGTIMEOUT (4*TICRATE) 41 | 42 | // 43 | // HEADS UP TEXT 44 | // 45 | 46 | void HU_Init(void); 47 | void HU_Start(void); 48 | 49 | boolean HU_Responder(event_t* ev); 50 | 51 | void HU_Ticker(void); 52 | void HU_Drawer(void); 53 | char HU_dequeueChatChar(void); 54 | void HU_Erase(void); 55 | 56 | extern char *chat_macros[10]; 57 | 58 | #endif 59 | 60 | -------------------------------------------------------------------------------- /frosted-doom/i_cdmus.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 1993-2008 Raven Software 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | 16 | // i_cdmus.h 17 | 18 | #ifndef __ICDMUS__ 19 | #define __ICDMUS__ 20 | 21 | #define CDERR_NOTINSTALLED 10 // MSCDEX not installed 22 | #define CDERR_NOAUDIOSUPPORT 11 // CD-ROM Doesn't support audio 23 | #define CDERR_NOAUDIOTRACKS 12 // Current CD has no audio tracks 24 | #define CDERR_BADDRIVE 20 // Bad drive number 25 | #define CDERR_BADTRACK 21 // Bad track number 26 | #define CDERR_IOCTLBUFFMEM 22 // Not enough low memory for IOCTL 27 | #define CDERR_DEVREQBASE 100 // DevReq errors 28 | 29 | extern int cd_Error; 30 | 31 | int I_CDMusInit(void); 32 | void I_CDMusPrintStartup(void); 33 | int I_CDMusPlay(int track); 34 | int I_CDMusStop(void); 35 | int I_CDMusResume(void); 36 | int I_CDMusSetVolume(int volume); 37 | int I_CDMusFirstTrack(void); 38 | int I_CDMusLastTrack(void); 39 | int I_CDMusTrackLength(int track); 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /frosted-doom/i_endoom.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Exit text-mode ENDOOM screen. 16 | // 17 | 18 | #include 19 | #include 20 | 21 | #include "config.h" 22 | #include "doomtype.h" 23 | #include "i_video.h" 24 | 25 | #ifdef ORIGCODE 26 | #include "txt_main.h" 27 | #endif 28 | 29 | #define ENDOOM_W 80 30 | #define ENDOOM_H 25 31 | 32 | // 33 | // Displays the text mode ending screen after the game quits 34 | // 35 | 36 | void I_Endoom(byte *endoom_data) 37 | { 38 | #ifdef ORIGCODE 39 | unsigned char *screendata; 40 | int y; 41 | int indent; 42 | 43 | // Set up text mode screen 44 | 45 | TXT_Init(); 46 | I_InitWindowTitle(); 47 | I_InitWindowIcon(); 48 | 49 | // Write the data to the screen memory 50 | 51 | screendata = TXT_GetScreenData(); 52 | 53 | indent = (ENDOOM_W - TXT_SCREEN_W) / 2; 54 | 55 | for (y=0; y 0) 69 | { 70 | break; 71 | } 72 | 73 | TXT_Sleep(0); 74 | } 75 | 76 | // Shut down text mode screen 77 | 78 | TXT_Shutdown(); 79 | #endif 80 | } 81 | 82 | -------------------------------------------------------------------------------- /frosted-doom/i_endoom.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Exit text-mode ENDOOM screen. 17 | // 18 | 19 | 20 | #ifndef __I_ENDOOM__ 21 | #define __I_ENDOOM__ 22 | 23 | // Display the Endoom screen on shutdown. Pass a pointer to the 24 | // ENDOOM lump. 25 | 26 | void I_Endoom(byte *data); 27 | 28 | #endif 29 | 30 | -------------------------------------------------------------------------------- /frosted-doom/i_joystick.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // System-specific joystick interface. 16 | // 17 | 18 | 19 | #ifndef __I_JOYSTICK__ 20 | #define __I_JOYSTICK__ 21 | 22 | // Number of "virtual" joystick buttons defined in configuration files. 23 | // This needs to be at least as large as the number of different key 24 | // bindings supported by the higher-level game code (joyb* variables). 25 | #define NUM_VIRTUAL_BUTTONS 10 26 | 27 | // If this bit is set in a configuration file axis value, the axis is 28 | // not actually a joystick axis, but instead is a "button axis". This 29 | // means that instead of reading an SDL joystick axis, we read the 30 | // state of two buttons to get the axis value. This is needed for eg. 31 | // the PS3 SIXAXIS controller, where the D-pad buttons register as 32 | // buttons, not as two axes. 33 | #define BUTTON_AXIS 0x10000 34 | 35 | // Query whether a given axis value describes a button axis. 36 | #define IS_BUTTON_AXIS(axis) ((axis) >= 0 && ((axis) & BUTTON_AXIS) != 0) 37 | 38 | // Get the individual buttons from a button axis value. 39 | #define BUTTON_AXIS_NEG(axis) ((axis) & 0xff) 40 | #define BUTTON_AXIS_POS(axis) (((axis) >> 8) & 0xff) 41 | 42 | // Create a button axis value from two button values. 43 | #define CREATE_BUTTON_AXIS(neg, pos) (BUTTON_AXIS | (neg) | ((pos) << 8)) 44 | 45 | // If this bit is set in an axis value, the axis is not actually a 46 | // joystick axis, but is a "hat" axis. This means that we read (one of) 47 | // the hats on the joystick. 48 | #define HAT_AXIS 0x20000 49 | 50 | #define IS_HAT_AXIS(axis) ((axis) >= 0 && ((axis) & HAT_AXIS) != 0) 51 | 52 | // Get the hat number from a hat axis value. 53 | #define HAT_AXIS_HAT(axis) ((axis) & 0xff) 54 | // Which axis of the hat? (horizonal or vertical) 55 | #define HAT_AXIS_DIRECTION(axis) (((axis) >> 8) & 0xff) 56 | 57 | #define CREATE_HAT_AXIS(hat, direction) \ 58 | (HAT_AXIS | (hat) | ((direction) << 8)) 59 | 60 | #define HAT_AXIS_HORIZONTAL 1 61 | #define HAT_AXIS_VERTICAL 2 62 | 63 | void I_InitJoystick(void); 64 | void I_ShutdownJoystick(void); 65 | void I_UpdateJoystick(void); 66 | 67 | void I_BindJoystickVariables(void); 68 | 69 | #endif /* #ifndef __I_JOYSTICK__ */ 70 | 71 | -------------------------------------------------------------------------------- /frosted-doom/i_main.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Main program, simply calls D_DoomMain high level loop. 17 | // 18 | 19 | #include "config.h" 20 | 21 | #include 22 | 23 | #include "doomtype.h" 24 | #include "i_system.h" 25 | #include "m_argv.h" 26 | 27 | // 28 | // D_DoomMain() 29 | // Not a globally visible function, just included for source reference, 30 | // calls all startup code, parses command line options. 31 | // 32 | 33 | void D_DoomMain (void); 34 | 35 | int main(int argc, char **argv) 36 | { 37 | // save arguments 38 | 39 | myargc = argc; 40 | myargv = argv; 41 | 42 | M_FindResponseFile(); 43 | 44 | // start doom 45 | printf("Starting D_DoomMain\r\n"); 46 | D_DoomMain (); 47 | 48 | return 0; 49 | } 50 | 51 | -------------------------------------------------------------------------------- /frosted-doom/i_scale.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Pixel-doubling scale up functions. 17 | // 18 | 19 | 20 | #ifndef __I_SCALE__ 21 | #define __I_SCALE__ 22 | 23 | #include "doomtype.h" 24 | 25 | void I_InitScale(byte *_src_buffer, byte *_dest_buffer, int _dest_pitch); 26 | void I_ResetScaleTables(byte *palette); 27 | 28 | // Scaled modes (direct multiples of 320x200) 29 | 30 | extern screen_mode_t mode_scale_1x; 31 | extern screen_mode_t mode_scale_2x; 32 | extern screen_mode_t mode_scale_3x; 33 | extern screen_mode_t mode_scale_4x; 34 | extern screen_mode_t mode_scale_5x; 35 | 36 | // Vertically stretched modes (320x200 -> multiples of 320x240) 37 | 38 | extern screen_mode_t mode_stretch_1x; 39 | extern screen_mode_t mode_stretch_2x; 40 | extern screen_mode_t mode_stretch_3x; 41 | extern screen_mode_t mode_stretch_4x; 42 | extern screen_mode_t mode_stretch_5x; 43 | 44 | // Horizontally squashed modes (320x200 -> multiples of 256x200) 45 | 46 | extern screen_mode_t mode_squash_1x; 47 | extern screen_mode_t mode_squash_2x; 48 | extern screen_mode_t mode_squash_3x; 49 | extern screen_mode_t mode_squash_4x; 50 | extern screen_mode_t mode_squash_5x; 51 | 52 | #endif /* #ifndef __I_SCALE__ */ 53 | 54 | -------------------------------------------------------------------------------- /frosted-doom/i_swap.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Endianess handling, swapping 16bit and 32bit. 17 | // 18 | 19 | 20 | #ifndef __I_SWAP__ 21 | #define __I_SWAP__ 22 | 23 | #ifdef ORIGCODE 24 | #include "SDL_endian.h" 25 | 26 | // Endianess handling. 27 | // WAD files are stored little endian. 28 | 29 | // Just use SDL's endianness swapping functions. 30 | 31 | // These are deliberately cast to signed values; this is the behaviour 32 | // of the macros in the original source and some code relies on it. 33 | 34 | #define SHORT(x) ((signed short) SDL_SwapLE16(x)) 35 | #define LONG(x) ((signed int) SDL_SwapLE32(x)) 36 | 37 | // Defines for checking the endianness of the system. 38 | 39 | #if SDL_BYTEORDER == SYS_LIL_ENDIAN 40 | #define SYS_LITTLE_ENDIAN 41 | #elif SDL_BYTEORDER == SYS_BIG_ENDIAN 42 | #define SYS_BIG_ENDIAN 43 | #endif 44 | 45 | #else 46 | 47 | #define SHORT(x) ((signed short) (x)) 48 | #define LONG(x) ((signed int) (x)) 49 | 50 | #define SYS_LITTLE_ENDIAN 51 | 52 | #endif 53 | #endif 54 | 55 | -------------------------------------------------------------------------------- /frosted-doom/i_system.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // System specific interface stuff. 17 | // 18 | 19 | 20 | #ifndef __I_SYSTEM__ 21 | #define __I_SYSTEM__ 22 | 23 | #include "d_ticcmd.h" 24 | #include "d_event.h" 25 | 26 | 27 | typedef void (*atexit_func_t)(void); 28 | 29 | // Called by DoomMain. 30 | void I_Init (void); 31 | 32 | // Called by startup code 33 | // to get the ammount of memory to malloc 34 | // for the zone management. 35 | byte* I_ZoneBase (int *size); 36 | 37 | boolean I_ConsoleStdout(void); 38 | 39 | 40 | // Asynchronous interrupt functions should maintain private queues 41 | // that are read by the synchronous functions 42 | // to be converted into events. 43 | 44 | // Either returns a null ticcmd, 45 | // or calls a loadable driver to build it. 46 | // This ticcmd will then be modified by the gameloop 47 | // for normal input. 48 | ticcmd_t* I_BaseTiccmd (void); 49 | 50 | 51 | // Called by M_Responder when quit is selected. 52 | // Clean exit, displays sell blurb. 53 | void I_Quit (void); 54 | 55 | void I_Error (char *error, ...); 56 | 57 | void I_Tactile (int on, int off, int total); 58 | 59 | boolean I_GetMemoryValue(unsigned int offset, void *value, int size); 60 | 61 | // Schedule a function to be called when the program exits. 62 | // If run_if_error is true, the function is called if the exit 63 | // is due to an error (I_Error) 64 | 65 | void I_AtExit(atexit_func_t func, boolean run_if_error); 66 | 67 | // Add all system-specific config file variable bindings. 68 | 69 | void I_BindVariables(void); 70 | 71 | // Print startup banner copyright message. 72 | 73 | void I_PrintStartupBanner(char *gamedescription); 74 | 75 | // Print a centered text banner displaying the given string. 76 | 77 | void I_PrintBanner(char *text); 78 | 79 | // Print a dividing line for startup banners. 80 | 81 | void I_PrintDivider(void); 82 | 83 | #endif 84 | 85 | -------------------------------------------------------------------------------- /frosted-doom/i_timer.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Timer functions. 17 | // 18 | 19 | #include "i_timer.h" 20 | #include "doomtype.h" 21 | 22 | #include 23 | #include 24 | #include 25 | 26 | // 27 | // I_GetTime 28 | // returns time in 1/35th second tics 29 | // 30 | 31 | static uint32_t basetime = 0; 32 | 33 | int I_GetTicks(void) 34 | { 35 | struct timeval tp; 36 | struct timezone tzp; 37 | 38 | gettimeofday(&tp, &tzp); 39 | return (tp.tv_sec * 1000) + (tp.tv_usec / 1000); /* return milliseconds */ 40 | } 41 | 42 | int I_GetTime (void) 43 | { 44 | uint32_t ticks; 45 | 46 | ticks = I_GetTicks(); 47 | 48 | if (basetime == 0) 49 | basetime = ticks; 50 | 51 | ticks -= basetime; 52 | 53 | return (ticks * TICRATE) / 1000; 54 | } 55 | 56 | 57 | // 58 | // Same as I_GetTime, but returns time in milliseconds 59 | // 60 | 61 | int I_GetTimeMS(void) 62 | { 63 | uint32_t ticks; 64 | 65 | ticks = I_GetTicks(); 66 | 67 | if (basetime == 0) 68 | basetime = ticks; 69 | 70 | return ticks - basetime; 71 | } 72 | 73 | // Sleep for a specified number of ms 74 | 75 | void I_Sleep(int ms) 76 | { 77 | //SDL_Delay(ms); 78 | usleep (ms * 1000); 79 | } 80 | 81 | void I_WaitVBL(int count) 82 | { 83 | //I_Sleep((count * 1000) / 70); 84 | } 85 | 86 | 87 | void I_InitTimer(void) 88 | { 89 | // initialize timer 90 | 91 | //SDL_Init(SDL_INIT_TIMER); 92 | } 93 | 94 | -------------------------------------------------------------------------------- /frosted-doom/i_timer.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // System-specific timer interface 17 | // 18 | 19 | 20 | #ifndef __I_TIMER__ 21 | #define __I_TIMER__ 22 | 23 | #define TICRATE 35 24 | 25 | // Called by D_DoomLoop, 26 | // returns current time in tics. 27 | int I_GetTime (void); 28 | 29 | // returns current time in ms 30 | int I_GetTimeMS (void); 31 | 32 | // Pause for a specified number of ms 33 | void I_Sleep(int ms); 34 | 35 | // Initialize timer 36 | void I_InitTimer(void); 37 | 38 | // Wait for vertical retrace or pause a bit. 39 | void I_WaitVBL(int count); 40 | 41 | #endif 42 | 43 | -------------------------------------------------------------------------------- /frosted-doom/m_argv.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Nil. 17 | // 18 | 19 | 20 | #ifndef __M_ARGV__ 21 | #define __M_ARGV__ 22 | 23 | #include "doomtype.h" 24 | 25 | // 26 | // MISC 27 | // 28 | extern int myargc; 29 | extern char** myargv; 30 | 31 | // Returns the position of the given parameter 32 | // in the arg list (0 if not found). 33 | int M_CheckParm (char* check); 34 | 35 | // Same as M_CheckParm, but checks that num_args arguments are available 36 | // following the specified argument. 37 | int M_CheckParmWithArgs(char *check, int num_args); 38 | 39 | void M_FindResponseFile(void); 40 | 41 | // Parameter has been specified? 42 | 43 | boolean M_ParmExists(char *check); 44 | 45 | // Get name of executable used to run this program: 46 | 47 | char *M_GetExecutableName(void); 48 | 49 | #endif 50 | -------------------------------------------------------------------------------- /frosted-doom/m_bbox.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Main loop menu stuff. 17 | // Random number LUT. 18 | // Default Config File. 19 | // PCX Screenshots. 20 | // 21 | 22 | 23 | 24 | #include "m_bbox.h" 25 | 26 | 27 | 28 | 29 | void M_ClearBox (fixed_t *box) 30 | { 31 | box[BOXTOP] = box[BOXRIGHT] = INT_MIN; 32 | box[BOXBOTTOM] = box[BOXLEFT] = INT_MAX; 33 | } 34 | 35 | void 36 | M_AddToBox 37 | ( fixed_t* box, 38 | fixed_t x, 39 | fixed_t y ) 40 | { 41 | if (xbox[BOXRIGHT]) 44 | box[BOXRIGHT] = x; 45 | if (ybox[BOXTOP]) 48 | box[BOXTOP] = y; 49 | } 50 | 51 | 52 | 53 | 54 | 55 | -------------------------------------------------------------------------------- /frosted-doom/m_bbox.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Nil. 17 | // 18 | 19 | 20 | #ifndef __M_BBOX__ 21 | #define __M_BBOX__ 22 | 23 | #include 24 | 25 | #include "m_fixed.h" 26 | 27 | 28 | // Bounding box coordinate storage. 29 | enum 30 | { 31 | BOXTOP, 32 | BOXBOTTOM, 33 | BOXLEFT, 34 | BOXRIGHT 35 | }; // bbox coordinates 36 | 37 | // Bounding box functions. 38 | void M_ClearBox (fixed_t* box); 39 | 40 | void 41 | M_AddToBox 42 | ( fixed_t* box, 43 | fixed_t x, 44 | fixed_t y ); 45 | 46 | 47 | #endif 48 | -------------------------------------------------------------------------------- /frosted-doom/m_cheat.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Cheat sequence checking. 17 | // 18 | 19 | 20 | 21 | #include 22 | 23 | #include "doomtype.h" 24 | #include "m_cheat.h" 25 | 26 | // 27 | // CHEAT SEQUENCE PACKAGE 28 | // 29 | 30 | // 31 | // Called in st_stuff module, which handles the input. 32 | // Returns a 1 if the cheat was successful, 0 if failed. 33 | // 34 | int 35 | cht_CheckCheat 36 | ( cheatseq_t* cht, 37 | char key ) 38 | { 39 | // if we make a short sequence on a cheat with parameters, this 40 | // will not work in vanilla doom. behave the same. 41 | 42 | if (cht->parameter_chars > 0 && strlen(cht->sequence) < cht->sequence_len) 43 | return false; 44 | 45 | if (cht->chars_read < strlen(cht->sequence)) 46 | { 47 | // still reading characters from the cheat code 48 | // and verifying. reset back to the beginning 49 | // if a key is wrong 50 | 51 | if (key == cht->sequence[cht->chars_read]) 52 | ++cht->chars_read; 53 | else 54 | cht->chars_read = 0; 55 | 56 | cht->param_chars_read = 0; 57 | } 58 | else if (cht->param_chars_read < cht->parameter_chars) 59 | { 60 | // we have passed the end of the cheat sequence and are 61 | // entering parameters now 62 | 63 | cht->parameter_buf[cht->param_chars_read] = key; 64 | 65 | ++cht->param_chars_read; 66 | } 67 | 68 | if (cht->chars_read >= strlen(cht->sequence) 69 | && cht->param_chars_read >= cht->parameter_chars) 70 | { 71 | cht->chars_read = cht->param_chars_read = 0; 72 | 73 | return true; 74 | } 75 | 76 | // cheat not matched yet 77 | 78 | return false; 79 | } 80 | 81 | void 82 | cht_GetParam 83 | ( cheatseq_t* cht, 84 | char* buffer ) 85 | { 86 | memcpy(buffer, cht->parameter_buf, cht->parameter_chars); 87 | } 88 | 89 | 90 | -------------------------------------------------------------------------------- /frosted-doom/m_cheat.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Cheat code checking. 17 | // 18 | 19 | 20 | #ifndef __M_CHEAT__ 21 | #define __M_CHEAT__ 22 | 23 | // 24 | // CHEAT SEQUENCE PACKAGE 25 | // 26 | 27 | // declaring a cheat 28 | 29 | #define CHEAT(value, parameters) \ 30 | { value, sizeof(value) - 1, parameters, 0, 0, "" } 31 | 32 | #define MAX_CHEAT_LEN 25 33 | #define MAX_CHEAT_PARAMS 5 34 | 35 | typedef struct 36 | { 37 | // settings for this cheat 38 | 39 | char sequence[MAX_CHEAT_LEN]; 40 | size_t sequence_len; 41 | int parameter_chars; 42 | 43 | // state used during the game 44 | 45 | size_t chars_read; 46 | int param_chars_read; 47 | char parameter_buf[MAX_CHEAT_PARAMS]; 48 | } cheatseq_t; 49 | 50 | int 51 | cht_CheckCheat 52 | ( cheatseq_t* cht, 53 | char key ); 54 | 55 | 56 | void 57 | cht_GetParam 58 | ( cheatseq_t* cht, 59 | char* buffer ); 60 | 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /frosted-doom/m_config.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Configuration file interface. 17 | // 18 | 19 | 20 | #ifndef __M_CONFIG__ 21 | #define __M_CONFIG__ 22 | 23 | #include "doomtype.h" 24 | 25 | void M_LoadDefaults(void); 26 | void M_SaveDefaults(void); 27 | void M_SaveDefaultsAlternate(char *main, char *extra); 28 | void M_SetConfigDir(char *dir); 29 | void M_BindVariable(char *name, void *variable); 30 | boolean M_SetVariable(char *name, char *value); 31 | int M_GetIntVariable(char *name); 32 | const char *M_GetStrVariable(char *name); 33 | float M_GetFloatVariable(char *name); 34 | void M_SetConfigFilenames(char *main_config, char *extra_config); 35 | char *M_GetSaveGameDir(char *iwadname); 36 | 37 | extern char *configdir; 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /frosted-doom/m_fixed.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Fixed point implementation. 17 | // 18 | 19 | 20 | 21 | #include "stdlib.h" 22 | 23 | #include "doomtype.h" 24 | #include "i_system.h" 25 | 26 | #include "m_fixed.h" 27 | 28 | 29 | 30 | 31 | // Fixme. __USE_C_FIXED__ or something. 32 | 33 | fixed_t 34 | FixedMul 35 | ( fixed_t a, 36 | fixed_t b ) 37 | { 38 | return ((int64_t) a * (int64_t) b) >> FRACBITS; 39 | } 40 | 41 | 42 | 43 | // 44 | // FixedDiv, C version. 45 | // 46 | 47 | fixed_t FixedDiv(fixed_t a, fixed_t b) 48 | { 49 | if ((abs(a) >> 14) >= abs(b)) 50 | { 51 | return (a^b) < 0 ? INT_MIN : INT_MAX; 52 | } 53 | else 54 | { 55 | int64_t result; 56 | 57 | result = ((int64_t) a << 16) / b; 58 | 59 | return (fixed_t) result; 60 | } 61 | } 62 | 63 | -------------------------------------------------------------------------------- /frosted-doom/m_fixed.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Fixed point arithemtics, implementation. 17 | // 18 | 19 | 20 | #ifndef __M_FIXED__ 21 | #define __M_FIXED__ 22 | 23 | 24 | 25 | 26 | // 27 | // Fixed point, 32bit as 16.16. 28 | // 29 | #define FRACBITS 16 30 | #define FRACUNIT (1< 24 | #include 25 | 26 | #include "doomtype.h" 27 | 28 | boolean M_WriteFile(char *name, void *source, int length); 29 | int M_ReadFile(char *name, byte **buffer); 30 | void M_MakeDirectory(char *dir); 31 | char *M_TempFile(char *s); 32 | boolean M_FileExists(char *file); 33 | long M_FileLength(FILE *handle); 34 | boolean M_StrToInt(const char *str, int *result); 35 | void M_ExtractFileBase(char *path, char *dest); 36 | void M_ForceUppercase(char *text); 37 | char *M_StrCaseStr(char *haystack, char *needle); 38 | char *M_StringDuplicate(const char *orig); 39 | boolean M_StringCopy(char *dest, const char *src, size_t dest_size); 40 | boolean M_StringConcat(char *dest, const char *src, size_t dest_size); 41 | char *M_StringReplace(const char *haystack, const char *needle, 42 | const char *replacement); 43 | char *M_StringJoin(const char *s, ...); 44 | boolean M_StringStartsWith(const char *s, const char *prefix); 45 | boolean M_StringEndsWith(const char *s, const char *suffix); 46 | int M_vsnprintf(char *buf, size_t buf_len, const char *s, va_list args); 47 | int M_snprintf(char *buf, size_t buf_len, const char *s, ...); 48 | char *M_OEMToUTF8(const char *ansi); 49 | 50 | #endif 51 | 52 | -------------------------------------------------------------------------------- /frosted-doom/m_random.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Random number LUT. 17 | // 18 | 19 | // 20 | // M_Random 21 | // Returns a 0-255 number 22 | // 23 | 24 | static const unsigned char rndtable[256] = { 25 | 0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66 , 26 | 74, 21, 211, 47, 80, 242, 154, 27, 205, 128, 161, 89, 77, 36 , 27 | 95, 110, 85, 48, 212, 140, 211, 249, 22, 79, 200, 50, 28, 188 , 28 | 52, 140, 202, 120, 68, 145, 62, 70, 184, 190, 91, 197, 152, 224 , 29 | 149, 104, 25, 178, 252, 182, 202, 182, 141, 197, 4, 81, 181, 242 , 30 | 145, 42, 39, 227, 156, 198, 225, 193, 219, 93, 122, 175, 249, 0 , 31 | 175, 143, 70, 239, 46, 246, 163, 53, 163, 109, 168, 135, 2, 235 , 32 | 25, 92, 20, 145, 138, 77, 69, 166, 78, 176, 173, 212, 166, 113 , 33 | 94, 161, 41, 50, 239, 49, 111, 164, 70, 60, 2, 37, 171, 75 , 34 | 136, 156, 11, 56, 42, 146, 138, 229, 73, 146, 77, 61, 98, 196 , 35 | 135, 106, 63, 197, 195, 86, 96, 203, 113, 101, 170, 247, 181, 113 , 36 | 80, 250, 108, 7, 255, 237, 129, 226, 79, 107, 112, 166, 103, 241 , 37 | 24, 223, 239, 120, 198, 58, 60, 82, 128, 3, 184, 66, 143, 224 , 38 | 145, 224, 81, 206, 163, 45, 63, 90, 168, 114, 59, 33, 159, 95 , 39 | 28, 139, 123, 98, 125, 196, 15, 70, 194, 253, 54, 14, 109, 226 , 40 | 71, 17, 161, 93, 186, 87, 244, 138, 20, 52, 123, 251, 26, 36 , 41 | 17, 46, 52, 231, 232, 76, 31, 221, 84, 37, 216, 165, 212, 106 , 42 | 197, 242, 98, 43, 39, 175, 254, 145, 190, 84, 118, 222, 187, 136 , 43 | 120, 163, 236, 249 44 | }; 45 | 46 | int rndindex = 0; 47 | int prndindex = 0; 48 | 49 | // Which one is deterministic? 50 | int P_Random (void) 51 | { 52 | prndindex = (prndindex+1)&0xff; 53 | return rndtable[prndindex]; 54 | } 55 | 56 | int M_Random (void) 57 | { 58 | rndindex = (rndindex+1)&0xff; 59 | return rndtable[rndindex]; 60 | } 61 | 62 | void M_ClearRandom (void) 63 | { 64 | rndindex = prndindex = 0; 65 | } 66 | -------------------------------------------------------------------------------- /frosted-doom/m_random.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // 17 | // 18 | 19 | 20 | #ifndef __M_RANDOM__ 21 | #define __M_RANDOM__ 22 | 23 | 24 | #include "doomtype.h" 25 | 26 | 27 | 28 | // Returns a number from 0 to 255, 29 | // from a lookup table. 30 | int M_Random (void); 31 | 32 | // As M_Random, but used only by the play simulation. 33 | int P_Random (void); 34 | 35 | // Fix randoms for demos. 36 | void M_ClearRandom (void); 37 | 38 | 39 | #endif 40 | -------------------------------------------------------------------------------- /frosted-doom/memio.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | 16 | #ifndef MEMIO_H 17 | #define MEMIO_H 18 | 19 | typedef struct _MEMFILE MEMFILE; 20 | 21 | typedef enum 22 | { 23 | MEM_SEEK_SET, 24 | MEM_SEEK_CUR, 25 | MEM_SEEK_END, 26 | } mem_rel_t; 27 | 28 | MEMFILE *mem_fopen_read(void *buf, size_t buflen); 29 | size_t mem_fread(void *buf, size_t size, size_t nmemb, MEMFILE *stream); 30 | MEMFILE *mem_fopen_write(void); 31 | size_t mem_fwrite(const void *ptr, size_t size, size_t nmemb, MEMFILE *stream); 32 | void mem_get_buf(MEMFILE *stream, void **buf, size_t *buflen); 33 | void mem_fclose(MEMFILE *stream); 34 | long mem_ftell(MEMFILE *stream); 35 | int mem_fseek(MEMFILE *stream, signed long offset, mem_rel_t whence); 36 | 37 | #endif /* #ifndef MEMIO_H */ 38 | 39 | -------------------------------------------------------------------------------- /frosted-doom/net_client.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // Network client code 15 | // 16 | 17 | #ifndef NET_CLIENT_H 18 | #define NET_CLIENT_H 19 | 20 | #include "doomtype.h" 21 | #include "d_ticcmd.h" 22 | #include "sha1.h" 23 | #include "net_defs.h" 24 | 25 | boolean NET_CL_Connect(net_addr_t *addr, net_connect_data_t *data); 26 | void NET_CL_Disconnect(void); 27 | void NET_CL_Run(void); 28 | void NET_CL_Init(void); 29 | void NET_CL_LaunchGame(void); 30 | void NET_CL_StartGame(net_gamesettings_t *settings); 31 | void NET_CL_SendTiccmd(ticcmd_t *ticcmd, int maketic); 32 | boolean NET_CL_GetSettings(net_gamesettings_t *_settings); 33 | void NET_Init(void); 34 | 35 | void NET_BindVariables(void); 36 | 37 | extern boolean net_client_connected; 38 | extern boolean net_client_received_wait_data; 39 | extern net_waitdata_t net_client_wait_data; 40 | extern boolean net_waiting_for_launch; 41 | extern char *net_player_name; 42 | 43 | extern sha1_digest_t net_server_wad_sha1sum; 44 | extern sha1_digest_t net_server_deh_sha1sum; 45 | extern unsigned int net_server_is_freedoom; 46 | extern sha1_digest_t net_local_wad_sha1sum; 47 | extern sha1_digest_t net_local_deh_sha1sum; 48 | extern unsigned int net_local_is_freedoom; 49 | 50 | extern boolean drone; 51 | 52 | #endif /* #ifndef NET_CLIENT_H */ 53 | -------------------------------------------------------------------------------- /frosted-doom/net_dedicated.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // 15 | // Dedicated server code. 16 | // 17 | 18 | #ifndef NET_DEDICATED_H 19 | #define NET_DEDICATED_H 20 | 21 | void NET_DedicatedServer(void); 22 | 23 | #endif /* #ifndef NET_DEDICATED_H */ 24 | 25 | 26 | -------------------------------------------------------------------------------- /frosted-doom/net_gui.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // Graphical stuff related to the networking code: 15 | // 16 | // * The client waiting screen when we are waiting for the server to 17 | // start the game. 18 | // 19 | 20 | 21 | #ifndef NET_GUI_H 22 | #define NET_GUI_H 23 | 24 | #include "doomtype.h" 25 | 26 | extern void NET_WaitForLaunch(void); 27 | 28 | #endif /* #ifndef NET_GUI_H */ 29 | 30 | -------------------------------------------------------------------------------- /frosted-doom/net_io.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Network packet manipulation (net_packet_t) 16 | // 17 | 18 | #ifndef NET_IO_H 19 | #define NET_IO_H 20 | 21 | #include "net_defs.h" 22 | 23 | extern net_addr_t net_broadcast_addr; 24 | 25 | net_context_t *NET_NewContext(void); 26 | void NET_AddModule(net_context_t *context, net_module_t *module); 27 | void NET_SendPacket(net_addr_t *addr, net_packet_t *packet); 28 | void NET_SendBroadcast(net_context_t *context, net_packet_t *packet); 29 | boolean NET_RecvPacket(net_context_t *context, net_addr_t **addr, 30 | net_packet_t **packet); 31 | char *NET_AddrToString(net_addr_t *addr); 32 | void NET_FreeAddress(net_addr_t *addr); 33 | net_addr_t *NET_ResolveAddress(net_context_t *context, char *address); 34 | 35 | #endif /* #ifndef NET_IO_H */ 36 | 37 | -------------------------------------------------------------------------------- /frosted-doom/net_loop.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Loopback network module for server compiled into the client 16 | // 17 | 18 | #ifndef NET_LOOP_H 19 | #define NET_LOOP_H 20 | 21 | #include "net_defs.h" 22 | 23 | extern net_module_t net_loop_client_module; 24 | extern net_module_t net_loop_server_module; 25 | 26 | #endif /* #ifndef NET_LOOP_H */ 27 | 28 | -------------------------------------------------------------------------------- /frosted-doom/net_packet.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Definitions for use in networking code. 16 | // 17 | 18 | #ifndef NET_PACKET_H 19 | #define NET_PACKET_H 20 | 21 | #include "net_defs.h" 22 | 23 | net_packet_t *NET_NewPacket(int initial_size); 24 | net_packet_t *NET_PacketDup(net_packet_t *packet); 25 | void NET_FreePacket(net_packet_t *packet); 26 | 27 | boolean NET_ReadInt8(net_packet_t *packet, unsigned int *data); 28 | boolean NET_ReadInt16(net_packet_t *packet, unsigned int *data); 29 | boolean NET_ReadInt32(net_packet_t *packet, unsigned int *data); 30 | 31 | boolean NET_ReadSInt8(net_packet_t *packet, signed int *data); 32 | boolean NET_ReadSInt16(net_packet_t *packet, signed int *data); 33 | boolean NET_ReadSInt32(net_packet_t *packet, signed int *data); 34 | 35 | char *NET_ReadString(net_packet_t *packet); 36 | 37 | void NET_WriteInt8(net_packet_t *packet, unsigned int i); 38 | void NET_WriteInt16(net_packet_t *packet, unsigned int i); 39 | void NET_WriteInt32(net_packet_t *packet, unsigned int i); 40 | 41 | void NET_WriteString(net_packet_t *packet, char *string); 42 | 43 | #endif /* #ifndef NET_PACKET_H */ 44 | 45 | -------------------------------------------------------------------------------- /frosted-doom/net_query.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Querying servers to find their current status. 16 | // 17 | 18 | #ifndef NET_QUERY_H 19 | #define NET_QUERY_H 20 | 21 | #include "net_defs.h" 22 | 23 | typedef void (*net_query_callback_t)(net_addr_t *addr, 24 | net_querydata_t *querydata, 25 | unsigned int ping_time, 26 | void *user_data); 27 | 28 | extern int NET_StartLANQuery(void); 29 | extern int NET_StartMasterQuery(void); 30 | 31 | extern void NET_LANQuery(void); 32 | extern void NET_MasterQuery(void); 33 | extern void NET_QueryAddress(char *addr); 34 | extern net_addr_t *NET_FindLANServer(void); 35 | 36 | extern int NET_Query_Poll(net_query_callback_t callback, void *user_data); 37 | 38 | extern net_addr_t *NET_Query_ResolveMaster(net_context_t *context); 39 | extern void NET_Query_AddToMaster(net_addr_t *master_addr); 40 | extern boolean NET_Query_CheckAddedToMaster(boolean *result); 41 | extern void NET_Query_MasterResponse(net_packet_t *packet); 42 | 43 | #endif /* #ifndef NET_QUERY_H */ 44 | 45 | -------------------------------------------------------------------------------- /frosted-doom/net_sdl.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Networking module which uses SDL_net 16 | // 17 | 18 | #ifndef NET_SDL_H 19 | #define NET_SDL_H 20 | 21 | #include "net_defs.h" 22 | 23 | extern net_module_t net_sdl_module; 24 | 25 | #endif /* #ifndef NET_SDL_H */ 26 | 27 | -------------------------------------------------------------------------------- /frosted-doom/net_server.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // Network server code 15 | // 16 | 17 | #ifndef NET_SERVER_H 18 | #define NET_SERVER_H 19 | 20 | // initialize server and wait for connections 21 | 22 | void NET_SV_Init(void); 23 | 24 | // run server: check for new packets received etc. 25 | 26 | void NET_SV_Run(void); 27 | 28 | // Shut down the server 29 | // Blocks until all clients disconnect, or until a 5 second timeout 30 | 31 | void NET_SV_Shutdown(void); 32 | 33 | // Add a network module to the context used by the server 34 | 35 | void NET_SV_AddModule(net_module_t *module); 36 | 37 | // Register server with master server. 38 | 39 | void NET_SV_RegisterWithMaster(void); 40 | 41 | #endif /* #ifndef NET_SERVER_H */ 42 | 43 | -------------------------------------------------------------------------------- /frosted-doom/p_inter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // 17 | // 18 | 19 | 20 | #ifndef __P_INTER__ 21 | #define __P_INTER__ 22 | 23 | 24 | 25 | 26 | boolean P_GivePower(player_t*, int); 27 | 28 | 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /frosted-doom/p_pspr.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Sprite animation. 17 | // 18 | 19 | 20 | #ifndef __P_PSPR__ 21 | #define __P_PSPR__ 22 | 23 | // Basic data types. 24 | // Needs fixed point, and BAM angles. 25 | #include "m_fixed.h" 26 | #include "tables.h" 27 | 28 | 29 | // 30 | // Needs to include the precompiled 31 | // sprite animation tables. 32 | // Header generated by multigen utility. 33 | // This includes all the data for thing animation, 34 | // i.e. the Thing Atrributes table 35 | // and the Frame Sequence table. 36 | #include "info.h" 37 | 38 | 39 | 40 | // 41 | // Frame flags: 42 | // handles maximum brightness (torches, muzzle flare, light sources) 43 | // 44 | #define FF_FULLBRIGHT 0x8000 // flag in thing->frame 45 | #define FF_FRAMEMASK 0x7fff 46 | 47 | 48 | 49 | // 50 | // Overlay psprites are scaled shapes 51 | // drawn directly on the view screen, 52 | // coordinates are given for a 320*200 view screen. 53 | // 54 | typedef enum 55 | { 56 | ps_weapon, 57 | ps_flash, 58 | NUMPSPRITES 59 | 60 | } psprnum_t; 61 | 62 | typedef struct 63 | { 64 | state_t* state; // a NULL state means not active 65 | int tics; 66 | fixed_t sx; 67 | fixed_t sy; 68 | 69 | } pspdef_t; 70 | 71 | #endif 72 | -------------------------------------------------------------------------------- /frosted-doom/p_saveg.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Savegame I/O, archiving, persistence. 17 | // 18 | 19 | 20 | #ifndef __P_SAVEG__ 21 | #define __P_SAVEG__ 22 | 23 | #include 24 | 25 | // maximum size of a savegame description 26 | 27 | #define SAVESTRINGSIZE 24 28 | 29 | // temporary filename to use while saving. 30 | 31 | char *P_TempSaveGameFile(void); 32 | 33 | // filename to use for a savegame slot 34 | 35 | char *P_SaveGameFile(int slot); 36 | 37 | // Savegame file header read/write functions 38 | 39 | boolean P_ReadSaveGameHeader(void); 40 | void P_WriteSaveGameHeader(char *description); 41 | 42 | // Savegame end-of-file read/write functions 43 | 44 | boolean P_ReadSaveGameEOF(void); 45 | void P_WriteSaveGameEOF(void); 46 | 47 | // Persistent storage/archiving. 48 | // These are the load / save game routines. 49 | void P_ArchivePlayers (void); 50 | void P_UnArchivePlayers (void); 51 | void P_ArchiveWorld (void); 52 | void P_UnArchiveWorld (void); 53 | void P_ArchiveThinkers (void); 54 | void P_UnArchiveThinkers (void); 55 | void P_ArchiveSpecials (void); 56 | void P_UnArchiveSpecials (void); 57 | 58 | extern FILE *save_stream; 59 | extern boolean savegame_error; 60 | 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /frosted-doom/p_setup.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Setup a game, startup stuff. 17 | // 18 | 19 | 20 | #ifndef __P_SETUP__ 21 | #define __P_SETUP__ 22 | 23 | 24 | 25 | 26 | // NOT called by W_Ticker. Fixme. 27 | void 28 | P_SetupLevel 29 | ( int episode, 30 | int map, 31 | int playermask, 32 | skill_t skill); 33 | 34 | // Called by startup code. 35 | void P_Init (void); 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /frosted-doom/p_telept.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Teleportation. 17 | // 18 | 19 | 20 | 21 | 22 | #include "doomdef.h" 23 | #include "doomstat.h" 24 | 25 | #include "s_sound.h" 26 | 27 | #include "p_local.h" 28 | 29 | 30 | // Data. 31 | #include "sounds.h" 32 | 33 | // State. 34 | #include "r_state.h" 35 | 36 | 37 | 38 | // 39 | // TELEPORTATION 40 | // 41 | int 42 | EV_Teleport 43 | ( line_t* line, 44 | int side, 45 | mobj_t* thing ) 46 | { 47 | int i; 48 | int tag; 49 | mobj_t* m; 50 | mobj_t* fog; 51 | unsigned an; 52 | thinker_t* thinker; 53 | sector_t* sector; 54 | fixed_t oldx; 55 | fixed_t oldy; 56 | fixed_t oldz; 57 | 58 | // don't teleport missiles 59 | if (thing->flags & MF_MISSILE) 60 | return 0; 61 | 62 | // Don't teleport if hit back of line, 63 | // so you can get out of teleporter. 64 | if (side == 1) 65 | return 0; 66 | 67 | 68 | tag = line->tag; 69 | for (i = 0; i < numsectors; i++) 70 | { 71 | if (sectors[ i ].tag == tag ) 72 | { 73 | thinker = thinkercap.next; 74 | for (thinker = thinkercap.next; 75 | thinker != &thinkercap; 76 | thinker = thinker->next) 77 | { 78 | // not a mobj 79 | if (thinker->function.acp1 != (actionf_p1)P_MobjThinker) 80 | continue; 81 | 82 | m = (mobj_t *)thinker; 83 | 84 | // not a teleportman 85 | if (m->type != MT_TELEPORTMAN ) 86 | continue; 87 | 88 | sector = m->subsector->sector; 89 | // wrong sector 90 | if (sector-sectors != i ) 91 | continue; 92 | 93 | oldx = thing->x; 94 | oldy = thing->y; 95 | oldz = thing->z; 96 | 97 | if (!P_TeleportMove (thing, m->x, m->y)) 98 | return 0; 99 | 100 | // The first Final Doom executable does not set thing->z 101 | // when teleporting. This quirk is unique to this 102 | // particular version; the later version included in 103 | // some versions of the Id Anthology fixed this. 104 | 105 | if (gameversion != exe_final) 106 | thing->z = thing->floorz; 107 | 108 | if (thing->player) 109 | thing->player->viewz = thing->z+thing->player->viewheight; 110 | 111 | // spawn teleport fog at source and destination 112 | fog = P_SpawnMobj (oldx, oldy, oldz, MT_TFOG); 113 | S_StartSound (fog, sfx_telept); 114 | an = m->angle >> ANGLETOFINESHIFT; 115 | fog = P_SpawnMobj (m->x+20*finecosine[an], m->y+20*finesine[an] 116 | , thing->z, MT_TFOG); 117 | 118 | // emit sound, where? 119 | S_StartSound (fog, sfx_telept); 120 | 121 | // don't move for a bit 122 | if (thing->player) 123 | thing->reactiontime = 18; 124 | 125 | thing->angle = m->angle; 126 | thing->momx = thing->momy = thing->momz = 0; 127 | return 1; 128 | } 129 | } 130 | } 131 | return 0; 132 | } 133 | 134 | -------------------------------------------------------------------------------- /frosted-doom/p_tick.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Archiving: SaveGame I/O. 17 | // Thinker, Ticker. 18 | // 19 | 20 | 21 | #include "z_zone.h" 22 | #include "p_local.h" 23 | 24 | #include "doomstat.h" 25 | 26 | 27 | int leveltime; 28 | 29 | // 30 | // THINKERS 31 | // All thinkers should be allocated by Z_Malloc 32 | // so they can be operated on uniformly. 33 | // The actual structures will vary in size, 34 | // but the first element must be thinker_t. 35 | // 36 | 37 | 38 | 39 | // Both the head and tail of the thinker list. 40 | thinker_t thinkercap; 41 | 42 | 43 | // 44 | // P_InitThinkers 45 | // 46 | void P_InitThinkers (void) 47 | { 48 | thinkercap.prev = thinkercap.next = &thinkercap; 49 | } 50 | 51 | 52 | 53 | 54 | // 55 | // P_AddThinker 56 | // Adds a new thinker at the end of the list. 57 | // 58 | void P_AddThinker (thinker_t* thinker) 59 | { 60 | thinkercap.prev->next = thinker; 61 | thinker->next = &thinkercap; 62 | thinker->prev = thinkercap.prev; 63 | thinkercap.prev = thinker; 64 | } 65 | 66 | 67 | 68 | // 69 | // P_RemoveThinker 70 | // Deallocation is lazy -- it will not actually be freed 71 | // until its thinking turn comes up. 72 | // 73 | void P_RemoveThinker (thinker_t* thinker) 74 | { 75 | // FIXME: NOP. 76 | thinker->function.acv = (actionf_v)(-1); 77 | } 78 | 79 | 80 | 81 | // 82 | // P_AllocateThinker 83 | // Allocates memory and adds a new thinker at the end of the list. 84 | // 85 | void P_AllocateThinker (thinker_t* thinker) 86 | { 87 | } 88 | 89 | 90 | 91 | // 92 | // P_RunThinkers 93 | // 94 | void P_RunThinkers (void) 95 | { 96 | thinker_t* currentthinker; 97 | 98 | currentthinker = thinkercap.next; 99 | while (currentthinker != &thinkercap) 100 | { 101 | if ( currentthinker->function.acv == (actionf_v)(-1) ) 102 | { 103 | // time to remove it 104 | currentthinker->next->prev = currentthinker->prev; 105 | currentthinker->prev->next = currentthinker->next; 106 | Z_Free (currentthinker); 107 | } 108 | else 109 | { 110 | if (currentthinker->function.acp1) 111 | currentthinker->function.acp1 (currentthinker); 112 | } 113 | currentthinker = currentthinker->next; 114 | } 115 | } 116 | 117 | 118 | 119 | // 120 | // P_Ticker 121 | // 122 | 123 | void P_Ticker (void) 124 | { 125 | int i; 126 | 127 | // run the tic 128 | if (paused) 129 | return; 130 | 131 | // pause if in menu and at least one tic has been run 132 | if ( !netgame 133 | && menuactive 134 | && !demoplayback 135 | && players[consoleplayer].viewz != 1) 136 | { 137 | return; 138 | } 139 | 140 | 141 | for (i=0 ; i 51 | // using from sounds.h 52 | // 53 | 54 | void S_StartSound(void *origin, int sound_id); 55 | 56 | // Stop sound for thing at 57 | void S_StopSound(mobj_t *origin); 58 | 59 | 60 | // Start music using from sounds.h 61 | void S_StartMusic(int music_id); 62 | 63 | // Start music using from sounds.h, 64 | // and set whether looping 65 | void S_ChangeMusic(int music_id, int looping); 66 | 67 | // query if music is playing 68 | boolean S_MusicPlaying(void); 69 | 70 | // Stops the music fer sure. 71 | void S_StopMusic(void); 72 | 73 | // Stop and resume music, during game PAUSE. 74 | void S_PauseSound(void); 75 | void S_ResumeSound(void); 76 | 77 | 78 | // 79 | // Updates music & sounds 80 | // 81 | void S_UpdateSounds(mobj_t *listener); 82 | 83 | void S_SetMusicVolume(int volume); 84 | void S_SetSfxVolume(int volume); 85 | 86 | extern int snd_channels; 87 | 88 | #endif 89 | 90 | -------------------------------------------------------------------------------- /frosted-doom/sha1.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // SHA-1 digest. 16 | // 17 | 18 | #ifndef __SHA1_H__ 19 | #define __SHA1_H__ 20 | 21 | #include "doomtype.h" 22 | 23 | typedef struct sha1_context_s sha1_context_t; 24 | typedef byte sha1_digest_t[20]; 25 | 26 | struct sha1_context_s { 27 | uint32_t h0,h1,h2,h3,h4; 28 | uint32_t nblocks; 29 | byte buf[64]; 30 | int count; 31 | }; 32 | 33 | void SHA1_Init(sha1_context_t *context); 34 | void SHA1_Update(sha1_context_t *context, byte *buf, size_t len); 35 | void SHA1_Final(sha1_digest_t digest, sha1_context_t *context); 36 | void SHA1_UpdateInt32(sha1_context_t *context, unsigned int val); 37 | void SHA1_UpdateString(sha1_context_t *context, char *str); 38 | 39 | #endif /* #ifndef __SHA1_H__ */ 40 | 41 | -------------------------------------------------------------------------------- /frosted-doom/st_stuff.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Status bar code. 17 | // Does the face/direction indicator animatin. 18 | // Does palette indicators as well (red pain/berserk, bright pickup) 19 | // 20 | 21 | #ifndef __STSTUFF_H__ 22 | #define __STSTUFF_H__ 23 | 24 | #include "doomtype.h" 25 | #include "d_event.h" 26 | #include "m_cheat.h" 27 | 28 | // Size of statusbar. 29 | // Now sensitive for scaling. 30 | #define ST_HEIGHT 32 31 | #define ST_WIDTH SCREENWIDTH 32 | #define ST_Y (SCREENHEIGHT - ST_HEIGHT) 33 | 34 | 35 | // 36 | // STATUS BAR 37 | // 38 | 39 | // Called by main loop. 40 | boolean ST_Responder (event_t* ev); 41 | 42 | // Called by main loop. 43 | void ST_Ticker (void); 44 | 45 | // Called by main loop. 46 | void ST_Drawer (boolean fullscreen, boolean refresh); 47 | 48 | // Called when the console player is spawned on each level. 49 | void ST_Start (void); 50 | 51 | // Called by startup code. 52 | void ST_Init (void); 53 | 54 | 55 | 56 | // States for status bar code. 57 | typedef enum 58 | { 59 | AutomapState, 60 | FirstPersonState 61 | 62 | } st_stateenum_t; 63 | 64 | 65 | // States for the chat code. 66 | typedef enum 67 | { 68 | StartChatState, 69 | WaitDestState, 70 | GetChatState 71 | 72 | } st_chatstateenum_t; 73 | 74 | 75 | 76 | extern byte *st_backing_screen; 77 | extern cheatseq_t cheat_mus; 78 | extern cheatseq_t cheat_god; 79 | extern cheatseq_t cheat_ammo; 80 | extern cheatseq_t cheat_ammonokey; 81 | extern cheatseq_t cheat_noclip; 82 | extern cheatseq_t cheat_commercial_noclip; 83 | extern cheatseq_t cheat_powerup[7]; 84 | extern cheatseq_t cheat_choppers; 85 | extern cheatseq_t cheat_clev; 86 | extern cheatseq_t cheat_mypos; 87 | 88 | 89 | #endif 90 | -------------------------------------------------------------------------------- /frosted-doom/statdump.h: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | Copyright(C) 2005-2014 Simon Howard 4 | 5 | This program is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU General Public License 7 | as published by the Free Software Foundation; either version 2 8 | of the License, or (at your option) any later version. 9 | 10 | This program is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | GNU General Public License for more details. 14 | 15 | */ 16 | 17 | #ifndef DOOM_STATDUMP_H 18 | #define DOOM_STATDUMP_H 19 | 20 | void StatCopy(wbstartstruct_t *stats); 21 | void StatDump(void); 22 | 23 | #endif /* #ifndef DOOM_STATDUMP_H */ 24 | -------------------------------------------------------------------------------- /frosted-doom/stubs.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | //XXX FIXME 8 | in_addr_t inet_addr(const char *cp) 9 | { 10 | return (in_addr_t)NULL; 11 | } 12 | 13 | -------------------------------------------------------------------------------- /frosted-doom/tables.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 1993-2008 Raven Software 4 | // Copyright(C) 2005-2014 Simon Howard 5 | // 6 | // This program is free software; you can redistribute it and/or 7 | // modify it under the terms of the GNU General Public License 8 | // as published by the Free Software Foundation; either version 2 9 | // of the License, or (at your option) any later version. 10 | // 11 | // This program is distributed in the hope that it will be useful, 12 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 | // GNU General Public License for more details. 15 | // 16 | // DESCRIPTION: 17 | // Lookup tables. 18 | // Do not try to look them up :-). 19 | // In the order of appearance: 20 | // 21 | // int finetangent[4096] - Tangens LUT. 22 | // Should work with BAM fairly well (12 of 16bit, 23 | // effectively, by shifting). 24 | // 25 | // int finesine[10240] - Sine lookup. 26 | // Guess what, serves as cosine, too. 27 | // Remarkable thing is, how to use BAMs with this? 28 | // 29 | // int tantoangle[2049] - ArcTan LUT, 30 | // maps tan(angle) to angle fast. Gotta search. 31 | // 32 | 33 | 34 | #ifndef __TABLES__ 35 | #define __TABLES__ 36 | 37 | #include "doomtype.h" 38 | 39 | #include "m_fixed.h" 40 | 41 | #define FINEANGLES 8192 42 | #define FINEMASK (FINEANGLES-1) 43 | 44 | 45 | // 0x100000000 to 0x2000 46 | #define ANGLETOFINESHIFT 19 47 | 48 | // Effective size is 10240. 49 | extern const fixed_t finesine[5*FINEANGLES/4]; 50 | 51 | // Re-use data, is just PI/2 pahse shift. 52 | extern const fixed_t *finecosine; 53 | 54 | 55 | // Effective size is 4096. 56 | extern const fixed_t finetangent[FINEANGLES/2]; 57 | 58 | // Gamma correction tables. 59 | extern const byte gammatable[5][256]; 60 | 61 | // Binary Angle Measument, BAM. 62 | 63 | #define ANG45 0x20000000 64 | #define ANG90 0x40000000 65 | #define ANG180 0x80000000 66 | #define ANG270 0xc0000000 67 | #define ANG_MAX 0xffffffff 68 | 69 | #define ANG1 (ANG45 / 45) 70 | #define ANG60 (ANG180 / 3) 71 | 72 | // Heretic code uses this definition as though it represents one 73 | // degree, but it is not! This is actually ~1.40 degrees. 74 | 75 | #define ANG1_X 0x01000000 76 | 77 | #define SLOPERANGE 2048 78 | #define SLOPEBITS 11 79 | #define DBITS (FRACBITS-SLOPEBITS) 80 | 81 | typedef unsigned angle_t; 82 | 83 | 84 | // Effective size is 2049; 85 | // The +1 size is to handle the case when x==y 86 | // without additional checking. 87 | extern const angle_t tantoangle[SLOPERANGE+1]; 88 | 89 | 90 | // Utility function, 91 | // called by R_PointToAngle. 92 | int SlopeDiv(unsigned int num, unsigned int den); 93 | 94 | 95 | #endif 96 | 97 | -------------------------------------------------------------------------------- /frosted-doom/v_patch.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Refresh/rendering module, shared data struct definitions. 17 | // 18 | 19 | 20 | #ifndef V_PATCH_H 21 | #define V_PATCH_H 22 | 23 | // Patches. 24 | // A patch holds one or more columns. 25 | // Patches are used for sprites and all masked pictures, 26 | // and we compose textures from the TEXTURE1/2 lists 27 | // of patches. 28 | 29 | typedef struct 30 | { 31 | short width; // bounding box size 32 | short height; 33 | short leftoffset; // pixels to the left of origin 34 | short topoffset; // pixels below the origin 35 | int columnofs[8]; // only [width] used 36 | // the [0] is &columnofs[width] 37 | } PACKEDATTR patch_t; 38 | 39 | // posts are runs of non masked source pixels 40 | typedef struct 41 | { 42 | byte topdelta; // -1 is the last post in a column 43 | byte length; // length data bytes follows 44 | } PACKEDATTR post_t; 45 | 46 | // column_t is a list of 0 or more post_t, (byte)-1 terminated 47 | typedef post_t column_t; 48 | 49 | #endif 50 | 51 | -------------------------------------------------------------------------------- /frosted-doom/v_video.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Gamma correction LUT. 17 | // Functions to draw patches (by post) directly to screen. 18 | // Functions to blit a block to the screen. 19 | // 20 | 21 | 22 | #ifndef __V_VIDEO__ 23 | #define __V_VIDEO__ 24 | 25 | #include "doomtype.h" 26 | 27 | // Needed because we are refering to patches. 28 | #include "v_patch.h" 29 | 30 | // 31 | // VIDEO 32 | // 33 | 34 | #define CENTERY (SCREENHEIGHT/2) 35 | 36 | 37 | extern int dirtybox[4]; 38 | 39 | extern byte *tinttable; 40 | 41 | // haleyjd 08/28/10: implemented for Strife support 42 | // haleyjd 08/28/10: Patch clipping callback, implemented to support Choco 43 | // Strife. 44 | typedef boolean (*vpatchclipfunc_t)(patch_t *, int, int); 45 | void V_SetPatchClipCallback(vpatchclipfunc_t func); 46 | 47 | 48 | // Allocates buffer screens, call before R_Init. 49 | void V_Init (void); 50 | 51 | // Draw a block from the specified source screen to the screen. 52 | 53 | void V_CopyRect(int srcx, int srcy, byte *source, 54 | int width, int height, 55 | int destx, int desty); 56 | 57 | void V_DrawPatch(int x, int y, patch_t *patch); 58 | void V_DrawPatchFlipped(int x, int y, patch_t *patch); 59 | void V_DrawTLPatch(int x, int y, patch_t *patch); 60 | void V_DrawAltTLPatch(int x, int y, patch_t * patch); 61 | void V_DrawShadowedPatch(int x, int y, patch_t *patch); 62 | void V_DrawXlaPatch(int x, int y, patch_t * patch); // villsa [STRIFE] 63 | void V_DrawPatchDirect(int x, int y, patch_t *patch); 64 | 65 | // Draw a linear block of pixels into the view buffer. 66 | 67 | void V_DrawBlock(int x, int y, int width, int height, byte *src); 68 | 69 | void V_MarkRect(int x, int y, int width, int height); 70 | 71 | void V_DrawFilledBox(int x, int y, int w, int h, int c); 72 | void V_DrawHorizLine(int x, int y, int w, int c); 73 | void V_DrawVertLine(int x, int y, int h, int c); 74 | void V_DrawBox(int x, int y, int w, int h, int c); 75 | 76 | // Draw a raw screen lump 77 | 78 | void V_DrawRawScreen(byte *raw); 79 | 80 | // Temporarily switch to using a different buffer to draw graphics, etc. 81 | 82 | void V_UseBuffer(byte *buffer); 83 | 84 | // Return to using the normal screen buffer to draw graphics. 85 | 86 | void V_RestoreBuffer(void); 87 | 88 | // Save a screenshot of the current screen to a file, named in the 89 | // format described in the string passed to the function, eg. 90 | // "DOOM%02i.pcx" 91 | 92 | void V_ScreenShot(char *format); 93 | 94 | // Load the lookup table for translucency calculations from the TINTTAB 95 | // lump. 96 | 97 | void V_LoadTintTable(void); 98 | 99 | // villsa [STRIFE] 100 | // Load the lookup table for translucency calculations from the XLATAB 101 | // lump. 102 | 103 | void V_LoadXlaTable(void); 104 | 105 | void V_DrawMouseSpeedBox(int speed); 106 | 107 | #endif 108 | 109 | -------------------------------------------------------------------------------- /frosted-doom/w_checksum.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Generate a checksum of the WAD directory. 17 | // 18 | 19 | #include 20 | #include 21 | #include 22 | 23 | #include "m_misc.h" 24 | #include "sha1.h" 25 | #include "w_checksum.h" 26 | #include "w_wad.h" 27 | 28 | static wad_file_t **open_wadfiles = NULL; 29 | static int num_open_wadfiles = 0; 30 | 31 | static int GetFileNumber(wad_file_t *handle) 32 | { 33 | int i; 34 | int result; 35 | 36 | for (i=0; iname, sizeof(buf)); 62 | SHA1_UpdateString(sha1_context, buf); 63 | SHA1_UpdateInt32(sha1_context, GetFileNumber(lump->wad_file)); 64 | SHA1_UpdateInt32(sha1_context, lump->position); 65 | SHA1_UpdateInt32(sha1_context, lump->size); 66 | } 67 | 68 | void W_Checksum(sha1_digest_t digest) 69 | { 70 | sha1_context_t sha1_context; 71 | unsigned int i; 72 | 73 | SHA1_Init(&sha1_context); 74 | 75 | num_open_wadfiles = 0; 76 | 77 | // Go through each entry in the WAD directory, adding information 78 | // about each entry to the SHA1 hash. 79 | 80 | for (i=0; i 20 | 21 | #include "config.h" 22 | 23 | #include "doomtype.h" 24 | #include "m_argv.h" 25 | 26 | #include "w_file.h" 27 | 28 | extern wad_file_class_t stdc_wad_file; 29 | 30 | #ifdef _WIN32 31 | extern wad_file_class_t win32_wad_file; 32 | #endif 33 | 34 | #ifdef HAVE_MMAP 35 | extern wad_file_class_t posix_wad_file; 36 | #endif 37 | 38 | static wad_file_class_t *wad_file_classes[] = 39 | { 40 | #ifdef _WIN32 41 | &win32_wad_file, 42 | #endif 43 | #ifdef HAVE_MMAP 44 | &posix_wad_file, 45 | #endif 46 | &stdc_wad_file, 47 | }; 48 | 49 | wad_file_t *W_OpenFile(char *path) 50 | { 51 | wad_file_t *result; 52 | int i; 53 | 54 | //! 55 | // Use the OS's virtual memory subsystem to map WAD files 56 | // directly into memory. 57 | // 58 | 59 | if (!M_CheckParm("-mmap")) 60 | { 61 | return stdc_wad_file.OpenFile(path); 62 | } 63 | 64 | // Try all classes in order until we find one that works 65 | 66 | result = NULL; 67 | 68 | for (i = 0; i < arrlen(wad_file_classes); ++i) 69 | { 70 | result = wad_file_classes[i]->OpenFile(path); 71 | 72 | if (result != NULL) 73 | { 74 | break; 75 | } 76 | } 77 | 78 | return result; 79 | } 80 | 81 | void W_CloseFile(wad_file_t *wad) 82 | { 83 | wad->file_class->CloseFile(wad); 84 | } 85 | 86 | size_t W_Read(wad_file_t *wad, unsigned int offset, 87 | void *buffer, size_t buffer_len) 88 | { 89 | return wad->file_class->Read(wad, offset, buffer, buffer_len); 90 | } 91 | 92 | -------------------------------------------------------------------------------- /frosted-doom/w_file.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // WAD I/O functions. 17 | // 18 | 19 | 20 | #ifndef __W_FILE__ 21 | #define __W_FILE__ 22 | 23 | #include 24 | #include "doomtype.h" 25 | 26 | typedef struct _wad_file_s wad_file_t; 27 | 28 | typedef struct 29 | { 30 | // Open a file for reading. 31 | 32 | wad_file_t *(*OpenFile)(char *path); 33 | 34 | // Close the specified file. 35 | 36 | void (*CloseFile)(wad_file_t *file); 37 | 38 | // Read data from the specified position in the file into the 39 | // provided buffer. Returns the number of bytes read. 40 | 41 | size_t (*Read)(wad_file_t *file, unsigned int offset, 42 | void *buffer, size_t buffer_len); 43 | 44 | } wad_file_class_t; 45 | 46 | struct _wad_file_s 47 | { 48 | // Class of this file. 49 | 50 | wad_file_class_t *file_class; 51 | 52 | // If this is NULL, the file cannot be mapped into memory. If this 53 | // is non-NULL, it is a pointer to the mapped file. 54 | 55 | byte *mapped; 56 | 57 | // Length of the file, in bytes. 58 | 59 | unsigned int length; 60 | }; 61 | 62 | // Open the specified file. Returns a pointer to a new wad_file_t 63 | // handle for the WAD file, or NULL if it could not be opened. 64 | 65 | wad_file_t *W_OpenFile(char *path); 66 | 67 | // Close the specified WAD file. 68 | 69 | void W_CloseFile(wad_file_t *wad); 70 | 71 | // Read data from the specified file into the provided buffer. The 72 | // data is read from the specified offset from the start of the file. 73 | // Returns the number of bytes read. 74 | 75 | size_t W_Read(wad_file_t *wad, unsigned int offset, 76 | void *buffer, size_t buffer_len); 77 | 78 | #endif /* #ifndef __W_FILE__ */ 79 | -------------------------------------------------------------------------------- /frosted-doom/w_file_stdc.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // WAD I/O functions. 17 | // 18 | 19 | #include 20 | 21 | #include "m_misc.h" 22 | #include "w_file.h" 23 | #include "z_zone.h" 24 | 25 | typedef struct 26 | { 27 | wad_file_t wad; 28 | FILE *fstream; 29 | } stdc_wad_file_t; 30 | 31 | extern wad_file_class_t stdc_wad_file; 32 | 33 | static wad_file_t *W_StdC_OpenFile(char *path) 34 | { 35 | stdc_wad_file_t *result; 36 | FILE *fstream; 37 | 38 | fstream = fopen(path, "rb"); 39 | 40 | if (fstream == NULL) 41 | { 42 | return NULL; 43 | } 44 | 45 | // Create a new stdc_wad_file_t to hold the file handle. 46 | 47 | result = Z_Malloc(sizeof(stdc_wad_file_t), PU_STATIC, 0); 48 | result->wad.file_class = &stdc_wad_file; 49 | result->wad.mapped = NULL; 50 | result->wad.length = M_FileLength(fstream); 51 | result->fstream = fstream; 52 | 53 | return &result->wad; 54 | } 55 | 56 | static void W_StdC_CloseFile(wad_file_t *wad) 57 | { 58 | stdc_wad_file_t *stdc_wad; 59 | 60 | stdc_wad = (stdc_wad_file_t *) wad; 61 | 62 | fclose(stdc_wad->fstream); 63 | Z_Free(stdc_wad); 64 | } 65 | 66 | // Read data from the specified position in the file into the 67 | // provided buffer. Returns the number of bytes read. 68 | 69 | size_t W_StdC_Read(wad_file_t *wad, unsigned int offset, 70 | void *buffer, size_t buffer_len) 71 | { 72 | stdc_wad_file_t *stdc_wad; 73 | size_t result; 74 | 75 | stdc_wad = (stdc_wad_file_t *) wad; 76 | 77 | // Jump to the specified position in the file. 78 | 79 | fseek(stdc_wad->fstream, offset, SEEK_SET); 80 | 81 | // Read into the buffer. 82 | 83 | result = fread(buffer, 1, buffer_len, stdc_wad->fstream); 84 | 85 | return result; 86 | } 87 | 88 | 89 | wad_file_class_t stdc_wad_file = 90 | { 91 | W_StdC_OpenFile, 92 | W_StdC_CloseFile, 93 | W_StdC_Read, 94 | }; 95 | 96 | 97 | -------------------------------------------------------------------------------- /frosted-doom/w_file_stdc_unbuffered.c: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // WAD I/O functions. 17 | // 18 | 19 | #include 20 | #include 21 | #include 22 | #include 23 | #include 24 | #include 25 | 26 | #include "m_misc.h" 27 | #include "w_file.h" 28 | #include "z_zone.h" 29 | 30 | typedef struct 31 | { 32 | wad_file_t wad; 33 | int fd; 34 | } stdc_wad_file_t; 35 | 36 | extern wad_file_class_t stdc_wad_file; 37 | 38 | static unsigned int W_StdC_FileLength(int fd) 39 | { 40 | long savedpos; 41 | long length; 42 | 43 | // save the current position in the file 44 | savedpos = lseek(fd, 0, SEEK_CUR); 45 | 46 | // jump to the end and find the length 47 | length = lseek(fd, 0, SEEK_END); 48 | 49 | // go back to the old location 50 | lseek(fd, savedpos, SEEK_SET); 51 | 52 | return length; 53 | } 54 | 55 | static wad_file_t *W_StdC_OpenFile(char *path) 56 | { 57 | stdc_wad_file_t *result; 58 | int fd; 59 | 60 | fd = open(path, O_RDONLY); 61 | 62 | if (fd <= 0) 63 | { 64 | return NULL; 65 | } 66 | 67 | // Create a new stdc_wad_file_t to hold the file handle. 68 | 69 | result = Z_Malloc(sizeof(stdc_wad_file_t), PU_STATIC, 0); 70 | result->wad.file_class = &stdc_wad_file; 71 | result->wad.mapped = NULL; 72 | result->wad.length = W_StdC_FileLength(fd); 73 | result->fd = fd; 74 | 75 | return &result->wad; 76 | } 77 | 78 | static void W_StdC_CloseFile(wad_file_t *wad) 79 | { 80 | stdc_wad_file_t *stdc_wad; 81 | 82 | stdc_wad = (stdc_wad_file_t *) wad; 83 | 84 | close(stdc_wad->fd); 85 | Z_Free(stdc_wad); 86 | } 87 | 88 | // Read data from the specified position in the file into the 89 | // provided buffer. Returns the number of bytes read. 90 | 91 | size_t W_StdC_Read(wad_file_t *wad, unsigned int offset, 92 | void *buffer, size_t buffer_len) 93 | { 94 | stdc_wad_file_t *stdc_wad; 95 | size_t result; 96 | 97 | stdc_wad = (stdc_wad_file_t *) wad; 98 | 99 | // Jump to the specified position in the file. 100 | 101 | lseek(stdc_wad->fd, offset, SEEK_SET); 102 | 103 | // Read into the buffer. 104 | 105 | result = read(stdc_wad->fd, buffer, buffer_len); 106 | 107 | return result; 108 | } 109 | 110 | 111 | wad_file_class_t stdc_wad_file = 112 | { 113 | W_StdC_OpenFile, 114 | W_StdC_CloseFile, 115 | W_StdC_Read, 116 | }; 117 | 118 | 119 | -------------------------------------------------------------------------------- /frosted-doom/w_main.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Common code to parse command line, identifying WAD files to load. 16 | // 17 | 18 | #ifndef W_MAIN_H 19 | #define W_MAIN_H 20 | 21 | boolean W_ParseCommandLine(void); 22 | 23 | #endif /* #ifndef W_MAIN_H */ 24 | 25 | -------------------------------------------------------------------------------- /frosted-doom/w_merge.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 2005-2014 Simon Howard 3 | // 4 | // This program is free software; you can redistribute it and/or 5 | // modify it under the terms of the GNU General Public License 6 | // as published by the Free Software Foundation; either version 2 7 | // of the License, or (at your option) any later version. 8 | // 9 | // This program is distributed in the hope that it will be useful, 10 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | // GNU General Public License for more details. 13 | // 14 | // DESCRIPTION: 15 | // Handles merging of PWADs, similar to deutex's -merge option 16 | // 17 | // Ideally this should work exactly the same as in deutex, but trying to 18 | // read the deutex source code made my brain hurt. 19 | // 20 | 21 | #ifndef W_MERGE_H 22 | #define W_MERGE_H 23 | 24 | #define W_NWT_MERGE_SPRITES 0x1 25 | #define W_NWT_MERGE_FLATS 0x2 26 | 27 | // Add a new WAD and merge it into the main directory 28 | 29 | void W_MergeFile(char *filename); 30 | 31 | // NWT-style merging 32 | 33 | void W_NWTMergeFile(char *filename, int flags); 34 | 35 | // Acts the same as NWT's "-merge" option. 36 | 37 | void W_NWTDashMerge(char *filename); 38 | 39 | // Debug function that prints the WAD directory. 40 | 41 | void W_PrintDirectory(void); 42 | 43 | #endif /* #ifndef W_MERGE_H */ 44 | 45 | -------------------------------------------------------------------------------- /frosted-doom/w_wad.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // WAD I/O functions. 17 | // 18 | 19 | 20 | #ifndef __W_WAD__ 21 | #define __W_WAD__ 22 | 23 | #include 24 | 25 | #include "doomtype.h" 26 | #include "d_mode.h" 27 | 28 | #include "w_file.h" 29 | 30 | 31 | // 32 | // TYPES 33 | // 34 | 35 | // 36 | // WADFILE I/O related stuff. 37 | // 38 | 39 | typedef struct lumpinfo_s lumpinfo_t; 40 | 41 | struct lumpinfo_s 42 | { 43 | char name[8]; 44 | wad_file_t *wad_file; 45 | int position; 46 | int size; 47 | void *cache; 48 | 49 | // Used for hash table lookups 50 | 51 | lumpinfo_t *next; 52 | }; 53 | 54 | 55 | extern lumpinfo_t *lumpinfo; 56 | extern unsigned int numlumps; 57 | 58 | wad_file_t *W_AddFile (char *filename); 59 | 60 | int W_CheckNumForName (char* name); 61 | int W_GetNumForName (char* name); 62 | 63 | int W_LumpLength (unsigned int lump); 64 | void W_ReadLump (unsigned int lump, void *dest); 65 | 66 | void* W_CacheLumpNum (int lump, int tag); 67 | void* W_CacheLumpName (char* name, int tag); 68 | 69 | void W_GenerateHashTable(void); 70 | 71 | extern unsigned int W_LumpNameHash(const char *s); 72 | 73 | void W_ReleaseLumpNum(int lump); 74 | void W_ReleaseLumpName(char *name); 75 | 76 | void W_CheckCorrectIWAD(GameMission_t mission); 77 | 78 | #endif 79 | -------------------------------------------------------------------------------- /frosted-doom/wi_stuff.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Intermission. 17 | // 18 | 19 | #ifndef __WI_STUFF__ 20 | #define __WI_STUFF__ 21 | 22 | //#include "v_video.h" 23 | 24 | #include "doomdef.h" 25 | 26 | // States for the intermission 27 | 28 | typedef enum 29 | { 30 | NoState = -1, 31 | StatCount, 32 | ShowNextLoc, 33 | } stateenum_t; 34 | 35 | // Called by main loop, animate the intermission. 36 | void WI_Ticker (void); 37 | 38 | // Called by main loop, 39 | // draws the intermission directly into the screen buffer. 40 | void WI_Drawer (void); 41 | 42 | // Setup for an intermission screen. 43 | void WI_Start(wbstartstruct_t* wbstartstruct); 44 | 45 | // Shut down the intermission screen 46 | void WI_End(void); 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /frosted-doom/z_zone.h: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright(C) 1993-1996 Id Software, Inc. 3 | // Copyright(C) 2005-2014 Simon Howard 4 | // 5 | // This program is free software; you can redistribute it and/or 6 | // modify it under the terms of the GNU General Public License 7 | // as published by the Free Software Foundation; either version 2 8 | // of the License, or (at your option) any later version. 9 | // 10 | // This program is distributed in the hope that it will be useful, 11 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | // GNU General Public License for more details. 14 | // 15 | // DESCRIPTION: 16 | // Zone Memory Allocation, perhaps NeXT ObjectiveC inspired. 17 | // Remark: this was the only stuff that, according 18 | // to John Carmack, might have been useful for 19 | // Quake. 20 | // 21 | 22 | 23 | 24 | #ifndef __Z_ZONE__ 25 | #define __Z_ZONE__ 26 | 27 | #include 28 | 29 | // 30 | // ZONE MEMORY 31 | // PU - purge tags. 32 | 33 | enum 34 | { 35 | PU_STATIC = 1, // static entire execution time 36 | PU_SOUND, // static while playing 37 | PU_MUSIC, // static while playing 38 | PU_FREE, // a free block 39 | PU_LEVEL, // static until level exited 40 | PU_LEVSPEC, // a special thinker in a level 41 | 42 | // Tags >= PU_PURGELEVEL are purgable whenever needed. 43 | 44 | PU_PURGELEVEL, 45 | PU_CACHE, 46 | 47 | // Total number of different tag types 48 | 49 | PU_NUM_TAGS 50 | }; 51 | 52 | 53 | void Z_Init (void); 54 | void* Z_Malloc (int size, int tag, void *ptr); 55 | void Z_Free (void *ptr); 56 | void Z_FreeTags (int lowtag, int hightag); 57 | void Z_DumpHeap (int lowtag, int hightag); 58 | void Z_FileDumpHeap (FILE *f); 59 | void Z_CheckHeap (void); 60 | void Z_ChangeTag2 (void *ptr, int tag, char *file, int line); 61 | void Z_ChangeUser(void *ptr, void **user); 62 | int Z_FreeMemory (void); 63 | unsigned int Z_ZoneSize(void); 64 | 65 | // 66 | // This is used to get the local FILE:LINE info from CPP 67 | // prior to really call the function in question. 68 | // 69 | #define Z_ChangeTag(p,t) \ 70 | Z_ChangeTag2((p), (t), __FILE__, __LINE__) 71 | 72 | 73 | #endif 74 | -------------------------------------------------------------------------------- /ipx/DOOMNET.C: -------------------------------------------------------------------------------- 1 | //#define DOOM2 2 | 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | #include "doomnet.h" 11 | //#include "ipxstr.h" 12 | #include "ipx_frch.h" // FRENCH VERSION 13 | 14 | doomcom_t doomcom; 15 | int vectorishooked; 16 | void interrupt (*olddoomvect) (void); 17 | 18 | 19 | 20 | /* 21 | ============= 22 | = 23 | = LaunchDOOM 24 | = 25 | These fields in doomcom should be filled in before calling: 26 | 27 | short numnodes; // console is allways node 0 28 | short ticdup; // 1 = no duplication, 2-5 = dup for 29 | slow nets 30 | short extratics; // 1 = send a backup tic in every 31 | packet 32 | 33 | short consoleplayer; // 0-3 = player number 34 | short numplayers; // 1-4 35 | short angleoffset; // 1 = left, 0 = center, -1 = right 36 | short drone; // 1 = drone 37 | ============= 38 | */ 39 | 40 | void LaunchDOOM (void) 41 | { 42 | char *newargs[99]; 43 | char adrstring[10]; 44 | long flatadr; 45 | 46 | // prepare for DOOM 47 | doomcom.id = DOOMCOM_ID; 48 | 49 | // hook the interrupt vector 50 | olddoomvect = getvect (doomcom.intnum); 51 | setvect (doomcom.intnum,(void interrupt (*)(void))MK_FP(_CS, 52 | (int)NetISR)); 53 | vectorishooked = 1; 54 | 55 | // build the argument list for DOOM, adding a -net &doomcom 56 | memcpy (newargs, _argv, (_argc+1)*2); 57 | newargs[_argc] = "-net"; 58 | flatadr = (long)_DS*16 + (unsigned)&doomcom; 59 | sprintf (adrstring,"%lu",flatadr); 60 | newargs[_argc+1] = adrstring; 61 | newargs[_argc+2] = NULL; 62 | 63 | if (!access("doom2.exe",0)) 64 | spawnv (P_WAIT, "doom2", newargs); 65 | else 66 | spawnv (P_WAIT, "doom", newargs); 67 | 68 | #ifdef DOOM2 69 | printf (STR_RETURNED"\n"); 70 | #else 71 | printf ("Returned from DOOM\n"); 72 | #endif 73 | } 74 | -------------------------------------------------------------------------------- /ipx/DOOMNET.H: -------------------------------------------------------------------------------- 1 | // doomnet.h 2 | 3 | #define PEL_WRITE_ADR 0x3c8 4 | #define PEL_DATA 0x3c9 5 | 6 | #define I_ColorBlack(r,g,b) {outp(PEL_WRITE_ADR,0);outp(PEL_DATA,r);outp(PEL_DATA,g);outp(PEL_DATA,b);}; 7 | 8 | 9 | 10 | #define MAXNETNODES 8 // max computers in a game 11 | #define MAXPLAYERS 4 // 4 players max + drones 12 | 13 | 14 | #define CMD_SEND 1 15 | #define CMD_GET 2 16 | 17 | #define DOOMCOM_ID 0x12345678l 18 | 19 | typedef struct 20 | { 21 | long id; 22 | short intnum; // DOOM executes an int to send commands 23 | 24 | // communication between DOOM and the driver 25 | short command; // CMD_SEND or CMD_GET 26 | short remotenode; // dest for send, set by get (-1 = no packet) 27 | short datalength; // bytes in doomdata to be sent / bytes read 28 | 29 | // info common to all nodes 30 | short numnodes; // console is allways node 0 31 | short ticdup; // 1 = no duplication, 2-5 = dup for slow nets 32 | short extratics; // 1 = send a backup tic in every packet 33 | short deathmatch; // 1 = deathmatch 34 | short savegame; // -1 = new game, 0-5 = load savegame 35 | short episode; // 1-3 36 | short map; // 1-9 37 | short skill; // 1-5 38 | 39 | // info specific to this node 40 | short consoleplayer; // 0-3 = player number 41 | short numplayers; // 1-4 42 | short angleoffset; // 1 = left, 0 = center, -1 = right 43 | short drone; // 1 = drone 44 | 45 | // packet data to be sent 46 | char data[512]; 47 | } doomcom_t; 48 | 49 | 50 | 51 | extern doomcom_t doomcom; 52 | extern void interrupt (*olddoomvect) (void); 53 | extern int vectorishooked; 54 | 55 | int CheckParm (char *check); 56 | void LaunchDOOM (void); 57 | void interrupt NetISR (void); 58 | 59 | -------------------------------------------------------------------------------- /ipx/IPXNET.H: -------------------------------------------------------------------------------- 1 | // ipxnet.h 2 | 3 | 4 | typedef struct 5 | { 6 | char private[512]; 7 | } doomdata_t; 8 | 9 | 10 | #include "DoomNet.h" 11 | 12 | //=========================================================================== 13 | 14 | #define NUMPACKETS 10 // max outstanding packets before loss 15 | 16 | // setupdata_t is used as doomdata_t during setup 17 | typedef struct 18 | { 19 | short gameid; // so multiple games can setup at once 20 | short drone; 21 | short nodesfound; 22 | short nodeswanted; 23 | } setupdata_t; 24 | 25 | 26 | 27 | typedef unsigned char BYTE; 28 | typedef unsigned short WORD; 29 | typedef unsigned long LONG; 30 | 31 | typedef struct IPXPacketStructure 32 | { 33 | WORD PacketCheckSum; /* high-low */ 34 | WORD PacketLength; /* high-low */ 35 | BYTE PacketTransportControl; 36 | BYTE PacketType; 37 | 38 | BYTE dNetwork[4]; /* high-low */ 39 | BYTE dNode[6]; /* high-low */ 40 | BYTE dSocket[2]; /* high-low */ 41 | 42 | BYTE sNetwork[4]; /* high-low */ 43 | BYTE sNode[6]; /* high-low */ 44 | BYTE sSocket[2]; /* high-low */ 45 | } IPXPacket; 46 | 47 | 48 | typedef struct 49 | { 50 | BYTE network[4]; /* high-low */ 51 | BYTE node[6]; /* high-low */ 52 | } localadr_t; 53 | 54 | typedef struct 55 | { 56 | BYTE node[6]; /* high-low */ 57 | } nodeadr_t; 58 | 59 | typedef struct ECBStructure 60 | { 61 | WORD Link[2]; /* offset-segment */ 62 | WORD ESRAddress[2]; /* offset-segment */ 63 | BYTE InUseFlag; 64 | BYTE CompletionCode; 65 | WORD ECBSocket; /* high-low */ 66 | BYTE IPXWorkspace[4]; /* N/A */ 67 | BYTE DriverWorkspace[12]; /* N/A */ 68 | BYTE ImmediateAddress[6]; /* high-low */ 69 | WORD FragmentCount; /* low-high */ 70 | 71 | WORD fAddress[2]; /* offset-segment */ 72 | WORD fSize; /* low-high */ 73 | 74 | WORD f2Address[2]; /* offset-segment */ 75 | WORD f2Size; /* low-high */ 76 | } ECB; 77 | 78 | 79 | // time is used by the communication driver to sequence packets returned 80 | // to DOOM when more than one is waiting 81 | 82 | typedef struct 83 | { 84 | ECB ecb; 85 | IPXPacket ipx; 86 | 87 | long time; 88 | doomdata_t data; 89 | } packet_t; 90 | 91 | 92 | extern doomcom_t doomcom; 93 | extern int gameid; 94 | 95 | extern nodeadr_t nodeadr[MAXNETNODES+1]; 96 | extern int localnodenum; 97 | 98 | extern long localtime; // for time stamp in packets 99 | extern long remotetime; // timestamp of last packet gotten 100 | 101 | extern nodeadr_t remoteadr; 102 | 103 | extern int myargc; 104 | 105 | extern char **myargv; 106 | 107 | void Error (char *error, ...); 108 | 109 | 110 | void InitNetwork (void); 111 | void ShutdownNetwork (void); 112 | void SendPacket (int destination); 113 | int GetPacket (void); 114 | int CheckParm (char *check); 115 | 116 | void PrintAddress (nodeadr_t *adr, char *str); 117 | 118 | -------------------------------------------------------------------------------- /ipx/IPXSTR.H: -------------------------------------------------------------------------------- 1 | #define STR_NETABORT "Network game synchronization aborted." 2 | #define STR_UNKNOWN "Got an unknown game packet during setup" 3 | #define STR_FOUND "Found a node!" 4 | #define STR_LOOKING "Looking for a node" 5 | #define STR_MORETHAN "More than %i players specified!" 6 | #define STR_NONESPEC "No players specified for game!" 7 | #define STR_CONSOLEIS "Console is player %i of %i" 8 | #define STR_NORESP "No such response file!" 9 | #define STR_FOUNDRESP "Found response file" 10 | #define STR_DOOMNETDRV "DOOM II NETWORK DEVICE DRIVER" 11 | #define STR_VECTSPEC "The specified vector (0x%02x) was already hooked." 12 | #define STR_NONULL \ 13 | "Warning: no NULL or iret interrupt vectors were found in the 0x60 to 0x66\n"\ 14 | "range. You can specify a vector with the -vector 0x parameter." 15 | #define STR_COMMVECT "Communicating with interrupt vector 0x%x" 16 | #define STR_USEALT "Using alternate port %i for network" 17 | #define STR_RETURNED "Returned from DOOM II" 18 | #define STR_ATTEMPT "Attempting to find all players for %i player net play. "\ 19 | "Press ESC to exit.\n" 20 | -------------------------------------------------------------------------------- /ipx/IPX_FRCH.H: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insane-adding-machines/DOOM/f167242a8a496fe4e8abe6298c58ba87bfee5978/ipx/IPX_FRCH.H -------------------------------------------------------------------------------- /ipx/README: -------------------------------------------------------------------------------- 1 | This is the source for the DOOM ipx network driver. 2 | -------------------------------------------------------------------------------- /sersrc/DOOMNET.C: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "doomnet.h" 8 | 9 | //#include "serstr.h" 10 | #include "ser_frch.h" // FRENCH VERSION 11 | 12 | #define DOOM2 13 | 14 | extern int myargc; 15 | extern char **myargv; 16 | 17 | doomcom_t doomcom; 18 | int vectorishooked; 19 | void interrupt (*olddoomvect) (void); 20 | 21 | 22 | 23 | /* 24 | ================= 25 | = 26 | = CheckParm 27 | = 28 | = Checks for the given parameter in the program's command line arguments 29 | = 30 | = Returns the argument number (1 to argc-1) or 0 if not present 31 | = 32 | ================= 33 | */ 34 | 35 | int CheckParm (char *check) 36 | { 37 | int i; 38 | 39 | for (i = 1;i 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | 14 | #define INPUT(port) inportb(port) 15 | #define OUTPUT(port,data) outportb(port,data) 16 | #define CLI() disable() 17 | #define STI() enable() 18 | 19 | 20 | typedef enum {false, true} boolean; 21 | typedef unsigned char byte; 22 | 23 | 24 | #define TRANSMIT_HOLDING_REGISTER 0x00 25 | #define RECEIVE_BUFFER_REGISTER 0x00 26 | #define INTERRUPT_ENABLE_REGISTER 0x01 27 | #define IER_RX_DATA_READY 0x01 28 | #define IER_TX_HOLDING_REGISTER_EMPTY 0x02 29 | #define IER_LINE_STATUS 0x04 30 | #define IER_MODEM_STATUS 0x08 31 | #define INTERRUPT_ID_REGISTER 0x02 32 | #define IIR_MODEM_STATUS_INTERRUPT 0x00 33 | #define IIR_TX_HOLDING_REGISTER_INTERRUPT 0x02 34 | #define IIR_RX_DATA_READY_INTERRUPT 0x04 35 | #define IIR_LINE_STATUS_INTERRUPT 0x06 36 | #define FIFO_CONTROL_REGISTER 0x02 37 | #define FCR_FIFO_ENABLE 0x01 38 | #define FCR_RCVR_FIFO_RESET 0x02 39 | #define FCR_XMIT_FIFO_RESET 0x04 40 | #define FCR_RCVR_TRIGGER_LSB 0x40 41 | #define FCR_RCVR_TRIGGER_MSB 0x80 42 | #define FCR_TRIGGER_01 0x00 43 | #define FCR_TRIGGER_04 0x40 44 | #define FCR_TRIGGER_08 0x80 45 | #define FCR_TRIGGER_14 0xc0 46 | #define LINE_CONTROL_REGISTER 0x03 47 | #define LCR_WORD_LENGTH_MASK 0x03 48 | #define LCR_WORD_LENGTH_SELECT_0 0x01 49 | #define LCR_WORD_LENGTH_SELECT_1 0x02 50 | #define LCR_STOP_BITS 0x04 51 | #define LCR_PARITY_MASK 0x38 52 | #define LCR_PARITY_ENABLE 0x08 53 | #define LCR_EVEN_PARITY_SELECT 0x10 54 | #define LCR_STICK_PARITY 0x20 55 | #define LCR_SET_BREAK 0x40 56 | #define LCR_DLAB 0x80 57 | #define MODEM_CONTROL_REGISTER 0x04 58 | #define MCR_DTR 0x01 59 | #define MCR_RTS 0x02 60 | #define MCR_OUT1 0x04 61 | #define MCR_OUT2 0x08 62 | #define MCR_LOOPBACK 0x10 63 | #define LINE_STATUS_REGISTER 0x05 64 | #define LSR_DATA_READY 0x01 65 | #define LSR_OVERRUN_ERROR 0x02 66 | #define LSR_PARITY_ERROR 0x04 67 | #define LSR_FRAMING_ERROR 0x08 68 | #define LSR_BREAK_DETECT 0x10 69 | #define LSR_THRE 0x20 70 | #define MODEM_STATUS_REGISTER 0x06 71 | #define MSR_DELTA_CTS 0x01 72 | #define MSR_DELTA_DSR 0x02 73 | #define MSR_TERI 0x04 74 | #define MSR_DELTA_CD 0x08 75 | #define MSR_CTS 0x10 76 | #define MSR_DSR 0x20 77 | #define MSR_RI 0x40 78 | #define MSR_CD 0x80 79 | #define DIVISOR_LATCH_LOW 0x00 80 | #define DIVISOR_LATCH_HIGH 0x01 81 | 82 | 83 | 84 | #define QUESIZE 2048 85 | 86 | typedef struct 87 | { 88 | long head, tail; // bytes are put on head and pulled from tail 89 | unsigned char data[QUESIZE]; 90 | } que_t; 91 | 92 | void InitPort (void); 93 | void ShutdownPort (void); 94 | 95 | int read_byte( void ); 96 | void write_byte( int c ); 97 | 98 | 99 | void Error (char *error, ...); 100 | 101 | extern int argc; 102 | extern char **argv; 103 | -------------------------------------------------------------------------------- /sersrc/SERSTR.H: -------------------------------------------------------------------------------- 1 | #define STR_DROPDTR "Dropping DTR" 2 | #define STR_CLEANEXIT "Clean exit from SERSETUP" 3 | #define STR_ATTEMPT "Attempting to connect across serial link, press escape to abort." 4 | #define STR_NETABORT "Network game synchronization aborted." 5 | #define STR_DUPLICATE "Duplicate id string, try again or check modem init string." 6 | #define STR_MODEMCMD "Modem command : " 7 | #define STR_MODEMRESP "Modem response: " 8 | #define STR_RESPABORT "Modem response aborted." 9 | #define STR_CANTREAD "Couldn't read MODEM.CFG" 10 | #define STR_DIALING "Dialing..." 11 | #define STR_CONNECT "CONNECT" 12 | #define STR_WAITRING "Waiting for ring..." 13 | #define STR_RING "RING" 14 | #define STR_NORESP "No such response file!" 15 | #define STR_DOOMSERIAL "DOOM II SERIAL DEVICE DRIVER v1.4" 16 | #define STR_WARNING \ 17 | "Warning: no NULL or iret interrupt vectors were found in the 0x60 to 0x66\n"\ 18 | "range. You can specify a vector with the -vector 0x parameter.\n" 19 | #define STR_COMM "Communicating with interrupt vector 0x%x" 20 | #define STR_RETURNED "Returned from DOOM II" 21 | #define STR_PORTSET "Setting port to %lu baud" 22 | -------------------------------------------------------------------------------- /sersrc/SER_FRCH.H: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/insane-adding-machines/DOOM/f167242a8a496fe4e8abe6298c58ba87bfee5978/sersrc/SER_FRCH.H -------------------------------------------------------------------------------- /sndserv/Makefile: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # 3 | # $Id:$ 4 | # 5 | # $Log:$ 6 | # 7 | # 8 | 9 | CC=gcc 10 | CFLAGS=-O -DNORMALUNIX -DLINUX 11 | LDFLAGS= 12 | LIBS=-lm 13 | 14 | O=linux 15 | 16 | all: $(O)/sndserver 17 | 18 | clean: 19 | rm -f *.o *~ *.flc 20 | rm -f linux/* 21 | 22 | # Target 23 | $(O)/sndserver: \ 24 | $(O)/soundsrv.o \ 25 | $(O)/sounds.o \ 26 | $(O)/wadread.o \ 27 | $(O)/linux.o 28 | $(CC) $(CFLAGS) $(LDFLAGS) \ 29 | $(O)/soundsrv.o \ 30 | $(O)/sounds.o \ 31 | $(O)/wadread.o \ 32 | $(O)/linux.o -o $(O)/sndserver $(LIBS) 33 | echo make complete. 34 | 35 | # Rule 36 | $(O)/%.o: %.c 37 | $(CC) $(CFLAGS) -c $< -o $@ 38 | 39 | 40 | -------------------------------------------------------------------------------- /sndserv/README.sndserv: -------------------------------------------------------------------------------- 1 | 2 | This is the soundserver as used by the original 3 | Linuxdoom release. I separated the source from 4 | the actual Linuxduum source. For various reasons 5 | the separate sound process seems to give the 6 | best results - both synchronous and timer driven 7 | output demonstrate glitches. These might either 8 | be timing issues, or introduced by the changes 9 | I made to the linux sound code while merging it 10 | back into the main tree. 11 | 12 | Note that neither John Carmack nor Dave Taylor 13 | are responsible for the current sound handling. 14 | 15 | -------------------------------------------------------------------------------- /sndserv/linux.c: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id: linux.c,v 1.3 1997/01/26 07:45:01 b1 Exp $ 5 | // 6 | // Copyright (C) 1993-1996 by id Software, Inc. 7 | // 8 | // This source is available for distribution and/or modification 9 | // only under the terms of the DOOM Source Code License as 10 | // published by id Software. All rights reserved. 11 | // 12 | // The source is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License 15 | // for more details. 16 | // 17 | // 18 | // $Log: linux.c,v $ 19 | // Revision 1.3 1997/01/26 07:45:01 b1 20 | // 2nd formatting run, fixed a few warnings as well. 21 | // 22 | // Revision 1.2 1997/01/21 19:00:01 b1 23 | // First formatting run: 24 | // using Emacs cc-mode.el indentation for C++ now. 25 | // 26 | // Revision 1.1 1997/01/19 17:22:45 b1 27 | // Initial check in DOOM sources as of Jan. 10th, 1997 28 | // 29 | // 30 | // DESCRIPTION: 31 | // UNIX, soundserver for Linux i386. 32 | // 33 | //----------------------------------------------------------------------------- 34 | 35 | static const char rcsid[] = "$Id: linux.c,v 1.3 1997/01/26 07:45:01 b1 Exp $"; 36 | 37 | 38 | #include 39 | #include 40 | #include 41 | #include 42 | 43 | #include 44 | 45 | #include "soundsrv.h" 46 | 47 | int audio_fd; 48 | 49 | void 50 | myioctl 51 | ( int fd, 52 | int command, 53 | int* arg ) 54 | { 55 | int rc; 56 | extern int errno; 57 | 58 | rc = ioctl(fd, command, arg); 59 | if (rc < 0) 60 | { 61 | fprintf(stderr, "ioctl(dsp,%d,arg) failed\n", command); 62 | fprintf(stderr, "errno=%d\n", errno); 63 | exit(-1); 64 | } 65 | } 66 | 67 | void I_InitMusic(void) 68 | { 69 | } 70 | 71 | void 72 | I_InitSound 73 | ( int samplerate, 74 | int samplesize ) 75 | { 76 | 77 | int i; 78 | 79 | audio_fd = open("/dev/dsp", O_WRONLY); 80 | if (audio_fd<0) 81 | fprintf(stderr, "Could not open /dev/dsp\n"); 82 | 83 | 84 | i = 11 | (2<<16); 85 | myioctl(audio_fd, SNDCTL_DSP_SETFRAGMENT, &i); 86 | 87 | myioctl(audio_fd, SNDCTL_DSP_RESET, 0); 88 | i=11025; 89 | myioctl(audio_fd, SNDCTL_DSP_SPEED, &i); 90 | i=1; 91 | myioctl(audio_fd, SNDCTL_DSP_STEREO, &i); 92 | 93 | myioctl(audio_fd, SNDCTL_DSP_GETFMTS, &i); 94 | if (i&=AFMT_S16_LE) 95 | myioctl(audio_fd, SNDCTL_DSP_SETFMT, &i); 96 | else 97 | fprintf(stderr, "Could not play signed 16 data\n"); 98 | 99 | } 100 | 101 | void 102 | I_SubmitOutputBuffer 103 | ( void* samples, 104 | int samplecount ) 105 | { 106 | write(audio_fd, samples, samplecount*4); 107 | } 108 | 109 | void I_ShutdownSound(void) 110 | { 111 | 112 | close(audio_fd); 113 | 114 | } 115 | 116 | void I_ShutdownMusic(void) 117 | { 118 | } 119 | -------------------------------------------------------------------------------- /sndserv/soundsrv.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id: soundsrv.h,v 1.3 1997/01/29 22:40:44 b1 Exp $ 5 | // 6 | // Copyright (C) 1993-1996 by id Software, Inc. 7 | // 8 | // This source is available for distribution and/or modification 9 | // only under the terms of the DOOM Source Code License as 10 | // published by id Software. All rights reserved. 11 | // 12 | // The source is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License 15 | // for more details. 16 | // 17 | // 18 | // $Log: soundsrv.h,v $ 19 | // Revision 1.3 1997/01/29 22:40:44 b1 20 | // Reformatting, S (sound) module files. 21 | // 22 | // Revision 1.2 1997/01/21 19:00:07 b1 23 | // First formatting run: 24 | // using Emacs cc-mode.el indentation for C++ now. 25 | // 26 | // Revision 1.1 1997/01/19 17:22:50 b1 27 | // Initial check in DOOM sources as of Jan. 10th, 1997 28 | // 29 | // 30 | // DESCRIPTION: 31 | // UNIX soundserver, separate process. 32 | // 33 | //----------------------------------------------------------------------------- 34 | 35 | #ifndef __SNDSERVER_H__ 36 | #define __SNDSERVER_H__ 37 | 38 | #define SAMPLECOUNT 512 39 | #define MIXBUFFERSIZE (SAMPLECOUNT*2*2) 40 | #define SPEED 11025 41 | 42 | 43 | void I_InitMusic(void); 44 | 45 | void 46 | I_InitSound 47 | ( int samplerate, 48 | int samplesound ); 49 | 50 | void 51 | I_SubmitOutputBuffer 52 | ( void* samples, 53 | int samplecount ); 54 | 55 | void I_ShutdownSound(void); 56 | void I_ShutdownMusic(void); 57 | 58 | #endif 59 | -------------------------------------------------------------------------------- /sndserv/wadread.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id: wadread.h,v 1.3 1997/01/30 19:54:23 b1 Exp $ 5 | // 6 | // Copyright (C) 1993-1996 by id Software, Inc. 7 | // 8 | // This source is available for distribution and/or modification 9 | // only under the terms of the DOOM Source Code License as 10 | // published by id Software. All rights reserved. 11 | // 12 | // The source is distributed in the hope that it will be useful, 13 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | // FITNESS FOR A PARTICULAR PURPOSE. See the DOOM Source Code License 15 | // for more details. 16 | // 17 | // 18 | // $Log: wadread.h,v $ 19 | // Revision 1.3 1997/01/30 19:54:23 b1 20 | // Final reformatting run. All the remains (ST, W, WI, Z). 21 | // 22 | // Revision 1.2 1997/01/21 19:00:10 b1 23 | // First formatting run: 24 | // using Emacs cc-mode.el indentation for C++ now. 25 | // 26 | // Revision 1.1 1997/01/19 17:22:52 b1 27 | // Initial check in DOOM sources as of Jan. 10th, 1997 28 | // 29 | // 30 | // DESCRIPTION: 31 | // WAD and Lump I/O, the second. 32 | // This time for soundserver only. 33 | // Welcome to Department of Redundancy Department. 34 | // (Yeah, I said that elsewhere already). 35 | // Note: makes up for a nice w_wad.h. 36 | // 37 | //----------------------------------------------------------------------------- 38 | 39 | #ifndef __WADREAD_H__ 40 | #define __WADREAD_H__ 41 | 42 | // 43 | // Opens the wadfile specified. 44 | // Must be called before any calls to loadlump() or getsfx(). 45 | // 46 | 47 | void openwad(char* wadname); 48 | 49 | // 50 | // Gets a sound effect from the wad file. The pointer points to the 51 | // start of the data. Returns a 0 if the sfx was not 52 | // found. Sfx names should be no longer than 6 characters. All data is 53 | // rounded up in size to the nearest MIXBUFFERSIZE and is padded out with 54 | // 0x80's. Returns the data length in len. 55 | // 56 | 57 | void* 58 | getsfx 59 | ( char* sfxname, 60 | int* len ); 61 | 62 | #endif 63 | --------------------------------------------------------------------------------