├── i_tcp.h ├── dehacked.h ├── p_map.c ├── r_bsp.c ├── tmap.s ├── console.c ├── m_menu.c ├── r_main.c ├── r_plane.c ├── tmap.nas ├── fabdoom.opt ├── r_splats.c ├── _DOC ├── CONSOLE.TXT ├── DOOMATIC.TXT ├── SKINSPEC.TXT └── SOUND.CFG ├── _LOGS ├── faBlog1.txt ├── Logboris.txt └── Tokin.txt ├── win32 ├── hwr_main.c ├── valve.ico ├── winlgcy.aps ├── winlgcy.rc ├── win_dbg.h ├── resource.h ├── dx_error.h ├── win_dll.h ├── win_main.h ├── win_vid.h ├── hwr_main.h ├── win_net.c ├── r_d3d │ ├── r_d3d.plg │ ├── r_d3d.001 │ └── r_d3d.dsp ├── r_glide │ ├── r_glide.plg │ └── fabfxlib.h ├── hwr_defs.h ├── fabdxlib.h ├── hwr_drv.h ├── glidestuff.txt └── win_dll.c ├── DJGPPDOS ├── Vid_vesa.c ├── I_MAIN.C ├── I_net.c └── BCD.H ├── LINUX_X ├── endtxt.h ├── musserv │ ├── usleep.h │ ├── Makefile.linux │ ├── Makefile.freebsd │ ├── Makefile.scouw2 │ ├── Makefile.scouw7 │ ├── Makefile.scoos5 │ ├── usleep.c │ └── musserver.h ├── searchp.h ├── sndserv │ ├── strcmp.h │ ├── Makefile │ ├── Makefile.scouw7 │ ├── Makefile.scouw2 │ ├── Makefile.scoos5 │ ├── strcmp.c │ ├── soundsrv.h │ ├── wadread.h │ └── ChangeLog ├── dosstr.c ├── vid_x11.c ├── i_cdmus.c ├── i_main.c ├── searchp.c ├── i_net.c └── endtxt.c ├── nettest.bat ├── sertest.bat ├── test1.bat ├── test.bat ├── tcptest.bat ├── g_state.c ├── vid_copy.h ├── fabdoom.dep ├── m_bbox.h ├── p_tick.h ├── d_netfil.h ├── m_swap.c ├── p_fab.h ├── m_swap.h ├── resource.h ├── r_local.h ├── m_argv.h ├── m_bbox.c ├── console.h ├── m_cheat.h ├── README.md ├── asm_defs.inc ├── dstrings.h ├── f_wipe.h ├── byteptr.h ├── d_net.h ├── r_sky.h ├── m_fixed.c ├── fabdoom.dsw ├── i_video.h ├── am_map.h ├── wi_stuff.h ├── r_segs.h ├── d_main.h ├── m_random.h ├── g_state.h ├── f_finale.h ├── d_items.h ├── d_netcmd.h ├── p_setup.h ├── p_saveg.h ├── vid_copy.s ├── i_joy.h ├── p_inter.h ├── m_misc.h ├── d_event.h ├── hu_stuff.h ├── m_random.c ├── d_ticcmd.h ├── p_maputl.h ├── m_argv.c ├── m_menu.h ├── r_bsp.h ├── d_think.h ├── qmus2mid.h ├── doomtype.h ├── d_items.c ├── r_plane.h ├── tables.h ├── r_splats.h ├── m_fixed.h ├── st_stuff.h ├── r_things.h ├── keys.h ├── p_tick.c ├── r_sky.c ├── i_system.h ├── s_sound.h ├── i_net.h ├── r_data.h ├── i_sound.h ├── z_zone.h ├── g_game.h ├── g_input.h ├── p_telept.c ├── r_state.h ├── p_pspr.h └── r_main.h /i_tcp.h: -------------------------------------------------------------------------------- 1 | int I_InitTcpNetwork(void); 2 | -------------------------------------------------------------------------------- /dehacked.h: -------------------------------------------------------------------------------- 1 | void LoadDehackedFile(char *filename); 2 | -------------------------------------------------------------------------------- /p_map.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/p_map.c -------------------------------------------------------------------------------- /r_bsp.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/r_bsp.c -------------------------------------------------------------------------------- /tmap.s: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/tmap.s -------------------------------------------------------------------------------- /console.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/console.c -------------------------------------------------------------------------------- /m_menu.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/m_menu.c -------------------------------------------------------------------------------- /r_main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/r_main.c -------------------------------------------------------------------------------- /r_plane.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/r_plane.c -------------------------------------------------------------------------------- /tmap.nas: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/tmap.nas -------------------------------------------------------------------------------- /fabdoom.opt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/fabdoom.opt -------------------------------------------------------------------------------- /r_splats.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/r_splats.c -------------------------------------------------------------------------------- /_DOC/CONSOLE.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/_DOC/CONSOLE.TXT -------------------------------------------------------------------------------- /_DOC/DOOMATIC.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/_DOC/DOOMATIC.TXT -------------------------------------------------------------------------------- /_DOC/SKINSPEC.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/_DOC/SKINSPEC.TXT -------------------------------------------------------------------------------- /_LOGS/faBlog1.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/_LOGS/faBlog1.txt -------------------------------------------------------------------------------- /win32/hwr_main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/win32/hwr_main.c -------------------------------------------------------------------------------- /win32/valve.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/win32/valve.ico -------------------------------------------------------------------------------- /win32/winlgcy.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/win32/winlgcy.aps -------------------------------------------------------------------------------- /win32/winlgcy.rc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/win32/winlgcy.rc -------------------------------------------------------------------------------- /DJGPPDOS/Vid_vesa.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/DJGPPDOS/Vid_vesa.c -------------------------------------------------------------------------------- /_LOGS/Logboris.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/SSNTails/SRB2SuperEarly/HEAD/_LOGS/Logboris.txt -------------------------------------------------------------------------------- /LINUX_X/endtxt.h: -------------------------------------------------------------------------------- 1 | #ifndef __ENDTXT__ 2 | #define __ENDTXT__ 3 | 4 | void ShowEndTxt (void); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /LINUX_X/musserv/usleep.h: -------------------------------------------------------------------------------- 1 | #ifndef __USLEEP__ 2 | #define __USLEEP__ 3 | 4 | void usleep (unsigned); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /LINUX_X/searchp.h: -------------------------------------------------------------------------------- 1 | #ifndef __SEARCHP__ 2 | #define __SEARCHP__ 3 | 4 | char *searchpath (const char *); 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /nettest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | copy objs\doom3.exe e:\jeux\doom2\doom3.exe 3 | e: 4 | cd \jeux\doom2 5 | doomatic.exe 6 | d: 7 | -------------------------------------------------------------------------------- /sertest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | copy objs\doom3.exe e:\jeux\doom2\doom.exe 3 | e: 4 | cd \jeux\doom2 5 | ipxcopy doom.exe 6 | -------------------------------------------------------------------------------- /test1.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | copy objs\doom3.exe e:\jeux\doom\doom3.exe 3 | e: 4 | cd \jeux\doom 5 | DOOM3 %1 %2 %3 %4 %5 %6 6 | d: 7 | -------------------------------------------------------------------------------- /test.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | copy objs\doom3.exe e:\jeux\doom2\doom3.exe 3 | pushd 4 | cdd e:\jeux\doom2 5 | rem -nosound -nomusic -nocd 6 | DOOM3 %& 7 | popd 8 | -------------------------------------------------------------------------------- /tcptest.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | copy objs\doom3.exe e:\jeux\doom2\doom3.exe 3 | e: 4 | cd \jeux\doom2 5 | ipxcopy doom3.exe 6 | doom3 -server 2 -debugfile %1 %2 %3 %4 7 | d: 8 | -------------------------------------------------------------------------------- /g_state.c: -------------------------------------------------------------------------------- 1 | 2 | // g_state.c : Doom/Hexen game states 3 | 4 | #include "g_state.h" 5 | 6 | gameaction_t gameaction; 7 | gamestate_t gamestate; 8 | skill_t gameskill; 9 | -------------------------------------------------------------------------------- /vid_copy.h: -------------------------------------------------------------------------------- 1 | 2 | // vid_copy.h 3 | 4 | void VID_BlitLinearScreen (void *srcptr, void *destptr, int width, 5 | int height, int srcrowbytes, int destrowbytes); 6 | -------------------------------------------------------------------------------- /LINUX_X/sndserv/strcmp.h: -------------------------------------------------------------------------------- 1 | #ifndef __STRCMP__ 2 | #define __STRCMP__ 3 | 4 | int strcasecmp (const char *, const char *); 5 | int strncasecmp (const char *, const char *, int); 6 | 7 | #endif 8 | -------------------------------------------------------------------------------- /fabdoom.dep: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Generated Dependency File, included by fabdoom.mak 2 | 3 | .\win32\winlgcy.rc : \ 4 | ".\win32\valve.ico"\ 5 | 6 | 7 | !IF "$(CFG)" == "fabdoom - Win32 Release" 8 | 9 | !ELSEIF "$(CFG)" == "fabdoom - Win32 Debug" 10 | 11 | !ENDIF 12 | 13 | -------------------------------------------------------------------------------- /LINUX_X/dosstr.c: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | int strupr(char *n) { 4 | int i; 5 | for (i=0;n[i];i++) { 6 | n[i] = toupper(n[i]); 7 | } 8 | return 1; 9 | } 10 | 11 | int strlwr(char *n) { 12 | int i; 13 | for (i=0;n[i];i++) { 14 | n[i] = tolower(n[i]); 15 | } 16 | return 1; 17 | } 18 | -------------------------------------------------------------------------------- /win32/win_dbg.h: -------------------------------------------------------------------------------- 1 | // win_dbg.h : structured exception handler 2 | 3 | #include 4 | 5 | // called in the exception filter of the __try block, writes all useful debugging information 6 | // to a file, using only win32 functions in case the C runtime is in a bad state. 7 | int __cdecl RecordExceptionInfo (PEXCEPTION_POINTERS data, const char *Message, LPSTR lpCmdLine); 8 | -------------------------------------------------------------------------------- /LINUX_X/vid_x11.c: -------------------------------------------------------------------------------- 1 | /* dummy X11 vid runtime for doom legacy 1.25 */ 2 | #include 3 | 4 | int VID_NumModes(void) { 5 | return 1; 6 | } 7 | 8 | char *VID_GetModeName(int modenum) { 9 | if(modenum!=0) { 10 | return NULL; 11 | } 12 | return "320x200"; 13 | } 14 | 15 | int VID_SetMode(int modenum) { return 0; } /* dummy */ 16 | 17 | int VID_GetModeForSize( int w, int h) { 18 | return 0; 19 | } 20 | -------------------------------------------------------------------------------- /m_bbox.h: -------------------------------------------------------------------------------- 1 | 2 | // m_bbox.h : bounding boxes 3 | 4 | #ifndef __M_BBOX__ 5 | #define __M_BBOX__ 6 | 7 | #include "m_fixed.h" 8 | 9 | // Bounding box coordinate storage. 10 | enum 11 | { 12 | BOXTOP, 13 | BOXBOTTOM, 14 | BOXLEFT, 15 | BOXRIGHT 16 | }; // bbox coordinates 17 | 18 | // Bounding box functions. 19 | void M_ClearBox (fixed_t* box); 20 | 21 | void M_AddToBox (fixed_t* box, fixed_t x, fixed_t y ); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /p_tick.h: -------------------------------------------------------------------------------- 1 | // ? 2 | 3 | 4 | #ifndef __P_TICK__ 5 | #define __P_TICK__ 6 | 7 | 8 | #ifdef __GNUG__ 9 | #pragma interface 10 | #endif 11 | 12 | extern int leveltime; 13 | 14 | // Called by C_Ticker, 15 | // can call G_PlayerExited. 16 | // Carries out all thinking of monsters and players. 17 | void P_Ticker (void); 18 | 19 | 20 | 21 | #endif 22 | //----------------------------------------------------------------------------- 23 | // 24 | // $Log:$ 25 | // 26 | //----------------------------------------------------------------------------- 27 | -------------------------------------------------------------------------------- /d_netfil.h: -------------------------------------------------------------------------------- 1 | #define TXPACKETSIZE 256 2 | 3 | typedef enum { 4 | file = 0, 5 | z_free_methode , 6 | free_methode , 7 | nofree 8 | } freemethode_t; 9 | 10 | 11 | void SendFile(int node,char *filename); 12 | void SendRam(int node,byte *data, ULONG size,freemethode_t freemethode); 13 | void FiletxTicker(void); 14 | void Got_Filetxpak(void); 15 | boolean fileexist(char *filename,time_t time); 16 | 17 | // search a file in subtree, return true if found 18 | int recsearch(char *filename,time_t timestamp); 19 | void nameonly(char *s); -------------------------------------------------------------------------------- /_LOGS/Tokin.txt: -------------------------------------------------------------------------------- 1 | - added a check in I_ZoneBase to check if malloc is OK 2 | - the program should check to see if musserv and llsndsrv is not in "." 3 | because root don't have "." in there path 4 | - sendto function under linux return "connection refuse" if there is no 5 | server at this address (i have just ignored this error) 6 | - the can be recursive error (especialy in network since Q_Netgame try 7 | to close the connection ) when closing with I_Error, you should implement 8 | a recursive error detetion like in DOS or WIN32 version 9 | - now use vid_mode is in vid_s struct -------------------------------------------------------------------------------- /m_swap.c: -------------------------------------------------------------------------------- 1 | // m_swap.c : endianese handling, swapping 16bit and 32bit. 2 | 3 | 4 | // Not needed with big endian. 5 | #ifndef __BIG_ENDIAN__ 6 | 7 | // Swap 16bit, that is, MSB and LSB byte. 8 | unsigned short SwapSHORT(unsigned short x) 9 | { 10 | // No masking with 0xFF should be necessary. 11 | return (x>>8) | (x<<8); 12 | } 13 | 14 | // Swapping 32bit. 15 | unsigned long SwapLONG( unsigned long x) 16 | { 17 | return 18 | (x>>24) 19 | | ((x>>8) & 0xff00) 20 | | ((x<<8) & 0xff0000) 21 | | (x<<24); 22 | } 23 | 24 | 25 | #endif 26 | -------------------------------------------------------------------------------- /p_fab.h: -------------------------------------------------------------------------------- 1 | 2 | // p_fab.h 3 | // 4 | 5 | #ifndef __P_FAB__ 6 | #define __P_FAB__ 7 | 8 | #include "doomtype.h" 9 | #include "command.h" 10 | 11 | extern consvar_t cv_solidcorpse; //p_enemy 12 | extern consvar_t cv_bloodtime; 13 | 14 | // spawn smoke trails behind rockets and skull head attacks 15 | void A_SmokeTrailer (mobj_t* actor); 16 | 17 | // hack the states table to set Doom Legacy's default translucency on sprites 18 | void P_SetTranslucencies (void); 19 | 20 | // add commands for deathmatch rules and style (like more blood) :) 21 | void D_AddDeathmatchCommands (void); 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /m_swap.h: -------------------------------------------------------------------------------- 1 | // Endianess handling, swapping 16bit and 32bit. 2 | 3 | 4 | #ifndef __M_SWAP__ 5 | #define __M_SWAP__ 6 | 7 | 8 | #ifdef __GNUG__ 9 | #pragma interface 10 | #endif 11 | 12 | 13 | // Endianess handling. 14 | // WAD files are stored little endian. 15 | #ifdef __BIG_ENDIAN__ 16 | short SwapSHORT(short); 17 | long SwapLONG(long); 18 | #define SHORT(x) ((short)SwapSHORT((unsigned short) (x))) 19 | #define LONG(x) ((long)SwapLONG((unsigned long) (x))) 20 | #else 21 | #define SHORT(x) (x) 22 | #define LONG(x) (x) 23 | #endif 24 | 25 | 26 | 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by winlgcy.rc 4 | // 5 | #define IDI_DLICON1 101 6 | #define IDC_DLCURSOR1 103 7 | #define IDI_ICON1 106 8 | 9 | // Next default values for new objects 10 | // 11 | #ifdef APSTUDIO_INVOKED 12 | #ifndef APSTUDIO_READONLY_SYMBOLS 13 | #define _APS_NEXT_RESOURCE_VALUE 107 14 | #define _APS_NEXT_COMMAND_VALUE 40001 15 | #define _APS_NEXT_CONTROL_VALUE 1000 16 | #define _APS_NEXT_SYMED_VALUE 101 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /win32/resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by winlgcy.rc 4 | // 5 | #define IDI_DLICON1 101 6 | #define IDC_DLCURSOR1 103 7 | #define IDI_ICON1 106 8 | 9 | // Next default values for new objects 10 | // 11 | #ifdef APSTUDIO_INVOKED 12 | #ifndef APSTUDIO_READONLY_SYMBOLS 13 | #define _APS_NEXT_RESOURCE_VALUE 110 14 | #define _APS_NEXT_COMMAND_VALUE 40001 15 | #define _APS_NEXT_CONTROL_VALUE 1000 16 | #define _APS_NEXT_SYMED_VALUE 101 17 | #endif 18 | #endif 19 | -------------------------------------------------------------------------------- /win32/dx_error.h: -------------------------------------------------------------------------------- 1 | // dx_error.h : transform an unreadable DirectX error code 2 | // into a meaningful error message. 3 | 4 | #ifndef __DX_ERROR_H__ 5 | #define __DX_ERROR_H__ 6 | 7 | #include 8 | 9 | #ifdef __cplusplus 10 | extern "C" { 11 | #endif 12 | 13 | // Displays a message box containing the given formatted string. 14 | //void __cdecl DXErrorMessageBox (LPSTR fmt, ... ); 15 | 16 | // Returns a pointer to a string describing the given DD, D3D or D3DRM error code. 17 | char* DXErrorToString (HRESULT error); 18 | 19 | #ifdef __cplusplus 20 | }; 21 | #endif 22 | #endif // __DX_ERROR_H__ 23 | -------------------------------------------------------------------------------- /r_local.h: -------------------------------------------------------------------------------- 1 | 2 | // r_local.h : header for all rendering/drawing modules 3 | 4 | #ifndef __R_LOCAL__ 5 | #define __R_LOCAL__ 6 | 7 | 8 | // Screen size related parameters. 9 | #include "doomdef.h" 10 | 11 | // Binary Angles, sine/cosine/atan lookups. 12 | #include "tables.h" 13 | 14 | // this one holds the max vid sizes and standard doom aspect 15 | #include "screen.h" 16 | 17 | #include "m_bbox.h" 18 | 19 | #include "r_main.h" 20 | #include "r_bsp.h" 21 | #include "r_segs.h" 22 | #include "r_plane.h" 23 | #include "r_sky.h" 24 | #include "r_data.h" 25 | #include "r_things.h" 26 | #include "r_draw.h" 27 | 28 | 29 | #endif // __R_LOCAL__ 30 | -------------------------------------------------------------------------------- /LINUX_X/sndserv/Makefile: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # 3 | # $Id:$ 4 | # 5 | # $Log:$ 6 | # 7 | # 8 | 9 | CC=gcc 10 | CFLAGS=-O2 -m486 -Wall -DNORMALUNIX -DLINUX 11 | LDFLAGS= 12 | LIBS=-lm 13 | 14 | O=linux 15 | 16 | all: $(O)/llsndserv 17 | 18 | clean: 19 | rm -f $(O)/* 20 | 21 | # Target 22 | $(O)/llsndserv: \ 23 | $(O)/soundsrv.o \ 24 | $(O)/sounds.o \ 25 | $(O)/wadread.o \ 26 | $(O)/linux.o 27 | $(CC) $(CFLAGS) $(LDFLAGS) \ 28 | $(O)/soundsrv.o \ 29 | $(O)/sounds.o \ 30 | $(O)/wadread.o \ 31 | $(O)/linux.o -o $(O)/llsndserv $(LIBS) 32 | echo make complete. 33 | 34 | # Rule 35 | $(O)/%.o: %.c 36 | $(CC) $(CFLAGS) -c $< -o $@ 37 | -------------------------------------------------------------------------------- /win32/win_dll.h: -------------------------------------------------------------------------------- 1 | // win_3dll.h : load/unload a DLL at run-time 2 | 3 | #include 4 | 5 | // this is made extern so win_dbg.c can log the load address 6 | // of the dynamically loaded DLL functions 7 | typedef struct loadfunc_s { 8 | char* fnName; 9 | void* fnPointer; 10 | } loadfunc_t; 11 | extern HINSTANCE hwdInstance; 12 | extern loadfunc_t hwdFuncTable[]; 13 | 14 | //for win_dbg.c 15 | extern HINSTANCE hwdInstance; 16 | extern loadfunc_t hwdFuncTable[]; 17 | 18 | 19 | HINSTANCE LoadDLL (char* dllName, loadfunc_t* funcTable); 20 | void UnloadDLL (HINSTANCE* pInstance); 21 | 22 | BOOL Init3DDriver (char* dllName); 23 | void Shutdown3DDriver (void); 24 | -------------------------------------------------------------------------------- /LINUX_X/musserv/Makefile.linux: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for musserver 1.4 3 | # 4 | 5 | CC = gcc 6 | CFLAGS = -I. -Wall -O2 -m486 7 | LDFLAGS = 8 | #LDFLAGS = -static 9 | 10 | ############################################# 11 | # Nothing below this line should be changed # 12 | ############################################# 13 | 14 | O=linux 15 | 16 | all: ${O}/musserver 17 | 18 | ${O}/musserver: \ 19 | ${O}/musserver.o \ 20 | ${O}/readwad.o \ 21 | ${O}/playmus.o \ 22 | ${O}/sequencer.o 23 | ${CC} ${CFLAGS} ${LDFLAGS} \ 24 | ${O}/musserver.o \ 25 | ${O}/readwad.o \ 26 | ${O}/playmus.o \ 27 | ${O}/sequencer.o -o ${O}/musserver 28 | 29 | clean: 30 | rm -f ${O}/* 31 | 32 | ${O}/%.o: %.c 33 | ${CC} ${CFLAGS} -c $< -o $@ 34 | -------------------------------------------------------------------------------- /LINUX_X/musserv/Makefile.freebsd: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for musserver 1.4 3 | # 4 | 5 | CC = gcc 6 | CFLAGS = -I. -Wall -O2 -m486 -I/usr/src/sys/i386/isa/sound 7 | LDFLAGS = 8 | 9 | ############################################# 10 | # Nothing below this line should be changed # 11 | ############################################# 12 | 13 | O=freebsd 14 | 15 | all: ${O}/musserver 16 | 17 | ${O}/musserver: \ 18 | ${O}/musserver.o \ 19 | ${O}/readwad.o \ 20 | ${O}/playmus.o \ 21 | ${O}/sequencer.o 22 | ${CC} ${CFLAGS} ${LDFLAGS} \ 23 | ${O}/musserver.o \ 24 | ${O}/readwad.o \ 25 | ${O}/playmus.o \ 26 | ${O}/sequencer.o -o ${O}/musserver 27 | 28 | clean: 29 | rm -f ${O}/* 30 | 31 | ${O}/%.o: %.c 32 | ${CC} ${CFLAGS} -c $< -o $@ 33 | -------------------------------------------------------------------------------- /LINUX_X/sndserv/Makefile.scouw7: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # 3 | # $Id:$ 4 | # 5 | # $Log:$ 6 | # 7 | # 8 | 9 | CC=cc 10 | CFLAGS=-O2 -K pentium -DNORMALUNIX -DSCOUW2 11 | LDFLAGS= 12 | LIBS=-lm 13 | 14 | O=unixware7 15 | 16 | all: $(O)/sndserver 17 | 18 | clean: 19 | rm -f $(O)/* 20 | 21 | # Target 22 | $(O)/sndserver: \ 23 | $(O)/soundsrv.o \ 24 | $(O)/sounds.o \ 25 | $(O)/wadread.o \ 26 | $(O)/strcmp.o \ 27 | $(O)/linux.o 28 | $(CC) $(CFLAGS) $(LDFLAGS) \ 29 | $(O)/soundsrv.o \ 30 | $(O)/sounds.o \ 31 | $(O)/wadread.o \ 32 | $(O)/strcmp.o \ 33 | $(O)/linux.o -o $(O)/sndserver $(LIBS) 34 | echo make complete. 35 | 36 | # Rule 37 | $(O)/%.o: %.c 38 | $(CC) $(CFLAGS) -c $< -o $@ 39 | -------------------------------------------------------------------------------- /m_argv.h: -------------------------------------------------------------------------------- 1 | 2 | // m_argv.h : 3 | 4 | #ifndef __M_ARGV__ 5 | #define __M_ARGV__ 6 | 7 | // 8 | // MISC 9 | // 10 | extern int myargc; 11 | extern char** myargv; 12 | 13 | // Returns the position of the given parameter 14 | // in the arg list (0 if not found). 15 | int M_CheckParm (char* check); 16 | 17 | 18 | // push all parameters bigining by a +, ex : +map map01 19 | void M_PushSpecialParameters( void ); 20 | 21 | // return true if there is available parameters 22 | // use it befor M_GetNext 23 | boolean M_IsNextParm(void); 24 | 25 | // return the next parameter after a M_CheckParm 26 | // NULL if not found use M_IsNext to find if there is a parameter 27 | char *M_GetNextParm(void); 28 | 29 | 30 | #endif //__M_ARGV__ 31 | -------------------------------------------------------------------------------- /LINUX_X/sndserv/Makefile.scouw2: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # 3 | # $Id:$ 4 | # 5 | # $Log:$ 6 | # 7 | # 8 | 9 | CC=gcc 10 | CFLAGS=-O2 -m486 -Wall -DNORMALUNIX -DSCOUW2 11 | LDFLAGS= 12 | LIBS=-lm 13 | 14 | O=unixware2 15 | 16 | all: $(O)/sndserver 17 | 18 | clean: 19 | rm -f $(O)/* 20 | 21 | # Target 22 | $(O)/sndserver: \ 23 | $(O)/soundsrv.o \ 24 | $(O)/sounds.o \ 25 | $(O)/wadread.o \ 26 | $(O)/strcmp.o \ 27 | $(O)/linux.o 28 | $(CC) $(CFLAGS) $(LDFLAGS) \ 29 | $(O)/soundsrv.o \ 30 | $(O)/sounds.o \ 31 | $(O)/wadread.o \ 32 | $(O)/strcmp.o \ 33 | $(O)/linux.o -o $(O)/sndserver $(LIBS) 34 | echo make complete. 35 | 36 | # Rule 37 | $(O)/%.o: %.c 38 | $(CC) $(CFLAGS) -c $< -o $@ 39 | -------------------------------------------------------------------------------- /win32/win_main.h: -------------------------------------------------------------------------------- 1 | 2 | // win_main.h 3 | 4 | #define WIN32_LEAN_AND_MEAN 5 | #include 6 | #include 7 | 8 | extern HINSTANCE myInstance; 9 | extern HWND hWndMain; 10 | 11 | // debugging CONS_Printf to file 12 | extern HANDLE logstream; 13 | 14 | //faB: midi channel Volume set is delayed by the MIDI stream callback thread, see win_snd.c 15 | #define WM_MSTREAM_UPDATEVOLUME (WM_USER + 101) 16 | 17 | // defined in win_sys.c 18 | void I_BeginProfile (void); //for timing code 19 | DWORD I_EndProfile (void); 20 | 21 | void I_GetLastErrorMsgBox (void); 22 | 23 | // output formatted string to file using win32 functions (win_dbg.c) 24 | void FPrintf (HANDLE fileHandle, LPCTSTR lpFmt, ...); 25 | -------------------------------------------------------------------------------- /LINUX_X/musserv/Makefile.scouw2: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for musserver 1.4 3 | # 4 | 5 | CC = gcc 6 | CFLAGS = -I. -Wall -O2 -m486 -DSCOUW2 7 | LDFLAGS = 8 | 9 | ############################################# 10 | # Nothing below this line should be changed # 11 | ############################################# 12 | 13 | O=unixware2 14 | 15 | all: ${O}/musserver 16 | 17 | ${O}/musserver: \ 18 | ${O}/musserver.o \ 19 | ${O}/readwad.o \ 20 | ${O}/playmus.o \ 21 | ${O}/sequencer.o \ 22 | ${O}/usleep.o 23 | ${CC} ${CFLAGS} ${LDFLAGS} \ 24 | ${O}/musserver.o \ 25 | ${O}/readwad.o \ 26 | ${O}/playmus.o \ 27 | ${O}/sequencer.o \ 28 | ${O}/usleep.o -o ${O}/musserver 29 | 30 | clean: 31 | rm -f ${O}/* 32 | 33 | ${O}/%.o: %.c 34 | ${CC} ${CFLAGS} -c $< -o $@ 35 | -------------------------------------------------------------------------------- /LINUX_X/musserv/Makefile.scouw7: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for musserver 1.4 3 | # 4 | 5 | CC = cc 6 | CFLAGS = -I. -O2 -K pentium -DSCOUW7 7 | LDFLAGS = 8 | 9 | ############################################# 10 | # Nothing below this line should be changed # 11 | ############################################# 12 | 13 | O=unixware7 14 | 15 | all: ${O}/musserver 16 | 17 | ${O}/musserver: \ 18 | ${O}/musserver.o \ 19 | ${O}/readwad.o \ 20 | ${O}/playmus.o \ 21 | ${O}/sequencer.o \ 22 | ${O}/usleep.o 23 | ${CC} ${CFLAGS} ${LDFLAGS} \ 24 | ${O}/musserver.o \ 25 | ${O}/readwad.o \ 26 | ${O}/playmus.o \ 27 | ${O}/sequencer.o \ 28 | ${O}/usleep.o -o ${O}/musserver 29 | 30 | clean: 31 | rm -f ${O}/* 32 | 33 | ${O}/%.o: %.c 34 | ${CC} ${CFLAGS} -c $< -o $@ 35 | -------------------------------------------------------------------------------- /LINUX_X/sndserv/Makefile.scoos5: -------------------------------------------------------------------------------- 1 | ########################################################## 2 | # 3 | # $Id:$ 4 | # 5 | # $Log:$ 6 | # 7 | # 8 | 9 | CC=gcc 10 | # use this for an older GNU C 2.7.2 11 | #CFLAGS=-O2 -m486 -b elf -Wall -DNORMALUNIX -DSCOOS5 12 | # use this for EGCS 1.0.1 13 | CFLAGS=-O2 -mpentium -Wall -DNORMALUNIX -DSCOOS5 14 | LDFLAGS= 15 | LIBS=-lm 16 | 17 | O=openserver5 18 | 19 | all: $(O)/sndserver 20 | 21 | clean: 22 | rm -f $(O)/* 23 | 24 | # Target 25 | $(O)/sndserver: \ 26 | $(O)/soundsrv.o \ 27 | $(O)/sounds.o \ 28 | $(O)/wadread.o \ 29 | $(O)/linux.o 30 | $(CC) $(CFLAGS) $(LDFLAGS) \ 31 | $(O)/soundsrv.o \ 32 | $(O)/sounds.o \ 33 | $(O)/wadread.o \ 34 | $(O)/linux.o -o $(O)/sndserver $(LIBS) 35 | echo make complete. 36 | 37 | # Rule 38 | $(O)/%.o: %.c 39 | $(CC) $(CFLAGS) -c $< -o $@ 40 | -------------------------------------------------------------------------------- /m_bbox.c: -------------------------------------------------------------------------------- 1 | // m_bbox.c : bounding boxes 2 | 3 | #include "doomtype.h" 4 | #include "m_bbox.h" 5 | 6 | // faB: getting sick of windows includes errors, 7 | // I'm supposed to clean that up later.. sure 8 | #ifdef __WIN32__ 9 | #define MAXINT ((int)0x7fffffff) 10 | #define MININT ((int)0x80000000) 11 | #endif 12 | 13 | 14 | void M_ClearBox (fixed_t *box) 15 | { 16 | box[BOXTOP] = box[BOXRIGHT] = MININT; 17 | box[BOXBOTTOM] = box[BOXLEFT] = MAXINT; 18 | } 19 | 20 | void M_AddToBox ( fixed_t* box, 21 | fixed_t x, 22 | fixed_t y ) 23 | { 24 | if (xbox[BOXRIGHT]) 27 | box[BOXRIGHT] = x; 28 | if (ybox[BOXTOP]) 31 | box[BOXTOP] = y; 32 | } 33 | -------------------------------------------------------------------------------- /LINUX_X/musserv/Makefile.scoos5: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile for musserver 1.4 3 | # 4 | 5 | CC = gcc 6 | # use this for an older GNU C 2.7.2 7 | #CFLAGS = -I. -Wall -O2 -m486 -b elf -DSCOOS5 8 | # use this for EGCS 1.0.1 9 | CFLAGS = -I. -Wall -O2 -mpentium -DSCOOS5 10 | LDFLAGS = 11 | 12 | ############################################# 13 | # Nothing below this line should be changed # 14 | ############################################# 15 | 16 | O=openserver5 17 | 18 | all: ${O}/musserver 19 | 20 | ${O}/musserver: \ 21 | ${O}/musserver.o \ 22 | ${O}/readwad.o \ 23 | ${O}/playmus.o \ 24 | ${O}/sequencer.o \ 25 | ${O}/usleep.o 26 | ${CC} ${CFLAGS} ${LDFLAGS} \ 27 | ${O}/musserver.o \ 28 | ${O}/readwad.o \ 29 | ${O}/playmus.o \ 30 | ${O}/sequencer.o \ 31 | ${O}/usleep.o -o ${O}/musserver 32 | 33 | clean: 34 | rm -f ${O}/* 35 | 36 | ${O}/%.o: %.c 37 | ${CC} ${CFLAGS} -c $< -o $@ 38 | -------------------------------------------------------------------------------- /console.h: -------------------------------------------------------------------------------- 1 | 2 | // console.h 3 | 4 | #include "d_event.h" 5 | 6 | 7 | // for debugging shopuld be replaced by nothing later.. so debug is inactive 8 | #define LOG(x) CONS_Printf(x) 9 | 10 | void CON_Init (void); 11 | 12 | boolean CON_Responder (event_t *ev); 13 | 14 | // set true when screen size has changed, to adapt console 15 | extern boolean con_recalc; 16 | 17 | extern boolean con_startup; 18 | 19 | // top clip value for view render: do not draw part of view hidden by console 20 | extern int con_clipviewtop; 21 | 22 | // 0 means console if off, or moving out 23 | extern int con_destlines; 24 | 25 | void CON_ClearHUD (void); // clear heads up messages 26 | 27 | void CON_Ticker (void); 28 | void CON_Drawer (void); 29 | void CONS_Error (char *msg); // print out error msg, and wait a key 30 | 31 | // force console to move out 32 | void CON_ToggleOff (void); 33 | -------------------------------------------------------------------------------- /win32/win_vid.h: -------------------------------------------------------------------------------- 1 | 2 | // win_vid.h 3 | 4 | #ifndef __WIN_VID_H__ 5 | #define __WIN_VID_H__ 6 | 7 | #include "../command.h" 8 | #include "../screen.h" 9 | 10 | // wait for page flipping to end or not 11 | extern consvar_t cv_vidwait; 12 | 13 | // these are utilised among different display drivers (glide/ddraw/dosvesa/..) 14 | extern int numvidmodes; //total number of DirectDraw display modes 15 | extern vmode_t *pvidmodes; //start of videomodes list. 16 | 17 | 18 | // setup a video mode, this is to be called from the menu 19 | int VID_SetMode (int modenum); 20 | 21 | BOOL VID_FreeAndAllocVidbuffer (viddef_t *lvid); 22 | 23 | // uses memcpy 24 | void VID_BlitLinearScreen (void *srcptr, void *destptr, 25 | int width, int height, 26 | int srcrowbytes, int destrowbytes); 27 | 28 | #endif //__WIN_VID_H__ -------------------------------------------------------------------------------- /LINUX_X/sndserv/strcmp.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include "strcmp.h" 3 | 4 | int strcasecmp (const char *a, const char *b) 5 | { 6 | const char *p; 7 | const char *q; 8 | 9 | for (p = a, q = b; *p && *q; p++, q++) 10 | { 11 | int diff = tolower(*p) - tolower(*q); 12 | if (diff) return diff; 13 | } 14 | if (*p) return 1; /* p was longer than q */ 15 | if (*q) return -1; /* p was shorter than q */ 16 | return 0; /* Exact match */ 17 | } 18 | 19 | int strncasecmp (const char *a, const char *b, int n) 20 | { 21 | const char *p; 22 | const char *q; 23 | 24 | for (p = a, q = b; /*NOTHING*/; p++, q++) 25 | { 26 | int diff; 27 | if (p == a + n) return 0; /* Match up to n characters */ 28 | if (!(*p && *q)) return *p - *q; 29 | diff = tolower(*p) - tolower(*q); 30 | if (diff) return diff; 31 | } 32 | /*NOTREACHED*/ 33 | } 34 | -------------------------------------------------------------------------------- /m_cheat.h: -------------------------------------------------------------------------------- 1 | // Cheat code checking. 2 | 3 | #ifndef __M_CHEAT__ 4 | #define __M_CHEAT__ 5 | 6 | #include "d_event.h" 7 | 8 | 9 | // 10 | // CHEAT SEQUENCE PACKAGE 11 | // 12 | 13 | #define SCRAMBLE(a) \ 14 | ((((a)&1)<<7) + (((a)&2)<<5) + ((a)&4) + (((a)&8)<<1) \ 15 | + (((a)&16)>>1) + ((a)&32) + (((a)&64)>>5) + (((a)&128)>>7)) 16 | 17 | typedef struct 18 | { 19 | unsigned char* sequence; 20 | unsigned char* p; 21 | 22 | } cheatseq_t; 23 | 24 | int cht_CheckCheat ( cheatseq_t* cht, 25 | char key ); 26 | 27 | 28 | void cht_GetParam ( cheatseq_t* cht, 29 | char* buffer ); 30 | 31 | boolean cht_Responder (event_t* ev); 32 | 33 | #endif 34 | //----------------------------------------------------------------------------- 35 | // 36 | // $Log:$ 37 | // 38 | //----------------------------------------------------------------------------- 39 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Sonic Robo Blast 2 2 | #### September 14, 1999 Source Code 3 | #### Release by SSNTails ( www.youtube.com/@ssntails ) 4 | #### https://github.com/SSNTails/SRB2SuperEarly 5 | #### Special thanks to Saxman for preservation! 6 | 7 | Here is a VERY early copy of the source code that I sent to my friend Saxman on September 14, 1999. It is so early, it is almost stock Doom Legacy v1.28. You can find edits made by searching for the string "Tails". 8 | 9 | If you get an error, "I_RegisterSong: StreamBufferSetup FAILED", that means you must use the -nomusic parameter to launch the game. 10 | 11 | #### Unlike the February 2000 Prototype, this code HAS NOT been modified to function on modern systems! 12 | 13 | I believe it is possible to pull the February 2000 prototype backwards to be compatible with this source code. 14 | 15 | #### Pull Requests are welcome! Want to fix a bug? Add the new SDL2 layer? Those are just a few ideas. 16 | 17 | 18 | ~SSNTails 19 | -------------------------------------------------------------------------------- /asm_defs.inc: -------------------------------------------------------------------------------- 1 | 2 | // 3 | // asm_defs.h : must match the C structures !!! 4 | // 5 | 6 | #ifndef __ASM_DEFS__ 7 | #define __ASM_DEFS__ 8 | 9 | // this makes variables more noticable, 10 | // and make the label match with C code 11 | 12 | // Linux, unlike DOS, has no "_" 19990119 by Kin 13 | #ifdef LINUX 14 | #define C(label) label 15 | #else 16 | #define C(label) _##label 17 | #endif 18 | 19 | /* This is a more readable way to access the arguments passed from C code */ 20 | /* PLEASE NOTE: it is supposed that all arguments passed from C code are */ 21 | /* 32bit integer (int, long, and most *pointers) */ 22 | #define ARG1 8(%ebp) 23 | #define ARG2 12(%ebp) 24 | #define ARG3 16(%ebp) 25 | #define ARG4 20(%ebp) 26 | #define ARG5 24(%ebp) 27 | #define ARG6 28(%ebp) 28 | #define ARG7 32(%ebp) 29 | #define ARG8 36(%ebp) 30 | #define ARG9 40(%ebp) //(c)tm ... Allegro by Shawn Hargreaves. 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /dstrings.h: -------------------------------------------------------------------------------- 1 | // DOOM strings, by language. 2 | #ifndef __DSTRINGS__ 3 | #define __DSTRINGS__ 4 | 5 | 6 | // All important printed strings. 7 | // Language selection (message strings). 8 | // Use -DFRENCH etc. 9 | 10 | #ifdef FRENCH 11 | #include "d_french.h" 12 | #else 13 | #include "d_englsh.h" 14 | #endif 15 | 16 | // Misc. other strings. 17 | #define SAVEGAMENAME "doomsav" 18 | 19 | // 20 | // File locations, 21 | // relative to current position. 22 | // Path names are OS-sensitive. 23 | // 24 | #define DEVMAPS "devmaps" 25 | #define DEVDATA "devdata" 26 | 27 | 28 | // Not done in french? 29 | 30 | // QuitDOOM messages 31 | //added:02-01-98: "22 messages - 7 fucking messages = 15 cool messages" ! 32 | #define NUM_QUITMESSAGES 15 33 | 34 | extern char* endmsg[]; 35 | 36 | 37 | #endif 38 | //----------------------------------------------------------------------------- 39 | // 40 | // $Log:$ 41 | // 42 | //----------------------------------------------------------------------------- 43 | -------------------------------------------------------------------------------- /win32/hwr_main.h: -------------------------------------------------------------------------------- 1 | // hwr_main.h : 3D render mode functions 2 | 3 | #include "hwr_drv.h" 4 | 5 | #include "../am_map.h" 6 | #include "../d_player.h" 7 | #include "../r_defs.h" 8 | 9 | // Startup & Shutdown the hardware mode renderer 10 | void HWR_Startup (void); 11 | void HWR_Shutdown (void); 12 | 13 | void HWR_clearAutomap (void); 14 | void HWR_drawAMline (fline_t* fl, int color); 15 | void HWR_FadeScreenMenuBack (unsigned long color, int height); 16 | void HWR_RenderPlayerView (int viewnumber, player_t* player); 17 | void HWR_DrawViewBorder (int clearlines); 18 | void HWR_DrawFlatFill (int x, int y, int w, int h, int flatlumpnum); 19 | void HWR_Screenshot (void); 20 | void HWR_InitTextureMapping (void); 21 | void HWR_SetViewSize (int blocks); 22 | void HWR_ScalePatch (BOOL bScalePatch); 23 | void HWR_DrawPatch (GlidePatch_t* gpatch, int x, int y); 24 | void HWR_Make3DfxPatch (patch_t* patch, GlidePatch_t* grPatch); 25 | void HWR_CreatePlanePolygons (int bspnum); 26 | void HWR_PrepLevelCache (int numtextures, int numflats); 27 | -------------------------------------------------------------------------------- /f_wipe.h: -------------------------------------------------------------------------------- 1 | 2 | // f_wipe.h : Mission start screen wipe/melt, special effects. 3 | 4 | 5 | #ifndef __F_WIPE_H__ 6 | #define __F_WIPE_H__ 7 | 8 | //-------------------------------------------------------------------------- 9 | // SCREEN WIPE PACKAGE 10 | //-------------------------------------------------------------------------- 11 | 12 | enum 13 | { 14 | // simple gradual pixel change for 8-bit only 15 | wipe_ColorXForm, 16 | 17 | // weird screen melt 18 | wipe_Melt, 19 | 20 | wipe_NUMWIPES 21 | }; 22 | 23 | 24 | int wipe_StartScreen 25 | ( int x, 26 | int y, 27 | int width, 28 | int height ); 29 | 30 | 31 | int wipe_EndScreen 32 | ( int x, 33 | int y, 34 | int width, 35 | int height ); 36 | 37 | 38 | int wipe_ScreenWipe 39 | ( int wipeno, 40 | int x, 41 | int y, 42 | int width, 43 | int height, 44 | int ticks ); 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /byteptr.h: -------------------------------------------------------------------------------- 1 | #define WRITEBYTE(p,b) *((byte *)p)++ = b 2 | #define WRITECHAR(p,b) *((char *)p)++ = b 3 | #define WRITESHORT(p,b) *((short *)p)++ = b 4 | #define WRITEUSHORT(p,b) *((USHORT *)p)++ = b 5 | #define WRITELONG(p,b) *((long *)p)++ = b 6 | #define WRITEULONG(p,b) *((ULONG *)p)++ = b 7 | #define WRITEFIXED(p,b) *((fixed_t*)p)++ = b 8 | #define WRITESTRING(p,b) { int tmp_i=0; do { WRITECHAR(p,b[tmp_i]); } while(b[tmp_i++]); } 9 | #define WRITESTRINGN(p,b,n) { int tmp_i=0; do { WRITECHAR(p,b[tmp_i]); if(!b[tmp_i]) break;tmp_i++; } while(tmp_i> FRACBITS; 17 | } 18 | fixed_t FixedDiv2 (fixed_t a, fixed_t b) 19 | { 20 | #if 0 21 | INT64 c; 22 | c = ((INT64)a<<16) / ((INT64)b); 23 | return (fixed_t) c; 24 | #endif 25 | 26 | double c; 27 | 28 | c = ((double)a) / ((double)b) * FRACUNIT; 29 | 30 | if (c >= 2147483648.0 || c < -2147483648.0) 31 | I_Error("FixedDiv: divide by zero"); 32 | return (fixed_t) c; 33 | } 34 | 35 | /* 36 | // 37 | // FixedDiv, C version. 38 | // 39 | fixed_t FixedDiv ( fixed_t a, fixed_t b ) 40 | { 41 | //I_Error("",(long)a,(long)b); 42 | 43 | if ( (abs(a)>>14) >= abs(b)) 44 | return (a^b)<0 ? MININT : MAXINT; 45 | 46 | return FixedDiv2 (a,b); 47 | } 48 | */ 49 | #endif // useasm 50 | -------------------------------------------------------------------------------- /LINUX_X/i_cdmus.c: -------------------------------------------------------------------------------- 1 | 2 | // i_cdmus.c : cd music interface 3 | // stub for compile 4 | // define for boolean!!! 5 | #include "doomtype.h" 6 | #include "i_sound.h" 7 | // added for 1.27 19990220 by Kin 8 | #include "command.h" 9 | 10 | consvar_t cd_volume = {"cd_volume","31",CV_SAVE}; 11 | consvar_t cdUpdate = {"cd_update","1",CV_SAVE}; 12 | 13 | // pause cd music 14 | void I_StopCD (void) 15 | { 16 | } 17 | 18 | // continue after a pause 19 | void I_ResumeCD (void) 20 | { 21 | } 22 | 23 | 24 | void I_ShutdownCD (void) 25 | { 26 | } 27 | 28 | void I_InitCD (void) 29 | { 30 | } 31 | 32 | 33 | 34 | // loop/go to next track when track is finished (if cd_update var is true) 35 | // update the volume when it has changed (from console/menu) 36 | // TODO: check for cd change and restart music ? 37 | // 38 | void I_UpdateCD (void) 39 | { 40 | } 41 | 42 | 43 | // play the cd...ooxx is it a bug of gcc? 44 | void I_PlayCD (int track, boolean looping) 45 | { 46 | } 47 | 48 | 49 | // volume : logical cd audio volume 0-31 (hardware is 0-255) 50 | int I_SetVolumeCD (int volume) 51 | { 52 | return 0; 53 | } 54 | -------------------------------------------------------------------------------- /fabdoom.dsw: -------------------------------------------------------------------------------- 1 | Microsoft Developer Studio Workspace File, Format Version 6.00 2 | # WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE! 3 | 4 | ############################################################################### 5 | 6 | Project: "fabdoom"=.\fabdoom.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "r_d3d"=.\win32\r_d3d\r_d3d.dsp - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | Project: "r_glide"=.\win32\r_glide\r_glide.dsp - Package Owner=<4> 31 | 32 | Package=<5> 33 | {{{ 34 | }}} 35 | 36 | Package=<4> 37 | {{{ 38 | }}} 39 | 40 | ############################################################################### 41 | 42 | Global: 43 | 44 | Package=<5> 45 | {{{ 46 | }}} 47 | 48 | Package=<3> 49 | {{{ 50 | }}} 51 | 52 | ############################################################################### 53 | 54 | -------------------------------------------------------------------------------- /i_video.h: -------------------------------------------------------------------------------- 1 | // System specific interface stuff. 2 | 3 | 4 | #ifndef __I_VIDEO__ 5 | #define __I_VIDEO__ 6 | 7 | 8 | #include "doomtype.h" 9 | 10 | #ifdef __GNUG__ 11 | #pragma interface 12 | #endif 13 | 14 | typedef enum { 15 | render_soft = 1, 16 | render_glide = 2, 17 | render_d3d = 3 18 | } rendermode_t; 19 | 20 | extern rendermode_t rendermode; 21 | 22 | // use highcolor modes if true 23 | extern boolean highcolor; 24 | 25 | void I_StartupGraphics (void); //setup video mode 26 | void I_ShutdownGraphics(void); //restore old video mode 27 | 28 | // Takes full 8 bit values. 29 | void I_SetPalette (byte* palette); 30 | 31 | void I_UpdateNoBlit (void); 32 | void I_FinishUpdate (void); 33 | 34 | // Wait for vertical retrace or pause a bit. 35 | void I_WaitVBL(int count); 36 | 37 | void I_ReadScreen (byte* scr); 38 | 39 | void I_BeginRead (void); 40 | void I_EndRead (void); 41 | 42 | #endif 43 | //----------------------------------------------------------------------------- 44 | // 45 | // $Log:$ 46 | // 47 | //----------------------------------------------------------------------------- 48 | -------------------------------------------------------------------------------- /am_map.h: -------------------------------------------------------------------------------- 1 | // AutoMap module. 2 | 3 | #ifndef __AMMAP_H__ 4 | #define __AMMAP_H__ 5 | 6 | #include "d_event.h" 7 | 8 | typedef struct 9 | { 10 | int x, y; 11 | } fpoint_t; 12 | 13 | typedef struct 14 | { 15 | fpoint_t a, b; 16 | } fline_t; 17 | 18 | // Used by ST StatusBar stuff. 19 | #define AM_MSGHEADER (('a'<<24)+('m'<<16)) 20 | #define AM_MSGENTERED (AM_MSGHEADER | ('e'<<8)) 21 | #define AM_MSGEXITED (AM_MSGHEADER | ('x'<<8)) 22 | 23 | extern boolean am_recalc; //added:05-02-98:true if screen size changes 24 | extern boolean automapactive; // In AutoMap mode? 25 | 26 | // Called by main loop. 27 | boolean AM_Responder (event_t* ev); 28 | 29 | // Called by main loop. 30 | void AM_Ticker (void); 31 | 32 | // Called by main loop, 33 | // called instead of view drawer if automap active. 34 | void AM_Drawer (void); 35 | 36 | // Called to force the automap to quit 37 | // if the level is completed while it is up. 38 | void AM_Stop (void); 39 | 40 | 41 | #endif 42 | //----------------------------------------------------------------------------- 43 | // 44 | // $Log:$ 45 | // 46 | //----------------------------------------------------------------------------- 47 | -------------------------------------------------------------------------------- /wi_stuff.h: -------------------------------------------------------------------------------- 1 | // Intermission. 2 | 3 | #ifndef __WI_STUFF__ 4 | #define __WI_STUFF__ 5 | 6 | //#include "v_video.h" 7 | 8 | #include "doomdef.h" 9 | #include "d_player.h" 10 | 11 | // States for the intermission 12 | 13 | typedef enum 14 | { 15 | NoState = -1, 16 | StatCount, 17 | ShowNextLoc 18 | 19 | } stateenum_t; 20 | 21 | //added:05-02-98: 22 | typedef struct { 23 | int count; 24 | int num; 25 | int color; 26 | char *name; 27 | } fragsort_t; 28 | 29 | // Called by main loop, animate the intermission. 30 | void WI_Ticker (void); 31 | 32 | // Called by main loop, 33 | // draws the intermission directly into the screen buffer. 34 | void WI_Drawer (void); 35 | 36 | // Setup for an intermission screen. 37 | void WI_Start(wbstartstruct_t* wbstartstruct); 38 | 39 | boolean teamingame(int teamnum); 40 | 41 | // draw ranckings 42 | void WI_drawRancking(char *title,int x,int y,fragsort_t *fragtable 43 | , int scorelines, boolean large, int white); 44 | 45 | 46 | #endif 47 | //----------------------------------------------------------------------------- 48 | // 49 | // $Log:$ 50 | // 51 | //----------------------------------------------------------------------------- 52 | -------------------------------------------------------------------------------- /LINUX_X/i_main.c: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // $Log:$ 18 | // 19 | // DESCRIPTION: 20 | // Main program, simply calls D_DoomMain high level loop. 21 | // 22 | //----------------------------------------------------------------------------- 23 | 24 | static const char 25 | rcsid[] = "$Id: i_main.c,v 1.4 1997/02/03 22:45:10 b1 Exp $"; 26 | 27 | 28 | 29 | #include "doomdef.h" 30 | 31 | #include "m_argv.h" 32 | #include "d_main.h" 33 | 34 | int 35 | main 36 | ( int argc, 37 | char** argv ) 38 | { 39 | myargc = argc; 40 | myargv = argv; 41 | 42 | D_DoomMain (); 43 | 44 | return 0; 45 | } 46 | -------------------------------------------------------------------------------- /LINUX_X/musserv/usleep.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | #ifdef SCOOS5 5 | #include 6 | #endif 7 | 8 | #if defined(SCOUW2) || defined(SCOUW7) 9 | #include 10 | #endif 11 | 12 | #include "usleep.h" 13 | 14 | extern int pause (void); 15 | extern pid_t getpid (void); 16 | 17 | volatile static int waiting; 18 | 19 | static void getalrm(i) 20 | int i; 21 | { 22 | waiting = 0; 23 | } 24 | 25 | void usleep(t) 26 | unsigned t; 27 | { 28 | static struct itimerval it, ot; 29 | void (*oldsig)(); 30 | long nt; 31 | 32 | it.it_value.tv_sec = t / 1000000; 33 | it.it_value.tv_usec = t % 1000000; 34 | oldsig = (void (*)()) signal(SIGALRM, getalrm); 35 | waiting = 1; 36 | if (setitimer(ITIMER_REAL, &it, &ot)) 37 | return /*error*/; 38 | while (waiting) { 39 | pause(); 40 | } 41 | signal(SIGALRM, oldsig); 42 | if (ot.it_value.tv_sec + ot.it_value.tv_usec > 0) { 43 | nt = ((ot.it_value.tv_sec * 1000000L) + ot.it_value.tv_usec) - t; 44 | if (nt <= 0) { 45 | kill(getpid(), SIGALRM); 46 | } else { 47 | ot.it_value.tv_sec = nt / 1000000; 48 | ot.it_value.tv_usec = nt % 1000000; 49 | setitimer(ITIMER_REAL, &ot, 0); 50 | } 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /r_segs.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // Refresh module, drawing LineSegs from BSP. 19 | // 20 | //----------------------------------------------------------------------------- 21 | 22 | 23 | #ifndef __R_SEGS__ 24 | #define __R_SEGS__ 25 | 26 | 27 | #ifdef __GNUG__ 28 | #pragma interface 29 | #endif 30 | 31 | 32 | void 33 | R_RenderMaskedSegRange 34 | ( drawseg_t* ds, 35 | int x1, 36 | int x2 ); 37 | 38 | 39 | #endif 40 | //----------------------------------------------------------------------------- 41 | // 42 | // $Log:$ 43 | // 44 | //----------------------------------------------------------------------------- 45 | -------------------------------------------------------------------------------- /d_main.h: -------------------------------------------------------------------------------- 1 | 2 | // d_main.h : game startup, and main loop code, system specific 3 | 4 | #ifndef __D_MAIN__ 5 | #define __D_MAIN__ 6 | 7 | #include "d_event.h" 8 | #include "w_wad.h" // for MAX_WADFILES 9 | 10 | 11 | //extern char* startupwadfiles[MAX_WADFILES]; 12 | 13 | 14 | //void D_AddFile (char *file); 15 | 16 | // make sure not to write back the config until it's been correctly loaded 17 | extern ULONG rendergametic; 18 | 19 | // the infinite loop of D_DoomLoop() called from win_main for windows version 20 | void D_DoomInnerLoop (void); 21 | 22 | // 23 | // D_DoomMain() 24 | // Not a globally visible function, just included for source reference, 25 | // calls all startup code, parses command line options. 26 | // If not overrided by user input, calls N_AdvanceDemo. 27 | // 28 | void D_DoomMain (void); 29 | 30 | // Called by IO functions when input is detected. 31 | void D_PostEvent (event_t* ev); 32 | void D_PostEvent_end (void); // delimiter for locking memory 33 | 34 | void D_ProcessEvents (void); 35 | void D_DoAdvanceDemo (void); 36 | 37 | // 38 | // BASE LEVEL 39 | // 40 | void D_PageTicker (void); 41 | // pagename is lumpname of a 320x200 patch to fill the screen 42 | void D_PageDrawer (char* pagename); 43 | void D_AdvanceDemo (void); 44 | void D_StartTitle (void); 45 | 46 | #endif //__D_MAIN__ 47 | -------------------------------------------------------------------------------- /m_random.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // 19 | // 20 | //----------------------------------------------------------------------------- 21 | 22 | 23 | #ifndef __M_RANDOM__ 24 | #define __M_RANDOM__ 25 | 26 | 27 | #include "doomtype.h" 28 | 29 | 30 | 31 | // Returns a number from 0 to 255, 32 | // from a lookup table. 33 | byte M_Random (void); 34 | 35 | // As M_Random, but used only by the play simulation. 36 | byte P_Random (void); 37 | 38 | // Fix randoms for demos. 39 | void M_ClearRandom (void); 40 | 41 | 42 | #endif 43 | //----------------------------------------------------------------------------- 44 | // 45 | // $Log:$ 46 | // 47 | //----------------------------------------------------------------------------- 48 | -------------------------------------------------------------------------------- /g_state.h: -------------------------------------------------------------------------------- 1 | // g_state.h : Doom/Hexen game states 2 | 3 | #ifndef __G_STATE__ 4 | #define __G_STATE__ 5 | 6 | #include "doomtype.h" 7 | 8 | // skill levels 9 | typedef enum 10 | { 11 | sk_baby, 12 | sk_easy, 13 | sk_medium, 14 | sk_hard, 15 | sk_nightmare 16 | } skill_t; 17 | 18 | // the current state of the game 19 | typedef enum 20 | { 21 | GS_LEVEL, // we are playing 22 | GS_INTERMISSION, // gazing at the intermission screen 23 | GS_FINALE, // game final animation 24 | GS_DEMOSCREEN, // looking at a demo 25 | //legacy 26 | GS_DEDICATEDSERVER, // added 27-4-98 : new state for dedicated server 27 | GS_WAITINGPLAYERS // added 3-9-98 : waiting player in net game 28 | } gamestate_t; 29 | 30 | typedef enum 31 | { 32 | ga_nothing, 33 | ga_loadlevel, 34 | ga_playdemo, 35 | ga_completed, 36 | ga_victory, 37 | ga_worlddone, 38 | ga_screenshot, 39 | //HeXen 40 | /* 41 | ga_initnew, 42 | ga_newgame, 43 | ga_loadgame, 44 | ga_savegame, 45 | ga_leavemap, 46 | ga_singlereborn 47 | */ 48 | } gameaction_t; 49 | 50 | 51 | 52 | extern gamestate_t gamestate; 53 | extern gameaction_t gameaction; 54 | extern skill_t gameskill; 55 | 56 | extern boolean demoplayback; 57 | 58 | #endif //__G_STATE__ 59 | -------------------------------------------------------------------------------- /f_finale.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // 19 | // 20 | //----------------------------------------------------------------------------- 21 | 22 | 23 | #ifndef __F_FINALE__ 24 | #define __F_FINALE__ 25 | 26 | 27 | #include "doomtype.h" 28 | #include "d_event.h" 29 | // 30 | // FINALE 31 | // 32 | 33 | // Called by main loop. 34 | boolean F_Responder (event_t* ev); 35 | 36 | // Called by main loop. 37 | void F_Ticker (void); 38 | 39 | // Called by main loop. 40 | void F_Drawer (void); 41 | 42 | 43 | void F_StartFinale (void); 44 | 45 | 46 | 47 | 48 | #endif 49 | //----------------------------------------------------------------------------- 50 | // 51 | // $Log:$ 52 | // 53 | //----------------------------------------------------------------------------- 54 | -------------------------------------------------------------------------------- /LINUX_X/searchp.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Written by Udo Munk 3 | * 4 | * I don't care what you do with this and I'm not responsible for 5 | * anything which might happen if you use this. This code is provided 6 | * AS IS and there are no guarantees, none. 7 | */ 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | /* 16 | * See if file is in any directory in the PATH environment variable. 17 | * If yes return a complete pathname, if not found just return the filename. 18 | */ 19 | char *searchpath(char *file) { 20 | char *path; 21 | char *dir; 22 | static char b[2048]; 23 | struct stat s; 24 | char pb[2048]; 25 | 26 | /* get PATH, if not set just return filename, might be in cwd */ 27 | if ((path = getenv("PATH")) == NULL) 28 | return(file); 29 | 30 | /* we have to do this because strtok() is destructive */ 31 | strcpy(pb, path); 32 | 33 | /* get first directory */ 34 | dir = strtok(pb, ":"); 35 | 36 | /* loop over the directories in PATH and see if the file is there */ 37 | while (dir) { 38 | /* build filename from directory/filename */ 39 | strcpy(b, dir); 40 | strcat(b, "/"); 41 | strcat(b, file); 42 | if (stat(b, &s) == 0) { 43 | return(b); /* yep, there it is */ 44 | } 45 | 46 | /* get next directory */ 47 | dir = strtok(NULL, ":"); 48 | } 49 | 50 | /* hm, not found, just return filename, again, might be in cwd */ 51 | return(file); 52 | } 53 | -------------------------------------------------------------------------------- /DJGPPDOS/I_MAIN.C: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // $Log:$ 18 | // 19 | // DESCRIPTION: 20 | // Main program, simply calls D_DoomMain high level loop. 21 | // 22 | //----------------------------------------------------------------------------- 23 | 24 | static const char 25 | rcsid[] = "$Id: i_main.c,v 1.4 1997/02/03 22:45:10 b1 Exp $"; 26 | 27 | 28 | #include "../doomdef.h" 29 | 30 | #include "../m_argv.h" 31 | #include "../d_main.h" 32 | 33 | #include "../i_system.h" 34 | 35 | int 36 | main ( int argc, 37 | char** argv ) 38 | { 39 | myargc = argc; 40 | myargv = argv; 41 | 42 | //added:03-01-98: 43 | // Setup signal handlers and other stuff BEFORE ANYTHING ELSE! 44 | I_StartupSystem(); 45 | 46 | D_DoomMain (); 47 | 48 | //added:03-01-98: 49 | // hmmm... it will never go here. 50 | 51 | return 0; 52 | } 53 | -------------------------------------------------------------------------------- /d_items.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // Items: key cards, artifacts, weapon, ammunition. 19 | // 20 | //----------------------------------------------------------------------------- 21 | 22 | 23 | #ifndef __D_ITEMS__ 24 | #define __D_ITEMS__ 25 | 26 | #include "doomdef.h" 27 | 28 | #ifdef __GNUG__ 29 | #pragma interface 30 | #endif 31 | 32 | 33 | // Weapon info: sprite frames, ammunition use. 34 | typedef struct 35 | { 36 | ammotype_t ammo; 37 | int upstate; 38 | int downstate; 39 | int readystate; 40 | int atkstate; 41 | int flashstate; 42 | 43 | } weaponinfo_t; 44 | 45 | extern weaponinfo_t weaponinfo[NUMWEAPONS]; 46 | 47 | #endif 48 | //----------------------------------------------------------------------------- 49 | // 50 | // $Log:$ 51 | // 52 | //----------------------------------------------------------------------------- 53 | -------------------------------------------------------------------------------- /d_netcmd.h: -------------------------------------------------------------------------------- 1 | 2 | // d_netcmd.h : host/client network commands 3 | // commands are executed through the command buffer 4 | // like console commands 5 | 6 | #ifndef __D_NETCMD__ 7 | #define __D_NETCMD__ 8 | 9 | #include "command.h" 10 | 11 | // console vars 12 | extern consvar_t cv_playername; 13 | extern consvar_t cv_playercolor; 14 | extern consvar_t cv_usemouse; 15 | extern consvar_t cv_usejoystick; 16 | extern consvar_t cv_autoaim; 17 | 18 | // normaly in p_mobj but the .h in not read ! 19 | extern consvar_t cv_itemrespawntime; 20 | extern consvar_t cv_itemrespawn; 21 | extern consvar_t cv_respawnmonsters; 22 | extern consvar_t cv_respawnmonsterstime; 23 | 24 | // added 16-6-98 : splitscreen 25 | extern consvar_t cv_splitscreen; 26 | 27 | // 02-08-98 : r_things.c 28 | extern consvar_t cv_skin; 29 | 30 | // secondary splitscreen player 31 | extern consvar_t cv_playername2; 32 | extern consvar_t cv_playercolor2; 33 | extern consvar_t cv_skin2; 34 | 35 | extern consvar_t cv_teamplay; 36 | extern consvar_t cv_teamdamage; 37 | extern consvar_t cv_fraglimit; 38 | extern consvar_t cv_timelimit; 39 | 40 | typedef enum { 41 | XD_NAMEANDCOLOR=1, 42 | XD_WEAPONPREF, 43 | XD_EXIT, 44 | XD_QUIT, 45 | XD_KICK, 46 | XD_NETVAR, 47 | XD_SAY, 48 | XD_MAP, 49 | XD_EXITLEVEL, 50 | XD_LOADGAME, 51 | XD_SAVEGAME, 52 | XD_PAUSE, 53 | MAXNETXCMD 54 | } netxcmd_t; 55 | 56 | // add game commands, needs cleanup 57 | void D_RegisterClientCommands (void); 58 | void D_SendPlayerConfig(void); 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /p_setup.h: -------------------------------------------------------------------------------- 1 | // Setup a game, startup stuff. 2 | 3 | 4 | #ifndef __P_SETUP__ 5 | #define __P_SETUP__ 6 | 7 | #include "doomdata.h" 8 | 9 | // Player spawn spots for deathmatch. 10 | #define MAX_DM_STARTS 64 11 | extern mapthing_t deathmatchstarts[MAX_DM_STARTS]; 12 | extern mapthing_t* deathmatch_p; 13 | 14 | extern int lastloadedmaplumpnum; // for comparative savegame 15 | // 16 | // MAP used flats lookup table 17 | // 18 | typedef struct 19 | { 20 | char name[8]; // resource name from wad 21 | int lumpnum; // lump number of the flat 22 | 23 | // for flat animation 24 | int baselumpnum; 25 | int animseq; // start pos. in the anim sequence 26 | int numpics; 27 | int speed; 28 | 29 | //hack add water splash for old water texture 30 | boolean iswater; // water texture 31 | 32 | } levelflat_t; 33 | 34 | extern int numlevelflats; 35 | extern levelflat_t* levelflats; 36 | int P_AddLevelFlat (char* flatname, levelflat_t* levelflat); 37 | 38 | // NOT called by W_Ticker. Fixme. 39 | boolean P_SetupLevel 40 | ( int episode, 41 | int map, 42 | int playermask, 43 | skill_t skill, 44 | char* mapname); 45 | 46 | boolean P_AddWadFile (char* wadfilename); 47 | 48 | 49 | #endif 50 | //----------------------------------------------------------------------------- 51 | // 52 | // $Log:$ 53 | // 54 | //----------------------------------------------------------------------------- 55 | -------------------------------------------------------------------------------- /p_saveg.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // Savegame I/O, archiving, persistence. 19 | // 20 | //----------------------------------------------------------------------------- 21 | 22 | 23 | #ifndef __P_SAVEG__ 24 | #define __P_SAVEG__ 25 | 26 | 27 | #ifdef __GNUG__ 28 | #pragma interface 29 | #endif 30 | 31 | 32 | // Persistent storage/archiving. 33 | // These are the load / save game routines. 34 | void P_ArchivePlayers (void); 35 | void P_UnArchivePlayers (void); 36 | void P_ArchiveWorld (void); 37 | void P_UnArchiveWorld (void); 38 | void P_ArchiveThinkers (void); 39 | void P_UnArchiveThinkers (void); 40 | void P_ArchiveSpecials (void); 41 | void P_UnArchiveSpecials (void); 42 | 43 | extern byte* save_p; 44 | 45 | 46 | #endif 47 | //----------------------------------------------------------------------------- 48 | // 49 | // $Log:$ 50 | // 51 | //----------------------------------------------------------------------------- 52 | -------------------------------------------------------------------------------- /vid_copy.s: -------------------------------------------------------------------------------- 1 | // 2 | // vid_copy.S : code for updating the linear frame buffer screen. 3 | // 4 | 5 | #include "asm_defs.inc" // structures, must match the C structures! 6 | 7 | // DJGPPv2 is as fast as this one, but then someone may compile with a less 8 | // good version of DJGPP than mine, so this little asm will do the trick! 9 | 10 | #define srcptr 4+16 11 | #define destptr 8+16 12 | #define width 12+16 13 | #define height 16+16 14 | #define srcrowbytes 20+16 15 | #define destrowbytes 24+16 16 | 17 | // VID_BlitLinearScreen( src, dest, width, height, srcwidth, destwidth ); 18 | // width is given as BYTES 19 | 20 | .globl C(VID_BlitLinearScreen) 21 | C(VID_BlitLinearScreen): 22 | pushl %ebp // preserve caller's stack frame 23 | pushl %edi 24 | pushl %esi // preserve register variables 25 | pushl %ebx 26 | 27 | cld 28 | movl srcptr(%esp),%esi 29 | movl destptr(%esp),%edi 30 | movl width(%esp),%ebx 31 | movl srcrowbytes(%esp),%eax 32 | subl %ebx,%eax 33 | movl destrowbytes(%esp),%edx 34 | subl %ebx,%edx 35 | shrl $2,%ebx 36 | movl height(%esp),%ebp 37 | LLRowLoop: 38 | movl %ebx,%ecx 39 | rep/movsl (%esi),(%edi) 40 | addl %eax,%esi 41 | addl %edx,%edi 42 | decl %ebp 43 | jnz LLRowLoop 44 | 45 | popl %ebx // restore register variables 46 | popl %esi 47 | popl %edi 48 | popl %ebp // restore the caller's stack frame 49 | 50 | ret 51 | -------------------------------------------------------------------------------- /i_joy.h: -------------------------------------------------------------------------------- 1 | 2 | // win_joy.h : share joystick information with game control code 3 | 4 | #ifndef __I_JOY_H__ 5 | #define __I_JOY_H__ 6 | 7 | #include "g_input.h" 8 | 9 | #define JOYAXISRANGE 1023 //faB: (1024-1) so we can do a right shift instead of division 10 | // (doesnt matter anyway, just give enough precision) 11 | // a gamepad will return -1, 0, or 1 in the event data 12 | // an analog type joystick will return a value 13 | // from -JOYAXISRANGE to +JOYAXISRANGE for each axis 14 | 15 | // detect a bug if we increase JOYBUTTONS above DIJOYSTATE's number of buttons 16 | #if (JOYBUTTONS > 32) 17 | #error "JOYBUTTONS is greater than DIJOYSTATE number of buttons" 18 | #endif 19 | 20 | // share some joystick information (maybe 2 for splitscreen), to the game input code, 21 | // actually, we need to know if it is a gamepad or analog controls 22 | 23 | struct JoyType_s { 24 | int bJoyNeedPoll; // if true, we MUST Poll() to get new joystick data, 25 | // that is: we NEED the DIRECTINPUTDEVICE2 ! (watchout NT compatibility) 26 | int bGamepadStyle; // this joystick is a gamepad, read: digital axes 27 | // if FALSE, interpret the joystick event data as JOYAXISRANGE 28 | // (see above) 29 | }; 30 | typedef struct JoyType_s JoyType_t; 31 | 32 | extern JoyType_t Joystick; //faB: may become an array (2 for splitscreen), I said: MAY BE... 33 | 34 | #endif // __I_JOY_H__ 35 | -------------------------------------------------------------------------------- /LINUX_X/i_net.c: -------------------------------------------------------------------------------- 1 | // win_net.c : network interface 2 | 3 | 4 | #include 5 | 6 | #include "../doomdef.h" 7 | 8 | #include "../i_system.h" 9 | #include "../d_event.h" 10 | #include "../d_net.h" 11 | #include "../m_argv.h" 12 | 13 | #include "../doomstat.h" 14 | 15 | #include "../i_net.h" 16 | 17 | #include "../z_zone.h" 18 | 19 | int I_InitTcpNetwork(void); 20 | // 21 | // NETWORKING 22 | // 23 | 24 | void Internal_Get(void) 25 | { 26 | I_Error("Get without netgame\n"); 27 | } 28 | 29 | void Internal_Send(void) 30 | { 31 | I_Error("Send without netgame\n"); 32 | } 33 | 34 | void Internal_FreeNodenum(int nodenum) 35 | {} 36 | 37 | // 38 | // I_InitNetwork 39 | // 40 | void I_InitNetwork (void) 41 | { 42 | int netgamepar; 43 | 44 | I_NetGet = Internal_Get; 45 | I_NetSend = Internal_Send; 46 | I_NetShutdown = NULL; 47 | I_NetFreeNodenum = Internal_FreeNodenum; 48 | 49 | netgamepar = M_CheckParm ("-net"); 50 | if(!netgamepar) 51 | { 52 | doomcom=Z_Malloc(sizeof(doomcom_t),PU_STATIC,NULL); 53 | memset(doomcom,0,sizeof(doomcom_t)); 54 | doomcom->id = DOOMCOM_ID; 55 | 56 | if(!I_InitTcpNetwork()) 57 | { 58 | netgame = false; 59 | server = true; 60 | multiplayer = false; 61 | 62 | doomcom->numplayers = doomcom->numnodes = 1; 63 | doomcom->deathmatch = false; 64 | doomcom->consoleplayer = 0; 65 | doomcom->ticdup = 1; 66 | doomcom->extratics = 0; 67 | return; 68 | } 69 | } // else net game 70 | else 71 | { 72 | I_Error("-net not supported, use -server and -connect\n" 73 | "see docs for more\n"); 74 | } 75 | // net game 76 | 77 | netgame = true; 78 | multiplayer = true; 79 | } 80 | -------------------------------------------------------------------------------- /win32/win_net.c: -------------------------------------------------------------------------------- 1 | // win_net.c : network interface 2 | 3 | 4 | #include 5 | 6 | #include "../doomdef.h" 7 | 8 | #include "../i_system.h" 9 | #include "../d_event.h" 10 | #include "../d_net.h" 11 | #include "../m_argv.h" 12 | 13 | #include "../doomstat.h" 14 | 15 | #include "../i_net.h" 16 | 17 | #include "../z_zone.h" 18 | 19 | int I_InitTcpNetwork(void); 20 | // 21 | // NETWORKING 22 | // 23 | 24 | void Internal_Get(void) 25 | { 26 | I_Error("Get without netgame\n"); 27 | } 28 | 29 | void Internal_Send(void) 30 | { 31 | I_Error("Send without netgame\n"); 32 | } 33 | 34 | void Internal_FreeNodenum(int nodenum) 35 | {} 36 | 37 | // 38 | // I_InitNetwork 39 | // 40 | void I_InitNetwork (void) 41 | { 42 | int netgamepar; 43 | 44 | I_NetGet = Internal_Get; 45 | I_NetSend = Internal_Send; 46 | I_NetShutdown = NULL; 47 | I_NetFreeNodenum = Internal_FreeNodenum; 48 | 49 | netgamepar = M_CheckParm ("-net"); 50 | if(!netgamepar) 51 | { 52 | doomcom=Z_Malloc(sizeof(doomcom_t),PU_STATIC,NULL); 53 | memset(doomcom,0,sizeof(doomcom_t)); 54 | doomcom->id = DOOMCOM_ID; 55 | 56 | if(!I_InitTcpNetwork()) 57 | { 58 | netgame = false; 59 | server = true; 60 | multiplayer = false; 61 | 62 | doomcom->numplayers = doomcom->numnodes = 1; 63 | doomcom->deathmatch = false; 64 | doomcom->consoleplayer = 0; 65 | doomcom->ticdup = 1; 66 | doomcom->extratics = 0; 67 | return; 68 | } 69 | } // else net game 70 | else 71 | { 72 | I_Error("External driver not yet implemented\n"); 73 | } 74 | // net game 75 | 76 | netgame = true; 77 | multiplayer = true; 78 | } 79 | -------------------------------------------------------------------------------- /LINUX_X/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 | -------------------------------------------------------------------------------- /p_inter.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // 19 | // 20 | //----------------------------------------------------------------------------- 21 | 22 | 23 | #ifndef __P_INTER__ 24 | #define __P_INTER__ 25 | 26 | 27 | #ifdef __GNUG__ 28 | #pragma interface 29 | #endif 30 | 31 | extern int ammopershoot[NUMWEAPONS]; 32 | 33 | // Boris hack : preferred weapons order 34 | void VerifFavoritWeapon (player_t *player); 35 | 36 | boolean P_GivePower(player_t*, int); 37 | void P_CheckFragLimit(player_t *p); 38 | 39 | //added:28-02-98: boooring handling of thing(s) on top of thing(s) 40 | /* BUGGY CODE 41 | void P_CheckSupportThings (mobj_t* mobj); 42 | void P_MoveSupportThings (mobj_t* mobj, fixed_t xmove, 43 | fixed_t ymove, 44 | fixed_t zmove); 45 | void P_LinkFloorThing(mobj_t* mobj); 46 | void P_UnlinkFloorThing(mobj_t* mobj); 47 | */ 48 | 49 | #endif 50 | //----------------------------------------------------------------------------- 51 | // 52 | // $Log:$ 53 | // 54 | //----------------------------------------------------------------------------- 55 | -------------------------------------------------------------------------------- /m_misc.h: -------------------------------------------------------------------------------- 1 | 2 | // m_misc.h : 3 | // Default Config File. 4 | // PCX Screenshots. 5 | // File i/o 6 | // Common used routines 7 | 8 | 9 | #ifndef __M_MISC__ 10 | #define __M_MISC__ 11 | 12 | 13 | #include "doomtype.h" 14 | #include "w_wad.h" 15 | 16 | // the file where all game vars and settings are saved 17 | #define CONFIGFILENAME "config.cfg" 18 | 19 | 20 | // 21 | // MISC 22 | // 23 | //=========================================================================== 24 | 25 | boolean FIL_WriteFile ( char const* name, 26 | void* source, 27 | int length ); 28 | 29 | int FIL_ReadFile ( char const* name, 30 | byte** buffer ); 31 | 32 | void FIL_DefaultExtension (char *path, char *extension); 33 | 34 | //added:11-01-98:now declared here for use by G_DoPlayDemo(), see there... 35 | void FIL_ExtractFileBase (char* path, char* dest); 36 | 37 | boolean FIL_CheckExtension (char *in); 38 | 39 | //=========================================================================== 40 | 41 | void M_ScreenShot (void); 42 | 43 | //=========================================================================== 44 | 45 | extern char configfile[MAX_WADPATH]; 46 | 47 | void Command_SaveConfig_f (void); 48 | void Command_LoadConfig_f (void); 49 | void Command_ChangeConfig_f (void); 50 | 51 | void M_FirstLoadConfig(void); 52 | //Fab:26-04-98: save game config : cvars, aliases.. 53 | void M_SaveConfig (char *filename); 54 | 55 | //=========================================================================== 56 | 57 | int M_DrawText ( int x, 58 | int y, 59 | boolean direct, 60 | char* string ); 61 | 62 | #endif 63 | -------------------------------------------------------------------------------- /win32/r_d3d/r_d3d.plg: -------------------------------------------------------------------------------- 1 | --------------------Configuration: r_d3d - Win32 Release-------------------- 2 | Begining build with project "J:\DevStudio\MyProjects\legacy\win32\r_d3d\r_d3d.dsp", at root. 3 | Active configuration is Win32 (x86) Dynamic-Link Library (based on Win32 (x86) Dynamic-Link Library) 4 | 5 | Project's tools are: 6 | "32-bit C/C++ Compiler for 80x86" with flags "/nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "__MSC__" /Fp"Release/r_d3d.pch" /YX /Fo"Release/" /Fd"Release/" /FD /c " 7 | "OLE Type Library Maker" with flags "/nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 " 8 | "Win32 Resource Compiler" with flags "/l 0x40c /d "NDEBUG" " 9 | "Browser Database Maker" with flags "/nologo /o"Release/r_d3d.bsc" " 10 | "COFF Linker for 80x86" with flags "dxguid.lib d3dim.lib ddraw.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /incremental:no /pdb:"Release/r_d3d.pdb" /machine:I386 /out:"h:\jeux\doom2dev\r_d3d.dll" /implib:"Release/r_d3d.lib" " 11 | "Custom Build" with flags "" 12 | "" with flags "" 13 | 14 | Creating temp file "D:\TEMP\RSP23B5.TMP" with contents 16 | Creating command line "link.exe @D:\TEMP\RSP23B5.TMP" 17 | Linking... 18 | Creating library Release/r_d3d.lib and object Release/r_d3d.exp 19 | 20 | 21 | 22 | r_d3d.dll - 0 error(s), 0 warning(s) 23 | -------------------------------------------------------------------------------- /d_event.h: -------------------------------------------------------------------------------- 1 | // d_event.h : event handling. 2 | 3 | #ifndef __D_EVENT__ 4 | #define __D_EVENT__ 5 | 6 | #include "doomtype.h" 7 | #include "g_state.h" 8 | 9 | // Input event types. 10 | typedef enum 11 | { 12 | ev_keydown, 13 | ev_keyup, 14 | ev_mouse, 15 | ev_joystick 16 | } evtype_t; 17 | 18 | // Event structure. 19 | typedef struct 20 | { 21 | evtype_t type; 22 | int data1; // keys / mouse/joystick buttons 23 | int data2; // mouse/joystick x move 24 | int data3; // mouse/joystick y move 25 | } event_t; 26 | 27 | 28 | 29 | // 30 | // Button/action code definitions. 31 | // 32 | 33 | //added:16-02-98: bit of value 64 doesnt seem to be used, 34 | // now its used to jump 35 | 36 | typedef enum 37 | { 38 | // Press "Fire". 39 | BT_ATTACK = 1, 40 | // Use button, to open doors, activate switches. 41 | BT_USE = 2, 42 | 43 | // Flag, weapon change pending. 44 | // If true, the next 3 bits hold weapon num. 45 | BT_CHANGE = 4, 46 | // The 3bit weapon mask and shift, convenience. 47 | BT_WEAPONMASK = (8+16+32), 48 | BT_WEAPONSHIFT = 3, 49 | 50 | // Jump button. 51 | BT_JUMP = 64, 52 | BT_EXTRAWEAPON = 128 53 | } buttoncode_t; 54 | 55 | 56 | 57 | 58 | // 59 | // GLOBAL VARIABLES 60 | // 61 | #define MAXEVENTS 64 62 | 63 | extern event_t events[MAXEVENTS]; 64 | extern int eventhead; 65 | extern int eventtail; 66 | 67 | extern gameaction_t gameaction; 68 | 69 | 70 | #endif 71 | //----------------------------------------------------------------------------- 72 | // 73 | // $Log:$ 74 | // 75 | //----------------------------------------------------------------------------- 76 | -------------------------------------------------------------------------------- /hu_stuff.h: -------------------------------------------------------------------------------- 1 | 2 | // hu_stuff.h : heads up displays 3 | // 4 | 5 | #ifndef __HU_STUFF_H__ 6 | #define __HU_STUFF_H__ 7 | 8 | 9 | #include "d_event.h" 10 | #include "w_wad.h" 11 | #include "wi_stuff.h" 12 | #include "r_defs.h" 13 | 14 | //------------------------------------ 15 | // heads up font 16 | //------------------------------------ 17 | #define HU_FONTSTART '!' // the first font characters 18 | #define HU_FONTEND '_' // the last font characters 19 | 20 | #define HU_FONTSIZE (HU_FONTEND - HU_FONTSTART + 1) 21 | 22 | 23 | #define HU_CROSSHAIRS 3 // maximum 9 see HU_Init(); 24 | 25 | 26 | //------------------------------------ 27 | // chat stuff 28 | //------------------------------------ 29 | #define HU_BROADCAST 5 // first char in chat message 30 | 31 | #define HU_MAXMSGLEN 80 32 | 33 | extern patch_t* hu_font[HU_FONTSIZE]; 34 | 35 | // P_DeathThink set this true to show scores while dead, in dmatch 36 | extern boolean hu_showscores; 37 | 38 | // init heads up data at game startup. 39 | void HU_Init(void); 40 | 41 | // reset heads up when consoleplayer respawns. 42 | void HU_Start(void); 43 | 44 | // 45 | boolean HU_Responder(event_t* ev); 46 | 47 | // 48 | void HU_Ticker(void); 49 | void HU_Drawer(void); 50 | char HU_dequeueChatChar(void); 51 | void HU_Erase(void); 52 | 53 | // used by console input 54 | char ForeignTranslation(unsigned char ch); 55 | 56 | // set chatmacros cvars point the original or dehacked texts, before 57 | // config.cfg is executed !! 58 | void HU_HackChatmacros (void); 59 | 60 | // chatmacro <0-9> "message" console command 61 | void Command_Chatmacro_f (void); 62 | 63 | int HU_CreateTeamFragTbl(fragsort_t *fragtab, 64 | int dmtotals[], 65 | int fragtbl[MAXPLAYERS][MAXPLAYERS]); 66 | 67 | #endif 68 | -------------------------------------------------------------------------------- /m_random.c: -------------------------------------------------------------------------------- 1 | // m_random.c : random number LUT. 2 | 3 | #include "doomtype.h" 4 | #include "m_random.h" 5 | // 6 | // M_Random 7 | // Returns a 0-255 number 8 | // 9 | byte rndtable[256] = { 10 | 0, 8, 109, 220, 222, 241, 149, 107, 75, 248, 254, 140, 16, 66 , 11 | 74, 21, 211, 47, 80, 242, 154, 27, 205, 128, 161, 89, 77, 36 , 12 | 95, 110, 85, 48, 212, 140, 211, 249, 22, 79, 200, 50, 28, 188 , 13 | 52, 140, 202, 120, 68, 145, 62, 70, 184, 190, 91, 197, 152, 224 , 14 | 149, 104, 25, 178, 252, 182, 202, 182, 141, 197, 4, 81, 181, 242 , 15 | 145, 42, 39, 227, 156, 198, 225, 193, 219, 93, 122, 175, 249, 0 , 16 | 175, 143, 70, 239, 46, 246, 163, 53, 163, 109, 168, 135, 2, 235 , 17 | 25, 92, 20, 145, 138, 77, 69, 166, 78, 176, 173, 212, 166, 113 , 18 | 94, 161, 41, 50, 239, 49, 111, 164, 70, 60, 2, 37, 171, 75 , 19 | 136, 156, 11, 56, 42, 146, 138, 229, 73, 146, 77, 61, 98, 196 , 20 | 135, 106, 63, 197, 195, 86, 96, 203, 113, 101, 170, 247, 181, 113 , 21 | 80, 250, 108, 7, 255, 237, 129, 226, 79, 107, 112, 166, 103, 241 , 22 | 24, 223, 239, 120, 198, 58, 60, 82, 128, 3, 184, 66, 143, 224 , 23 | 145, 224, 81, 206, 163, 45, 63, 90, 168, 114, 59, 33, 159, 95 , 24 | 28, 139, 123, 98, 125, 196, 15, 70, 194, 253, 54, 14, 109, 226 , 25 | 71, 17, 161, 93, 186, 87, 244, 138, 20, 52, 123, 251, 26, 36 , 26 | 17, 46, 52, 231, 232, 76, 31, 221, 84, 37, 216, 165, 212, 106 , 27 | 197, 242, 98, 43, 39, 175, 254, 145, 190, 84, 118, 222, 187, 136 , 28 | 120, 163, 236, 249 29 | }; 30 | 31 | byte rndindex = 0; 32 | byte prndindex = 0; 33 | 34 | // P_Random is used throughout all the p_xxx game code. 35 | byte P_Random (void) 36 | { 37 | return rndtable[++prndindex]; 38 | } 39 | 40 | byte M_Random (void) 41 | { 42 | return rndtable[++rndindex]; 43 | } 44 | 45 | void M_ClearRandom (void) 46 | { 47 | rndindex = prndindex = 0; 48 | } 49 | -------------------------------------------------------------------------------- /d_ticcmd.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // System specific interface stuff. 19 | // 20 | //----------------------------------------------------------------------------- 21 | 22 | 23 | #ifndef __D_TICCMD__ 24 | #define __D_TICCMD__ 25 | 26 | #include "doomtype.h" 27 | 28 | #ifdef __GNUG__ 29 | #pragma interface 30 | #endif 31 | 32 | // The data sampled per tick (single player) 33 | // and transmitted to other peers (multiplayer). 34 | // Mainly movements/button commands per game tick, 35 | // plus a checksum for internal state consistency. 36 | typedef struct 37 | { 38 | char forwardmove; // *2048 for move 39 | char sidemove; // *2048 for move 40 | short angleturn; // <<16 for angle delta 41 | // SAVED AS A BYTE into demos 42 | // these ones not recorded in demos 43 | // short consistancy; // checks for net game 44 | // byte chatchar; 45 | signed short aiming; //added:16-02-98:mouse aiming, see G_BuildTicCmd 46 | byte buttons; 47 | // unsigned short localtic; //added:6-12-98: for client prediction 48 | } ticcmd_t; 49 | 50 | 51 | #endif 52 | //----------------------------------------------------------------------------- 53 | // 54 | // $Log:$ 55 | // 56 | //----------------------------------------------------------------------------- 57 | -------------------------------------------------------------------------------- /p_maputl.h: -------------------------------------------------------------------------------- 1 | 2 | // map utility functions 3 | 4 | #ifndef __P_MAPUTL__ 5 | #define __P_MAPUTL__ 6 | 7 | #include "doomtype.h" 8 | #include "r_defs.h" 9 | #include "m_fixed.h" 10 | 11 | // 12 | // P_MAPUTL 13 | // 14 | typedef struct 15 | { 16 | fixed_t x; 17 | fixed_t y; 18 | fixed_t dx; 19 | fixed_t dy; 20 | 21 | } divline_t; 22 | 23 | typedef struct 24 | { 25 | fixed_t frac; // along trace line 26 | boolean isaline; 27 | union { 28 | mobj_t* thing; 29 | line_t* line; 30 | } d; 31 | } intercept_t; 32 | 33 | #define MAXINTERCEPTS 128 34 | 35 | extern intercept_t intercepts[MAXINTERCEPTS]; 36 | extern intercept_t* intercept_p; 37 | 38 | typedef boolean (*traverser_t) (intercept_t *in); 39 | 40 | fixed_t P_AproxDistance (fixed_t dx, fixed_t dy); 41 | int P_PointOnLineSide (fixed_t x, fixed_t y, line_t* line); 42 | int P_PointOnDivlineSide (fixed_t x, fixed_t y, divline_t* line); 43 | void P_MakeDivline (line_t* li, divline_t* dl); 44 | fixed_t P_InterceptVector (divline_t* v2, divline_t* v1); 45 | int P_BoxOnLineSide (fixed_t* tmbox, line_t* ld); 46 | 47 | extern fixed_t opentop; 48 | extern fixed_t openbottom; 49 | extern fixed_t openrange; 50 | extern fixed_t lowfloor; 51 | 52 | void P_LineOpening (line_t* linedef); 53 | 54 | boolean P_BlockLinesIterator (int x, int y, boolean(*func)(line_t*) ); 55 | boolean P_BlockThingsIterator (int x, int y, boolean(*func)(mobj_t*) ); 56 | 57 | #define PT_ADDLINES 1 58 | #define PT_ADDTHINGS 2 59 | #define PT_EARLYOUT 4 60 | 61 | extern divline_t trace; 62 | 63 | extern fixed_t tmbbox[4]; //p_map.c 64 | 65 | // call your user function for each line of the blockmap in the bbox defined by the radius 66 | /*boolean P_RadiusLinesCheck ( fixed_t radius, 67 | fixed_t x, 68 | fixed_t y, 69 | boolean (*func)(line_t*));*/ 70 | #endif // __P_MAPUTL__ -------------------------------------------------------------------------------- /m_argv.c: -------------------------------------------------------------------------------- 1 | // m_argv.c : 2 | 3 | #include 4 | 5 | #include "doomdef.h" 6 | #include "command.h" 7 | 8 | int myargc; 9 | char** myargv; 10 | static int found; 11 | 12 | // 13 | // M_CheckParm 14 | // Checks for the given parameter 15 | // in the program's command line arguments. 16 | // Returns the argument number (1 to argc-1) 17 | // or 0 if not present 18 | int M_CheckParm (char *check) 19 | { 20 | int i; 21 | 22 | for (i = 1;i0 && found+1" with flags "" 13 | 14 | Creating temp file "D:\TEMP\RSPF220.TMP" with contents 17 | Creating command line "cl.exe @D:\TEMP\RSPF220.TMP" 18 | Creating temp file "D:\TEMP\RSPF221.TMP" with contents 21 | Creating command line "link.exe @D:\TEMP\RSPF221.TMP" 22 | Compiling... 23 | r_glide.c 24 | Linking... 25 | Creating library Release/r_glide.lib and object Release/r_glide.exp 26 | 27 | 28 | 29 | r_glide.dll - 0 error(s), 0 warning(s) 30 | -------------------------------------------------------------------------------- /qmus2mid.h: -------------------------------------------------------------------------------- 1 | #if !defined(QMUS2MID_H) 2 | #define QMUS2MID_H 3 | 4 | #define NOTMUSFILE 1 /* Not a MUS file */ 5 | #define COMUSFILE 2 /* Can't open MUS file */ 6 | #define COTMPFILE 3 /* Can't open TMP file */ 7 | #define CWMIDFILE 4 /* Can't write MID file */ 8 | #define MUSFILECOR 5 /* MUS file corrupted */ 9 | #define TOOMCHAN 6 /* Too many channels */ 10 | #define MEMALLOC 7 /* Memory allocation error */ 11 | #define MIDTOLARGE 8 /* If the mid don't fit in the buffer */ 12 | 13 | /* some (old) compilers mistake the "MUS\x1A" construct (interpreting 14 | it as "MUSx1A") */ 15 | 16 | #define MUSMAGIC "MUS\032" /* this seems to work */ 17 | #define MIDIMAGIC "MThd\000\000\000\006\000\001" 18 | #define TRACKMAGIC1 "\000\377\003\035" 19 | #define TRACKMAGIC2 "\000\377\057\000" /* end of track */ 20 | #define TRACKMAGIC3 "\000\377\002\026" 21 | #define TRACKMAGIC4 "\000\377\131\002\000\000" 22 | #define TRACKMAGIC5 "\000\377\121\003\011\243\032" 23 | #define TRACKMAGIC6 "\000\377\057\000" 24 | 25 | 26 | struct MUSheader_s 27 | { 28 | char ID[4]; // identifier "MUS" 0x1A 29 | USHORT scoreLength; // length of score in bytes 30 | USHORT scoreStart; // absolute file pos of the score 31 | USHORT channels; // count of primary channels 32 | USHORT sec_channels; // count of secondary channels 33 | USHORT instrCnt; 34 | USHORT dummy; 35 | // variable-length part starts here 36 | USHORT instruments[0]; 37 | }; 38 | typedef struct MUSheader_s MUSheader; 39 | 40 | struct Track 41 | { 42 | unsigned long current; 43 | char vel; 44 | long DeltaTime; 45 | unsigned char LastEvent; 46 | char *data; /* Primary data */ 47 | }; 48 | 49 | int qmus2mid (byte *mus, byte *mid, // buffers in memory 50 | USHORT division, int BufferSize, int nocomp, 51 | int length, int midbuffersize, 52 | unsigned long* midilength); //faB: returns midi file length in here 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /doomtype.h: -------------------------------------------------------------------------------- 1 | 2 | // doomtype.h : doom games standard types 3 | 4 | #ifndef __DOOMTYPE__ 5 | #define __DOOMTYPE__ 6 | 7 | #ifdef __WIN32__ 8 | #include 9 | #endif 10 | typedef unsigned long ULONG; 11 | typedef unsigned short USHORT; 12 | 13 | #ifdef __MSC__ 14 | // Microsoft VisualC++ 15 | #define strncasecmp strnicmp 16 | #define strcasecmp stricmp 17 | #define inline __inline 18 | #else 19 | #ifdef __WATCOMC__ 20 | #include 21 | #include 22 | #include 23 | #include 24 | #define strncasecmp strnicmp 25 | #define strcasecmp strcmpi 26 | #endif 27 | #endif 28 | // added for Linux 19990220 by Kin 29 | #ifdef LINUX 30 | #define stricmp(x,y) strcasecmp(x,y) 31 | #define strnicmp(x,y,n) strncasecmp(x,y,n) 32 | #endif 33 | 34 | 35 | #ifndef __BYTEBOOL__ 36 | #define __BYTEBOOL__ 37 | 38 | // Fixed to use builtin bool type with C++. 39 | //#ifdef __cplusplus 40 | // typedef bool boolean; 41 | //#else 42 | 43 | typedef unsigned char byte; 44 | 45 | //faB: clean that up !! 46 | #ifdef __WIN32__ 47 | #define false FALSE // use windows types 48 | #define true TRUE 49 | #define boolean BOOL 50 | #else 51 | typedef enum {false, true} boolean; 52 | #endif 53 | //#endif // __cplusplus 54 | #endif // __BYTEBOOL__ 55 | 56 | 57 | // Predefined with some OS. 58 | #ifndef __WIN32__ 59 | #include 60 | #endif 61 | 62 | #ifndef MAXCHAR 63 | #define MAXCHAR ((char)0x7f) 64 | #endif 65 | #ifndef MAXSHORT 66 | #define MAXSHORT ((short)0x7fff) 67 | #endif 68 | #ifndef MAXINT 69 | #define MAXINT ((int)0x7fffffff) 70 | #endif 71 | #ifndef MAXLONG 72 | #define MAXLONG ((long)0x7fffffff) 73 | #endif 74 | 75 | #ifndef MINCHAR 76 | #define MINCHAR ((char)0x80) 77 | #endif 78 | #ifndef MINSHORT 79 | #define MINSHORT ((short)0x8000) 80 | #endif 81 | #ifndef MININT 82 | #define MININT ((int)0x80000000) 83 | #endif 84 | #ifndef MINLONG 85 | #define MINLONG ((long)0x80000000) 86 | #endif 87 | 88 | 89 | #endif //__DOOMTYPE__ 90 | -------------------------------------------------------------------------------- /d_items.c: -------------------------------------------------------------------------------- 1 | 2 | // d_items.h : holds the weapon info for now... 3 | 4 | 5 | // We are referring to sprite numbers. 6 | #include "info.h" 7 | #include "d_items.h" 8 | 9 | 10 | // 11 | // PSPRITE ACTIONS for weapons. 12 | // This struct controls the weapon animations. 13 | // 14 | // Each entry is: 15 | // ammo/amunition type 16 | // upstate 17 | // downstate 18 | // readystate 19 | // atkstate, i.e. attack/fire/hit frame 20 | // flashstate, muzzle flash 21 | // 22 | weaponinfo_t weaponinfo[NUMWEAPONS] = 23 | { 24 | { 25 | // fist 26 | am_noammo, 27 | S_PUNCHUP, 28 | S_PUNCHDOWN, 29 | S_PUNCH, 30 | S_PUNCH1, 31 | S_NULL 32 | }, 33 | { 34 | // pistol 35 | am_clip, 36 | S_PISTOLUP, 37 | S_PISTOLDOWN, 38 | S_PISTOL, 39 | S_PISTOL1, 40 | S_PISTOLFLASH 41 | }, 42 | { 43 | // shotgun 44 | am_shell, 45 | S_SGUNUP, 46 | S_SGUNDOWN, 47 | S_SGUN, 48 | S_SGUN1, 49 | S_SGUNFLASH1 50 | }, 51 | { 52 | // chaingun 53 | am_clip, 54 | S_CHAINUP, 55 | S_CHAINDOWN, 56 | S_CHAIN, 57 | S_CHAIN1, 58 | S_CHAINFLASH1 59 | }, 60 | { 61 | // missile launcher 62 | am_misl, 63 | S_MISSILEUP, 64 | S_MISSILEDOWN, 65 | S_MISSILE, 66 | S_MISSILE1, 67 | S_MISSILEFLASH1 68 | }, 69 | { 70 | // plasma rifle 71 | am_cell, 72 | S_PLASMAUP, 73 | S_PLASMADOWN, 74 | S_PLASMA, 75 | S_PLASMA1, 76 | S_PLASMAFLASH1 77 | }, 78 | { 79 | // bfg 9000 80 | am_cell, 81 | S_BFGUP, 82 | S_BFGDOWN, 83 | S_BFG, 84 | S_BFG1, 85 | S_BFGFLASH1 86 | }, 87 | { 88 | // chainsaw 89 | am_noammo, 90 | S_SAWUP, 91 | S_SAWDOWN, 92 | S_SAW, 93 | S_SAW1, 94 | S_NULL 95 | }, 96 | { 97 | // super shotgun 98 | am_shell, 99 | S_DSGUNUP, 100 | S_DSGUNDOWN, 101 | S_DSGUN, 102 | S_DSGUN1, 103 | S_DSGUNFLASH1 104 | }, 105 | }; 106 | -------------------------------------------------------------------------------- /r_plane.h: -------------------------------------------------------------------------------- 1 | 2 | // r_plane.h : Refresh, visplane stuff (floor, ceilings). 3 | 4 | #ifndef __R_PLANE__ 5 | #define __R_PLANE__ 6 | 7 | #include "screen.h" //needs MAXVIDWIDTH/MAXVIDHEIGHT 8 | #include "r_data.h" 9 | 10 | // 11 | // Now what is a visplane, anyway? 12 | // Simple : kinda floor/ceiling polygon optimised for Doom rendering. 13 | // 4124 bytes! 14 | // 15 | typedef struct 16 | { 17 | fixed_t height; 18 | int picnum; 19 | int lightlevel; 20 | int minx; 21 | int maxx; 22 | 23 | // leave pads for [minx-1]/[maxx+1] 24 | 25 | //faB: words sucks .. should get rid of that.. but eats memory 26 | //added:08-02-98: THIS IS UNSIGNED! VERY IMPORTANT!! 27 | unsigned short pad1; 28 | unsigned short top[MAXVIDWIDTH]; 29 | unsigned short pad2; 30 | unsigned short pad3; 31 | unsigned short bottom[MAXVIDWIDTH]; 32 | unsigned short pad4; 33 | 34 | } visplane_t; 35 | 36 | extern visplane_t* floorplane; 37 | extern visplane_t* ceilingplane; 38 | extern visplane_t* waterplane; 39 | 40 | // Visplane related. 41 | extern short* lastopening; 42 | 43 | typedef void (*planefunction_t) (int top, int bottom); 44 | 45 | extern planefunction_t floorfunc; 46 | extern planefunction_t ceilingfunc_t; 47 | 48 | extern short floorclip[MAXVIDWIDTH]; 49 | extern short ceilingclip[MAXVIDWIDTH]; 50 | extern short waterclip[MAXVIDWIDTH]; //added:18-02-98:WATER! 51 | extern fixed_t yslopetab[MAXVIDHEIGHT*4]; 52 | 53 | extern fixed_t* yslope; 54 | extern fixed_t distscale[MAXVIDWIDTH]; 55 | 56 | void R_InitPlanes (void); 57 | void R_ClearPlanes (player_t *player); 58 | 59 | void R_MapPlane 60 | ( int y, 61 | int x1, 62 | int x2 ); 63 | 64 | void R_MakeSpans 65 | ( int x, 66 | int t1, 67 | int b1, 68 | int t2, 69 | int b2 ); 70 | 71 | void R_DrawPlanes (void); 72 | 73 | visplane_t* R_FindPlane 74 | ( fixed_t height, 75 | int picnum, 76 | int lightlevel ); 77 | 78 | visplane_t* R_CheckPlane 79 | ( visplane_t* pl, 80 | int start, 81 | int stop ); 82 | 83 | 84 | 85 | #endif 86 | -------------------------------------------------------------------------------- /tables.h: -------------------------------------------------------------------------------- 1 | // tables.h : lookup tables 2 | // 3 | // int finetangent[4096] - Tangens LUT. 4 | // Should work with BAM fairly well (12 of 16bit, 5 | // effectively, by shifting). 6 | // 7 | // int finesine[10240] - Sine lookup. 8 | // 9 | // int tantoangle[2049] - ArcTan LUT, 10 | // maps tan(angle) to angle fast. Gotta search. 11 | 12 | 13 | #ifndef __TABLES__ 14 | #define __TABLES__ 15 | 16 | #ifdef LINUX 17 | #include 18 | #else 19 | //#define PI 3.141592657 20 | #endif 21 | 22 | #include "m_fixed.h" 23 | 24 | #define FINEANGLES 8192 25 | #define FINEMASK (FINEANGLES-1) 26 | #define ANGLETOFINESHIFT 19 // 0x100000000 to 0x2000 27 | 28 | 29 | // Effective size is 10240. 30 | extern fixed_t finesine[5*FINEANGLES/4]; 31 | 32 | // Re-use data, is just PI/2 pahse shift. 33 | extern fixed_t* finecosine; 34 | 35 | 36 | // Effective size is 4096. 37 | extern fixed_t finetangent[FINEANGLES/2]; 38 | 39 | #define ANG45 0x20000000 40 | #define ANG90 0x40000000 41 | #define ANG180 0x80000000 42 | #define ANG270 0xc0000000 43 | 44 | #define ANGLE_45 0x20000000 45 | #define ANGLE_90 0x40000000 46 | #define ANGLE_180 0x80000000 47 | #define ANGLE_MAX 0xffffffff 48 | #define ANGLE_1 (ANGLE_45/45) 49 | #define ANGLE_60 (ANGLE_180/3) 50 | 51 | typedef unsigned angle_t; 52 | 53 | 54 | // to get a global angle from cartesian coordinates, the coordinates are 55 | // flipped until they are in the first octant of the coordinate system, then 56 | // the y (<=x) is scaled and divided by x to get a tangent (slope) value 57 | // which is looked up in the tantoangle[] table. 58 | #define SLOPERANGE 2048 59 | #define SLOPEBITS 11 60 | #define DBITS (FRACBITS-SLOPEBITS) 61 | 62 | // The +1 size is to handle the case when x==y without additional checking. 63 | extern angle_t tantoangle[SLOPERANGE+1]; 64 | 65 | // Utility function, called by R_PointToAngle. 66 | int SlopeDiv ( unsigned num, 67 | unsigned den); 68 | 69 | 70 | #endif 71 | //----------------------------------------------------------------------------- 72 | // 73 | // $Log:$ 74 | // 75 | //----------------------------------------------------------------------------- 76 | -------------------------------------------------------------------------------- /r_splats.h: -------------------------------------------------------------------------------- 1 | // r_splats.h : flat sprites & blood splats effects 2 | 3 | #ifndef __R_SPLATS_H__ 4 | #define __R_SPLATS_H__ 5 | 6 | #include "r_defs.h" 7 | 8 | //#define WALLSPLATS // comment this out to compile without splat effects 9 | //#define FLOORSPLATS 10 | 11 | #define MAXLEVELSPLATS 1024 12 | 13 | // splat flags 14 | #define SPLATDRAWMODE_MASK 0x03 // mask to get drawmode from flags 15 | #define SPLATDRAWMODE_OPAQUE 0x00 16 | #define SPLATDRAWMODE_SHADE 0x01 17 | #define SPLATDRAWMODE_TRANS 0x02 18 | 19 | 20 | // ========================================================================== 21 | // DEFINITIONS 22 | // ========================================================================== 23 | 24 | // WALL SPLATS are patches drawn on top of wall segs 25 | struct wallsplat_s { 26 | int patch; // lump id. 27 | vertex_t v1; // vertices along the linedef 28 | vertex_t v2; 29 | fixed_t top; 30 | fixed_t offset; // offset in columns< 2 | 3 | * If the DSP device is busy or no sound card available 4 | sndserver now continues to work, just without playing 5 | the sounds. So XDoom continues to work too in this case 6 | and doesn't terminate anymore. 7 | 8 | Tue Mar 3 18:35:53 1998 9 | 10 | * 8 bit sound support improved like done for the xdoom 11 | builtin sound handling, see xdoom's log file too. 12 | 13 | Wed Feb 11 13:36:50 1998 14 | 15 | * Ported to Unixware 7. 16 | 17 | Mon Jan 26 13:03:35 1998 18 | 19 | * Added test for environment variable DOOM_SOUND_SAMPLEBITS 20 | to override detection of a 16bit sound card and activate 21 | conversion to 8bit sound samples. There are 16bit sound 22 | cards which aren't SoundBlaster compatible and changing 23 | the sources to force it playing 8bit samples worked with 24 | this sound card. I added this environment variable, 25 | so people won't need to modify the source anymore. 26 | 27 | * Support for tnt.wad and plutonia.wad added 28 | 29 | * Changed order so that sndserver looks for the WADs 30 | in the same order then xdoom does. 31 | 32 | Thu Jan 1 16:47:37 1998 33 | 34 | * This ChangeLog added, who knows how much work will 35 | be done here, so it's better to have separate log 36 | for sndserver too. 37 | 38 | * The sound card initialization sequence was the opposite 39 | as the 4Front OSS documentation says, how this should 40 | be done. It might cause problems with some sound cards, 41 | I don't know, I just fixed it and it's a better style 42 | anyway to coincide with documented API's. 43 | 44 | Wed Dec 31 1997 45 | 46 | * Sound support for 8bit sound cards added. The server 47 | detected the sample format capabilities of the sound 48 | hardware already and the conversion from the signed 49 | short sounds samples to 8bit unsigned is pretty easy 50 | to do. Also I modified the text output, so that it 51 | just shows which type of card it's using, instead of 52 | the original error message, if the hardware isn't 53 | able to play the 16bit signed samples. 54 | This should work with all PC UNIX's, but I have tested 55 | it under UW 2.1.2 only, because that is the only system 56 | I have with old 8bit sound hardware. 57 | -------------------------------------------------------------------------------- /win32/hwr_defs.h: -------------------------------------------------------------------------------- 1 | // hwr_defs.h : hardware driver API definitions 2 | 3 | #ifndef _HWR_DEFS_ 4 | #define _HWR_DEFS_ 5 | 6 | #define DEGREE (.01745328f) 7 | #define PI (3.1415926535f) 8 | 9 | // SetState : possible values for IdState 10 | enum hwdsetstate { 11 | HWD_SET_DEPTHMASK = 1, 12 | HWD_SET_COLORMASK, 13 | HWD_SET_CULLMODE, 14 | HWD_SET_CONSTANTCOLOR, 15 | HWD_SET_COLORSOURCE, 16 | HWD_SET_ALPHABLEND, 17 | HWD_SET_TEXTURECLAMP, 18 | HWD_SET_TEXTURECOMBINE, 19 | HWD_SET_TEXTUREFILTERMODE, 20 | HWD_SET_MIPMAPMODE, 21 | HWD_SET_ALPHATESTFUNC, 22 | HWD_SET_ALPHATESTREFVALUE, 23 | HWD_SET_ALPHASOURCE, 24 | HWD_ENABLE, 25 | HWD_DISABLE, 26 | HWD_SET_FOG_TABLE, 27 | HWD_SET_FOG_COLOR, 28 | HWD_SET_FOG_MODE, 29 | HWD_SET_CHROMAKEY_MODE, 30 | HWD_SET_CHROMAKEY_VALUE, 31 | }; 32 | typedef enum hwdsetstate hwdstate_t; 33 | 34 | // HWD_SET_COLORSOURCE 35 | enum hwdcolorsource { 36 | HWD_COLORSOURCE_CONSTANT = 0, 37 | HWD_COLORSOURCE_ITERATED, 38 | HWD_COLORSOURCE_TEXTURE, 39 | HWD_COLORSOURCE_CONSTANTALPHA_SCALE_TEXTURE, 40 | }; 41 | 42 | // HWD_SET_ALPHASOURCE 43 | enum hwdalphasource { 44 | HWD_ALPHASOURCE_CONSTANT = 0, 45 | HWD_ALPHASOURCE_TEXTURE, 46 | }; 47 | 48 | enum hwdalphablend { 49 | HWD_ALPHABLEND_NONE = 0, 50 | HWD_ALPHABLEND_TRANSLUCENT, 51 | }; 52 | 53 | enum hwdtextureclamp { 54 | HWD_TEXTURE_CLAMP_XY = 0, 55 | HWD_TEXTURE_WRAP_XY, 56 | }; 57 | 58 | enum hwdtexturecombine { 59 | HWD_TEXTURECOMBINE_NORMAL = 0, 60 | }; 61 | 62 | enum hwdtexturefiltermode { 63 | HWD_SET_TEXTUREFILTER_POINTSAMPLED = 0, 64 | HWD_SET_TEXTUREFILTER_BILINEAR, 65 | }; 66 | 67 | enum hwdmipmapmode { 68 | HWD_MIPMAP_DISABLE = 0, 69 | }; 70 | 71 | enum hwdenabledisable { 72 | HWD_SHAMELESS_PLUG = 1, 73 | }; 74 | 75 | enum hwdfogmode { 76 | HWD_FOG_DISABLE = 0, 77 | HWD_FOG_ENABLE, 78 | }; 79 | 80 | enum hwdchromakeymode { 81 | HWD_CHROMAKEY_ENABLE = 1 82 | }; 83 | 84 | 85 | // 3rd parameter for ClearBuffer : depth buffer 86 | enum hwdcleardepth { 87 | HWD_CLEARDEPTH_MIN = 0, //indexes gr_wrange 88 | HWD_CLEARDEPTH_MAX = 1 89 | }; 90 | typedef enum hwdcleardepth hwdcleardepth_t; 91 | 92 | // GetState : possible values for IdState 93 | enum hwdgetstate { 94 | HWD_GET_FOGTABLESIZE = 1, 95 | }; 96 | typedef enum hwdgetstate hwdgetstate_t; 97 | 98 | 99 | #endif //_HWR_DEFS_ -------------------------------------------------------------------------------- /win32/fabdxlib.h: -------------------------------------------------------------------------------- 1 | // faB's DirectX library v1.0 2 | // 3 | 4 | #ifndef _H_FABDXLIB_ 5 | #define _H_FABDXLIB_ 6 | 7 | #define SAFE_RELEASE(x) if(x != NULL) { x->lpVtbl->Release(x); x = NULL; } 8 | #define SAFE_DELETE(x) if(x != NULL) { delete x; x = NULL; } 9 | 10 | #define WIN32_LEAN_AND_MEAN 11 | #include 12 | #include 13 | 14 | // format of function in app called with width,height 15 | typedef BOOL (*APPENUMMODESCALLBACK)(int width, int height, int bpp); 16 | 17 | 18 | // globals 19 | extern IDirectDraw* DDr; 20 | extern IDirectDrawSurface* ScreenReal; 21 | extern IDirectDrawSurface* ScreenVirtual; 22 | extern IDirectDrawPalette* DDPalette; 23 | 24 | extern BOOL bAppFullScreen; // main code might need this to know the current 25 | // fullscreen or windowed state 26 | 27 | extern int windowPosX; // current position in windowed mode 28 | extern int windowPosY; 29 | 30 | extern int ScreenWidth; 31 | extern int ScreenHeight; 32 | extern BOOL ScreenLocked; // Screen surface is being locked 33 | extern int ScreenPitch; // offset from one line to the next 34 | extern unsigned char* ScreenPtr; // memory of the surface 35 | 36 | 37 | BOOL EnumDirectDrawDisplayModes (APPENUMMODESCALLBACK appFunc); 38 | BOOL CreateDirectDrawInstance (void); 39 | 40 | int InitDirectDrawe (HWND appWin, int width, int height, int bpp, int fullScr); 41 | void CloseDirectDraw (void); 42 | 43 | void ReleaseChtuff (void); 44 | 45 | void ClearSurface (IDirectDrawSurface* surface, int color); 46 | BOOL ScreenFlip (int wait); 47 | void TextPrint (int x, int y, char* message); 48 | 49 | void CreateDDPalette (PALETTEENTRY* colorTable); 50 | void DestroyDDPalette (void); 51 | void SetDDPalette (PALETTEENTRY* pal); 52 | 53 | void WaitVbl (void); 54 | 55 | void LockScreen (void); 56 | void UnlockScreen (void); 57 | 58 | 59 | #endif /* _H_FABDXLIB_ */ -------------------------------------------------------------------------------- /m_fixed.h: -------------------------------------------------------------------------------- 1 | // Fixed point arithemtics, implementation. 2 | 3 | #ifndef __M_FIXED__ 4 | #define __M_FIXED__ 5 | 6 | #include "doomtype.h" 7 | 8 | // 9 | // Fixed point, 32bit as 16.16. 10 | // 11 | #define FRACBITS 16 12 | #define FRACUNIT (1<",(long)a,(long)b); 82 | 83 | if ( (abs(a)>>14) >= abs(b)) 84 | return (a^b)<0 ? MININT : MAXINT; 85 | 86 | return FixedDiv2 (a,b); 87 | } 88 | 89 | #endif //m_fixed.h 90 | -------------------------------------------------------------------------------- /st_stuff.h: -------------------------------------------------------------------------------- 1 | // Status bar code. 2 | // Does the face/direction indicator animatin. 3 | // Does palette indicators as well (red pain/berserk, bright pickup) 4 | 5 | #ifndef __STSTUFF_H__ 6 | #define __STSTUFF_H__ 7 | 8 | #include "doomtype.h" 9 | #include "d_event.h" 10 | #include "d_player.h" 11 | 12 | //software mode : position according to resolution, not scaled 13 | //hardware mode : original coords, scaled to current resolution, correct aspect 14 | #define ST_Y (rendermode==render_soft ? vid.height - ST_HEIGHT : BASEVIDHEIGHT - ST_HEIGHT) 15 | 16 | 17 | // 18 | // STATUS BAR 19 | // 20 | 21 | // Called by main loop. 22 | boolean ST_Responder (event_t* ev); 23 | 24 | // Called by main loop. 25 | void ST_Ticker (void); 26 | 27 | // Called by main loop. 28 | void ST_Drawer (boolean fullscreen, boolean refresh); 29 | 30 | // Called when the console player is spawned on each level. 31 | void ST_Start (void); 32 | 33 | // Called by startup code. 34 | void ST_Init (void); 35 | 36 | // Called by G_Responder() when pressing F12 while viewing a demo. 37 | void ST_changeDemoView (void); 38 | 39 | // Add status bar related commands & vars 40 | void ST_AddCommands (void); 41 | 42 | 43 | 44 | // need this for SCR_Recalc() coz widgets coords change with resolutions 45 | extern boolean st_recalc; 46 | 47 | // States for status bar code. 48 | typedef enum 49 | { 50 | AutomapState, 51 | FirstPersonState 52 | 53 | } st_stateenum_t; 54 | 55 | 56 | // States for the chat code. 57 | typedef enum 58 | { 59 | StartChatState, 60 | WaitDestState, 61 | GetChatState 62 | 63 | } st_chatstateenum_t; 64 | 65 | 66 | boolean ST_Responder(event_t* ev); 67 | 68 | // face load/unload graphics, called when skin changes 69 | void ST_loadFaceGraphics (char *facestr); 70 | void ST_unloadFaceGraphics (void); 71 | 72 | // return if player a is in the same team of the player b 73 | boolean ST_SameTeam(player_t *a,player_t *b); 74 | 75 | // get the frags of the player 76 | // only one function for calculation : more simple code 77 | int ST_PlayerFrags (int playernum); 78 | 79 | //-------------------- 80 | // status bar overlay 81 | //-------------------- 82 | extern boolean st_overlay; // sb overlay on or off when fullscreen 83 | 84 | void ST_overlayDrawer (void); // draw vital info overlay when fullscreen 85 | 86 | 87 | #endif 88 | //----------------------------------------------------------------------------- 89 | // 90 | // $Log:$ 91 | // 92 | //----------------------------------------------------------------------------- 93 | -------------------------------------------------------------------------------- /r_things.h: -------------------------------------------------------------------------------- 1 | 2 | // r_things.h : Rendering of moving objects, sprites. 3 | // 4 | 5 | #ifndef __R_THINGS__ 6 | #define __R_THINGS__ 7 | 8 | #include "sounds.h" 9 | 10 | // number of sprite lumps for spritewidth,offset,topoffset lookup tables 11 | // Fab: this is a hack : should allocate the lookup tables per sprite 12 | #define MAXSPRITELUMPS 4096 13 | 14 | #define MAXVISSPRITES 256 // added 2-2-98 was 128 15 | 16 | extern vissprite_t vissprites[MAXVISSPRITES]; 17 | extern vissprite_t* vissprite_p; 18 | extern vissprite_t vsprsortedhead; 19 | 20 | // Constant arrays used for psprite clipping 21 | // and initializing clipping. 22 | extern short negonearray[MAXVIDWIDTH]; 23 | extern short screenheightarray[MAXVIDWIDTH]; 24 | 25 | // vars for R_DrawMaskedColumn 26 | extern short* mfloorclip; 27 | extern short* mceilingclip; 28 | extern fixed_t spryscale; 29 | extern fixed_t sprtopscreen; 30 | 31 | extern fixed_t pspritescale; 32 | extern fixed_t pspriteiscale; 33 | extern fixed_t pspriteyscale; //added:02-02-98:for aspect ratio 34 | 35 | 36 | void R_DrawMaskedColumn (column_t* column); 37 | 38 | void R_SortVisSprites (void); 39 | 40 | //faB: find sprites in wadfile, replace existing, add new ones 41 | // (only sprites from namelist are added or replaced) 42 | void R_AddSpriteDefs (char** namelist, int wadnum); 43 | 44 | void R_AddSprites (sector_t* sec); 45 | void R_AddPSprites (void); 46 | void R_DrawSprite (vissprite_t* spr); 47 | void R_InitSprites (char** namelist); 48 | void R_ClearSprites (void); 49 | void R_DrawSprites (void); //draw all vissprites 50 | void R_DrawMasked (void); 51 | 52 | void 53 | R_ClipVisSprite 54 | ( vissprite_t* vis, 55 | int xl, 56 | int xh ); 57 | 58 | 59 | // ----------- 60 | // SKINS STUFF 61 | // ----------- 62 | #define SKINNAMESIZE 16 63 | #define DEFAULTSKIN "sonic" // Changed by Tails: 9-13-99 64 | 65 | typedef struct 66 | { 67 | char name[SKINNAMESIZE+1]; // short descriptive name of the skin 68 | spritedef_t spritedef; 69 | char faceprefix[4]; // 3 chars+'\0', default is "STF" 70 | 71 | // specific sounds per skin 72 | short soundsid[NUMSKINSOUNDS]; // sound # in S_sfx table 73 | 74 | } skin_t; 75 | 76 | extern int numskins; 77 | extern skin_t skins[MAXSKINS]; 78 | //extern CV_PossibleValue_t skin_cons_t[MAXSKINS+1]; 79 | extern consvar_t cv_skin; 80 | 81 | //void R_InitSkins (void); 82 | void SetPlayerSkin(int playernum,char *skinname); 83 | int R_SkinAvailable (char* name); 84 | void R_AddSkins (int wadnum); 85 | 86 | #endif __R_THINGS__ 87 | -------------------------------------------------------------------------------- /keys.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef __KEYS_H__ 3 | #define __KEYS_H__ 4 | 5 | // 6 | // DOOM keyboard definition. 7 | // This is the stuff configured by Setup.Exe. 8 | // 9 | 10 | // This is the key codes as posted by the keyboard handler, 11 | // ascii codes are 0->127, 12 | // scancodes are 0x80 + 0->127 13 | 14 | #define KEY_NULL 0 // null key, triggers nothing 15 | 16 | #define KEY_ESCAPE 27 17 | #define KEY_SPACE 32 18 | 19 | #define KEY_NUMLOCK (0x80+69) 20 | #define KEY_SCROLLLOCK (0x80+70) 21 | 22 | #define KEY_MINUS 45 23 | #define KEY_EQUALS 61 24 | #define KEY_BACKSPACE 8 25 | #define KEY_TAB 9 26 | #define KEY_ENTER 13 27 | 28 | // 29 | // scancodes 71-83 (non-extended) 30 | // 31 | #define KEY_KEYPAD7 (0x80+71) 32 | #define KEY_KEYPAD8 (0x80+72) 33 | #define KEY_KEYPAD9 (0x80+73) 34 | #define KEY_MINUSPAD (0x80+74) 35 | #define KEY_KEYPAD4 (0x80+75) 36 | #define KEY_KEYPAD5 (0x80+76) 37 | #define KEY_KEYPAD6 (0x80+77) 38 | #define KEY_PLUSPAD (0x80+78) 39 | #define KEY_KEYPAD1 (0x80+79) 40 | #define KEY_KEYPAD2 (0x80+80) 41 | #define KEY_KEYPAD3 (0x80+81) 42 | #define KEY_KEYPAD0 (0x80+82) 43 | #define KEY_KPADDEL (0x80+83) 44 | 45 | // windows95 keys... 46 | 47 | #define KEY_LEFTWIN (0x80+91) 48 | #define KEY_RIGHTWIN (0x80+92) 49 | #define KEY_MENU (0x80+93) 50 | 51 | // 52 | // scancodes 71-83 EXTENDED are remapped 53 | // to these by the keyboard handler (just add 30) 54 | // 55 | #define KEY_KPADSLASH (0x80+100) //extended scancode 53 '/' remapped 56 | 57 | #define KEY_HOME (0x80+101) 58 | #define KEY_UPARROW (0x80+102) 59 | #define KEY_PGUP (0x80+103) 60 | #define KEY_LEFTARROW (0x80+105) 61 | #define KEY_RIGHTARROW (0x80+107) 62 | #define KEY_END (0x80+109) 63 | #define KEY_DOWNARROW (0x80+110) 64 | #define KEY_PGDN (0x80+111) 65 | #define KEY_INS (0x80+112) 66 | #define KEY_DEL (0x80+113) 67 | 68 | 69 | #define KEY_F1 (0x80+0x3b) 70 | #define KEY_F2 (0x80+0x3c) 71 | #define KEY_F3 (0x80+0x3d) 72 | #define KEY_F4 (0x80+0x3e) 73 | #define KEY_F5 (0x80+0x3f) 74 | #define KEY_F6 (0x80+0x40) 75 | #define KEY_F7 (0x80+0x41) 76 | #define KEY_F8 (0x80+0x42) 77 | #define KEY_F9 (0x80+0x43) 78 | #define KEY_F10 (0x80+0x44) 79 | #define KEY_F11 (0x80+0x57) 80 | #define KEY_F12 (0x80+0x58) 81 | 82 | #define KEY_PAUSE 255 83 | 84 | // these ones must be non-extended scancodes (rctrl,rshift,lalt) 85 | #define KEY_SHIFT (0x80+54) 86 | #define KEY_CTRL (0x80+29) 87 | #define KEY_ALT (0x80+56) 88 | 89 | #define KEY_CAPSLOCK (0x80+58) 90 | #define KEY_CONSOLE '`' 91 | 92 | #define KEY_OPENBRACKETS 93 | #define KEY_CLOSEBRACKETS 94 | 95 | #endif 96 | -------------------------------------------------------------------------------- /p_tick.c: -------------------------------------------------------------------------------- 1 | // p_tick.c : thinker list handling, game tick 2 | 3 | #include "doomstat.h" 4 | #include "g_game.h" 5 | #include "p_local.h" 6 | #include "z_zone.h" 7 | 8 | 9 | 10 | int leveltime; 11 | 12 | // 13 | // THINKERS 14 | // All thinkers should be allocated by Z_Malloc 15 | // so they can be operated on uniformly. 16 | // The actual structures will vary in size, 17 | // but the first element must be thinker_t. 18 | // 19 | 20 | 21 | 22 | // Both the head and tail of the thinker list. 23 | thinker_t thinkercap; 24 | 25 | 26 | // 27 | // P_InitThinkers 28 | // 29 | void P_InitThinkers (void) 30 | { 31 | thinkercap.prev = thinkercap.next = &thinkercap; 32 | } 33 | 34 | 35 | 36 | 37 | // 38 | // P_AddThinker 39 | // Adds a new thinker at the end of the list. 40 | // 41 | void P_AddThinker (thinker_t* thinker) 42 | { 43 | thinkercap.prev->next = thinker; 44 | thinker->next = &thinkercap; 45 | thinker->prev = thinkercap.prev; 46 | thinkercap.prev = thinker; 47 | } 48 | 49 | 50 | 51 | // 52 | // P_RemoveThinker 53 | // Deallocation is lazy -- it will not actually be freed 54 | // until its thinking turn comes up. 55 | // 56 | void P_RemoveThinker (thinker_t* thinker) 57 | { 58 | // FIXME: NOP. 59 | thinker->function.acv = (actionf_v)(-1); 60 | } 61 | 62 | 63 | 64 | // 65 | // P_AllocateThinker 66 | // Allocates memory and adds a new thinker at the end of the list. 67 | // 68 | void P_AllocateThinker (thinker_t* thinker) 69 | { 70 | } 71 | 72 | 73 | 74 | // 75 | // P_RunThinkers 76 | // 77 | void P_RunThinkers (void) 78 | { 79 | thinker_t* currentthinker; 80 | 81 | currentthinker = thinkercap.next; 82 | while (currentthinker != &thinkercap) 83 | { 84 | if ( currentthinker->function.acv == (actionf_v)(-1) ) 85 | { 86 | void *removeit; 87 | // time to remove it 88 | currentthinker->next->prev = currentthinker->prev; 89 | currentthinker->prev->next = currentthinker->next; 90 | removeit = currentthinker; 91 | currentthinker = currentthinker->next; 92 | Z_Free (removeit); 93 | } 94 | else 95 | { 96 | if (currentthinker->function.acp1) 97 | currentthinker->function.acp1 (currentthinker); 98 | currentthinker = currentthinker->next; 99 | } 100 | } 101 | } 102 | 103 | 104 | 105 | // 106 | // P_Ticker 107 | // 108 | 109 | void P_Ticker (void) 110 | { 111 | int i; 112 | 113 | // run the tic 114 | if (paused) 115 | return; 116 | 117 | for (i=0 ; ipatchcount; 55 | patches = &textures[skytexture]->patches[0]; 56 | for (height=0,i=0;ipatch, &wpatch, sizeof(patch_t)); 59 | if (wpatch.height>height) 60 | height = wpatch.height; 61 | } 62 | 63 | // DIRTY : should set the routine depending on colormode in screen.c 64 | if (height>128) 65 | { 66 | // horizon line on 256x240 freelook textures of Legacy 67 | skytexturemid = 200<100<>1; 98 | } 99 | } 100 | -------------------------------------------------------------------------------- /_DOC/SOUND.CFG: -------------------------------------------------------------------------------- 1 | # 2 | # Sound configuration file for Doom Legacy v1.12 and above 3 | # 4 | # If you leave a parameter blank (nothing after the '='), Doom Legacy 5 | # will autodetect the hardware during the game startup. This is what 6 | # it usually does. 7 | # 8 | # Should you have any problem getting your soundcard working with 9 | # Legacy's autodetect mode, set the following parameters manually. 10 | # 11 | # This file should be kept either in the same directory as your program, 12 | # or in a location pointed to by the "ALLEGRO" environment variable. 13 | 14 | 15 | [sound] 16 | 17 | 18 | # digital sound output driver 19 | # 0 = none 1 = SB (autodetect breed) 20 | # 2 = SB 1.0 3 = SB 1.5 21 | # 4 = SB 2.0 5 = SB Pro 22 | # 6 = SB16 7 = GUS (unfinished) 23 | digi_card = 24 | 25 | 26 | # music output driver 27 | # 0 = none 1 = Adlib (autodetect OPL version) 28 | # 2 = OPL2 3 = Dual OPL2 (SB Pro-1) 29 | # 4 = OPL3 5 = SB MIDI interface 30 | # 6 = MPU-401 7 = GUS (unfinished) 31 | # 8 = DIGMID 9 = AWE32 32 | midi_card = 33 | 34 | 35 | # specifies the minimum number of voices to reserve for use by the 36 | # digital and MIDI sound driver. How many are possible depends on 37 | # the driver. 38 | digi_voices = 8 39 | midi_voices = 8 40 | 41 | 42 | # how loud? (range 0-255) 43 | # 44 | # Doom Legacy sets the volume in hardware, you don't need to set this 45 | digi_volume = 46 | midi_volume = 47 | 48 | 49 | # toggling this between 0 and 1 reverses the left/right panning of samples 50 | # (some sound cards reverse the stereo image the wrong way) 51 | flip_pan = 52 | 53 | 54 | # SB port address (usually 220) 55 | sb_port = 56 | 57 | 58 | # SB DMA channel (usually 1) 59 | # Warning : for SB 16/32/64 this is the HIGH DMA VALUE (usually 5) 60 | sb_dma = 61 | 62 | 63 | # SB IRQ number (usually 7) 64 | sb_irq = 65 | 66 | 67 | # SB sample frequency (11906, 16129, 22727 or 45454) 68 | # 11906, 16129 - works with any SB card, 69 | # 22727 - on SB2.0 and above 70 | # 45454 - only on SB2.0 or SB16 (not on the stereo SB Pro driver) 71 | sb_freq = 22727 72 | 73 | 74 | # FM synth (OPL synth) port address (usually 388) 75 | fm_port = 76 | 77 | 78 | # MPU-401 midi interface port address (usually 330) 79 | mpu_port = 80 | 81 | 82 | # instrument definitions to replace the standard Adlib patch set 83 | ibk_file = 84 | 85 | # instrument definitions to replace the standard set of Adlib percussions 86 | # patches 87 | ibk_drum_file = 88 | 89 | 90 | # patch set for the DIGMID driver 91 | # Specifies where to find the sample set for the DIGMID driver. This can 92 | # either be a Gravis style directory containing a collection of .pat files 93 | # and a default.cfg index, or an Allegro datafile produced by the pat2dat 94 | # utility. If this variable is not set, Doom Legacy will look either for a 95 | # default.cfg or patches.dat file in the same directory as the program, the 96 | # directory pointed to by the ALLEGRO environment variable, and the 97 | # standard GUS directory pointed to by the ULTRASND environment variable. 98 | patches = 99 | -------------------------------------------------------------------------------- /win32/hwr_drv.h: -------------------------------------------------------------------------------- 1 | // hwr_drv.h : macros for defining/using exports from the hardware renderer DLL 2 | 3 | #ifndef __HWR_DRV_H__ 4 | #define __HWR_DRV_H__ 5 | 6 | #include "hwr_data.h" 7 | #include "hwr_defs.h" 8 | 9 | // Function declaration for exports from the DLL : 10 | // EXPORT HWRAPI() ( ) ; 11 | // If _CREATE_DLL_ is defined the above declaration translates to : 12 | // __declspec(dllexport) WINAPI ( ) ; 13 | // If _CREATE_DLL_ is NOT DEFINED the above declaration translates to : 14 | // __declspec(dllexport) type> (WINAPI *) ( ) ; 15 | 16 | #ifdef _CREATE_DLL_ 17 | #ifdef __cplusplus 18 | #define EXPORT extern "C" __declspec( dllexport ) 19 | #else 20 | #define EXPORT __declspec( dllexport ) 21 | #endif 22 | #define HWRAPI(fn) WINAPI fn 23 | #else 24 | #define EXPORT typedef 25 | #define HWRAPI(fn) (WINAPI *fn) 26 | #endif 27 | 28 | 29 | // ========================================================================== 30 | // STANDARD DLL EXPORTS 31 | // ========================================================================== 32 | 33 | EXPORT BOOL HWRAPI( Init ) (void) ; 34 | EXPORT void HWRAPI( Shutdown ) (void) ; 35 | EXPORT void HWRAPI( GetModeList ) (void** pvidmodes, int* numvidmodes) ; 36 | EXPORT void HWRAPI( SetPalette ) (PALETTEENTRY* pal) ; 37 | EXPORT void HWRAPI( FinishUpdate ) (void) ; 38 | 39 | EXPORT void HWRAPI( DrawLine ) (wallVert2D* v1, wallVert2D* v2) ; 40 | EXPORT void HWRAPI( DrawPolygon ) (wallVert2D *triVerts, int nVerts, unsigned long col) ; 41 | EXPORT void HWRAPI( GetState ) (hwdgetstate_t IdState, void* dest) ; 42 | EXPORT void HWRAPI( SetState ) (hwdstate_t IdState, int Value) ; 43 | EXPORT void HWRAPI( ClearBuffer ) (int color, int alpha, hwdcleardepth_t depth) ; 44 | EXPORT void HWRAPI( SetTexture ) (GlideMipmap_t* grMipmap) ; 45 | EXPORT void HWRAPI( ReadRect ) (int x, int y, int width, int height, 46 | int dst_stride, unsigned short * dst_data) ; 47 | EXPORT void HWRAPI( ClipRect ) (int minx, int miny, int maxx, int maxy) ; 48 | 49 | 50 | // ========================================================================== 51 | // HWR DRIVER OBJECT, FOR CLIENT PROGRAM 52 | // ========================================================================== 53 | 54 | #if !defined(_CREATE_DLL_) 55 | 56 | struct hwdriver_s { 57 | Init pfnInit; 58 | Shutdown pfnShutdown; 59 | GetModeList pfnGetModeList; 60 | SetPalette pfnSetPalette; 61 | FinishUpdate pfnFinishUpdate; 62 | DrawLine pfnDrawLine; 63 | DrawPolygon pfnDrawPolygon; 64 | GetState pfnGetState; 65 | SetState pfnSetState; 66 | ClearBuffer pfnClearBuffer; 67 | SetTexture pfnSetTexture; 68 | ReadRect pfnReadRect; 69 | ClipRect pfnClipRect; 70 | }; 71 | 72 | extern struct hwdriver_s hwdriver; 73 | 74 | #define HWD hwdriver 75 | 76 | #endif //not defined _CREATE_DLL_ 77 | 78 | #endif __HWR_DRV_H__ 79 | -------------------------------------------------------------------------------- /i_system.h: -------------------------------------------------------------------------------- 1 | // System specific interface stuff. 2 | 3 | 4 | #ifndef __I_SYSTEM__ 5 | #define __I_SYSTEM__ 6 | 7 | #include "d_ticcmd.h" 8 | #include "d_event.h" 9 | 10 | #ifdef __GNUG__ 11 | #pragma interface 12 | #endif 13 | 14 | // See Shutdown_xxx() routines. 15 | extern byte graphics_started; 16 | extern byte keyboard_started; 17 | extern byte sound_started; 18 | //extern byte music_installed; 19 | 20 | /* flag for 'win-friendly' mode used by interface code */ 21 | extern int i_love_bill; 22 | extern volatile ULONG ticcount; 23 | 24 | // Called by DoomMain. 25 | void I_InitJoystick (void); 26 | 27 | // Called by startup code 28 | // to get the ammount of memory to malloc 29 | // for the zone management. 30 | byte* I_ZoneBase (int *size); 31 | 32 | void I_GetFreeMem(void); 33 | 34 | // Called by D_DoomLoop, 35 | // returns current time in tics. 36 | ULONG I_GetTime (void); 37 | 38 | 39 | void I_GetEvent (void); 40 | 41 | 42 | // 43 | // Called by D_DoomLoop, 44 | // called before processing any tics in a frame 45 | // (just after displaying a frame). 46 | // Time consuming syncronous operations 47 | // are performed here (joystick reading). 48 | // Can call D_PostEvent. 49 | // 50 | void I_StartFrame (void); 51 | 52 | 53 | // 54 | // Called by D_DoomLoop, 55 | // called before processing each tic in a frame. 56 | // Quick syncronous operations are performed here. 57 | // Can call D_PostEvent. 58 | void I_StartTic (void); 59 | 60 | // Asynchronous interrupt functions should maintain private queues 61 | // that are read by the synchronous functions 62 | // to be converted into events. 63 | 64 | // Either returns a null ticcmd, 65 | // or calls a loadable driver to build it. 66 | // This ticcmd will then be modified by the gameloop 67 | // for normal input. 68 | ticcmd_t* I_BaseTiccmd (void); 69 | 70 | 71 | // Called by M_Responder when quit is selected, return code 0. 72 | void I_Quit (void); 73 | 74 | void I_Error (char *error, ...); 75 | 76 | // Allocates from low memory under dos, 77 | // just mallocs under unix 78 | byte* I_AllocLow (int length); 79 | 80 | void I_Tactile (int on, int off, int total); 81 | 82 | //added:18-02-98: write a message to stderr (use before I_Quit) 83 | // for when you need to quit with a msg, but need 84 | // the return code 0 of I_Quit(); 85 | void I_OutputMsg (char *error, ...); 86 | 87 | void I_StartupMouse (void); 88 | 89 | // keyboard startup,shutdown,handler 90 | void I_StartupKeyboard (void); 91 | 92 | // setup timer irq and user timer routine. 93 | void I_TimerISR (void); //timer callback routine. 94 | void I_StartupTimer (void); 95 | 96 | /* list of functions to call at program cleanup */ 97 | void I_AddExitFunc (void (*func)()); 98 | void I_RemoveExitFunc (void (*func)()); 99 | 100 | // Setup signal handler, plus stuff for trapping errors and cleanly exit. 101 | int I_StartupSystem (void); 102 | void I_ShutdownSystem (void); 103 | 104 | #endif 105 | //----------------------------------------------------------------------------- 106 | // 107 | // $Log:$ 108 | // 109 | //----------------------------------------------------------------------------- 110 | -------------------------------------------------------------------------------- /s_sound.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // The not so system specific sound interface. 19 | // 20 | //----------------------------------------------------------------------------- 21 | 22 | 23 | #ifndef __S_SOUND__ 24 | #define __S_SOUND__ 25 | 26 | #include "sounds.h" 27 | 28 | extern consvar_t stereoreverse; 29 | 30 | extern consvar_t cv_soundvolume; 31 | extern consvar_t cv_musicvolume; 32 | extern consvar_t cv_numChannels; 33 | 34 | extern CV_PossibleValue_t soundvolume_cons_t[]; 35 | //part of i_cdmus.c 36 | extern consvar_t cd_volume; 37 | extern consvar_t cdUpdate; 38 | 39 | // register sound vars and commands at game startup 40 | void S_RegisterSoundStuff (void); 41 | 42 | 43 | // 44 | // Initializes sound stuff, including volume 45 | // Sets channels, SFX and music volume, 46 | // allocates channel buffer, sets S_sfx lookup. 47 | // 48 | void S_Init (int sfxVolume, int musicVolume); 49 | 50 | 51 | // 52 | // Per level startup code. 53 | // Kills playing sounds at start of level, 54 | // determines music if any, changes music. 55 | // 56 | void S_Start(void); 57 | 58 | // 59 | // basicaly a wgetnumforname with adding "ds" at the begin of string 60 | // return a lumpnum 61 | // 62 | int S_GetSfxLumpNum (sfxinfo_t* sfx); 63 | 64 | // 65 | // Start sound for thing at 66 | // using from sounds.h 67 | // 68 | void 69 | S_StartSound 70 | ( void* origin, 71 | int sound_id ); 72 | 73 | 74 | 75 | // Will start a sound at a given volume. 76 | void 77 | S_StartSoundAtVolume 78 | ( void* origin, 79 | int sound_id, 80 | int volume ); 81 | 82 | 83 | // Stop sound for thing at 84 | void S_StopSound(void* origin); 85 | 86 | 87 | // Start music using from sounds.h 88 | void S_StartMusic(int music_id); 89 | 90 | // Start music using from sounds.h, 91 | // and set whether looping 92 | void S_ChangeMusic (int music_id, int looping); 93 | 94 | // Stops the music fer sure. 95 | void S_StopMusic(void); 96 | 97 | // Stop and resume music, during game PAUSE. 98 | void S_PauseSound(void); 99 | void S_ResumeSound(void); 100 | 101 | 102 | // 103 | // Updates music & sounds 104 | // 105 | void S_UpdateSounds(void); 106 | 107 | void S_SetMusicVolume(int volume); 108 | void S_SetSfxVolume(int volume); 109 | 110 | 111 | #endif 112 | //----------------------------------------------------------------------------- 113 | // 114 | // $Log:$ 115 | // 116 | //----------------------------------------------------------------------------- 117 | -------------------------------------------------------------------------------- /win32/glidestuff.txt: -------------------------------------------------------------------------------- 1 | // first version, problem with corner clipping 2 | // 3 | int ClipWallToFrustum (wallVert3D *inVerts, wallVert3D *poutvert) 4 | { 5 | float tl,tu; 6 | float deltax, deltay, deltaz; 7 | 8 | int i; 9 | int nrClipVerts; 10 | wallVert3D *pinvert; 11 | wallVert3D *nextvert; 12 | //wallVert3D temp[8]; //temporary clipped vertices for left/right border 13 | 14 | // set texture coordinates 15 | pinvert = inVerts; 16 | 17 | pinvert[0].s = 0.0f; 18 | pinvert[3].s = 0.0f; 19 | pinvert[2].s = 255.0f; 20 | pinvert[1].s = 255.0f; 21 | pinvert[3].t = 0.0f; 22 | pinvert[2].t = 0.0f; 23 | pinvert[0].t = 199.0f; 24 | pinvert[1].t = 199.0f; 25 | 26 | nrClipVerts = 0; 27 | 28 | for (i=0; i<4; i++) 29 | { 30 | nextvert = &inVerts[ (i + 1) & 3 ]; 31 | 32 | tl = 0; tu = 1; 33 | deltax = nextvert->x - pinvert->x; 34 | deltaz = nextvert->z - pinvert->z; 35 | if ( ClipT( -deltax - deltaz, pinvert->x + pinvert->z, &tl, &tu ) ) { 36 | if ( ClipT( deltax - deltaz, pinvert->z - pinvert->x, &tl, &tu ) ) { 37 | deltay = nextvert->y - pinvert->y; 38 | if ( ClipT( -deltay - deltaz, pinvert->y + pinvert->z, &tl, &tu ) ) { 39 | if ( ClipT( deltay - deltaz, pinvert->z - pinvert->y, &tl, &tu ) ) { 40 | // clipped start point 41 | if ( tl > 0 ) { 42 | poutvert->x = pinvert->x + tl * deltax; 43 | poutvert->y = pinvert->y + tl * deltay; 44 | poutvert->z = pinvert->z + tl * deltaz; 45 | 46 | poutvert->w = pinvert->w + tl * (nextvert->w - pinvert->w); 47 | poutvert->s = pinvert->s + tl * (nextvert->s - pinvert->s); 48 | poutvert->t = pinvert->t + tl * (nextvert->t - pinvert->t); 49 | } 50 | else { 51 | // copy as it is 52 | *poutvert = *pinvert; 53 | } 54 | poutvert++; 55 | nrClipVerts++; 56 | 57 | // clipped end point 58 | if ( tu < 1 ) { 59 | poutvert->x = pinvert->x + tu * deltax; 60 | poutvert->y = pinvert->y + tu * deltay; 61 | poutvert->z = pinvert->z + tu * deltaz; 62 | 63 | poutvert->w = pinvert->w + tu * (nextvert->w - pinvert->w); 64 | poutvert->s = pinvert->s + tu * (nextvert->s - pinvert->s); 65 | poutvert->t = pinvert->t + tu * (nextvert->t - pinvert->t); 66 | 67 | poutvert++; 68 | nrClipVerts++; 69 | } 70 | 71 | // ?? 72 | } 73 | } 74 | } 75 | } 76 | 77 | pinvert++; 78 | } 79 | 80 | return nrClipVerts; 81 | } 82 | -------------------------------------------------------------------------------- /win32/win_dll.c: -------------------------------------------------------------------------------- 1 | // win_3dll.c : load and initialise the 3D driver DLL 2 | 3 | #include "hwr_drv.h" // get the standard 3D Driver DLL exports prototypes 4 | #include "win_dll.h" 5 | #include "win_main.h" // I_GetLastErrorMsgBox() 6 | 7 | // m_misc.h 8 | char *va(char *format, ...); 9 | 10 | 11 | // ========================================================================== 12 | // STANDARD 3D DRIVER DLL FOR DOOM LEGACY 13 | // ========================================================================== 14 | 15 | // note : the 3D driver loading should be put somewhere else.. 16 | 17 | HINSTANCE hwdInstance = NULL; 18 | 19 | loadfunc_t hwdFuncTable[] = { 20 | {"_Init@0", &hwdriver.pfnInit}, 21 | {"_Shutdown@0", &hwdriver.pfnShutdown}, 22 | {"_GetModeList@8", &hwdriver.pfnGetModeList}, 23 | {"_SetPalette@4", &hwdriver.pfnSetPalette}, 24 | {"_FinishUpdate@0", &hwdriver.pfnFinishUpdate}, 25 | {"_DrawLine@8", &hwdriver.pfnDrawLine}, 26 | {"_DrawPolygon@12", &hwdriver.pfnDrawPolygon}, 27 | {"_GetState@8", &hwdriver.pfnGetState}, 28 | {"_SetState@8", &hwdriver.pfnSetState}, 29 | {"_ClearBuffer@12", &hwdriver.pfnClearBuffer}, 30 | {"_SetTexture@4", &hwdriver.pfnSetTexture}, 31 | {"_ReadRect@24", &hwdriver.pfnReadRect}, 32 | {"_ClipRect@16", &hwdriver.pfnClipRect}, 33 | {NULL,NULL} 34 | }; 35 | 36 | BOOL Init3DDriver (char* dllName) 37 | { 38 | hwdInstance = LoadDLL (dllName, hwdFuncTable); 39 | return (hwdInstance != NULL); 40 | } 41 | 42 | void Shutdown3DDriver (void) 43 | { 44 | UnloadDLL (&hwdInstance); 45 | } 46 | 47 | 48 | // -------------------------------------------------------------------------- 49 | // Load a DLL, returns the HINSTANCE handle or NULL 50 | // -------------------------------------------------------------------------- 51 | HINSTANCE LoadDLL (char* dllName, loadfunc_t* funcTable) 52 | { 53 | void* funcPtr; 54 | loadfunc_t* loadfunc; 55 | HINSTANCE hInstance; 56 | 57 | if ((hInstance = LoadLibrary (dllName)) != NULL) 58 | { 59 | // get function pointers for all functions we use 60 | for (loadfunc = funcTable; loadfunc->fnName!=NULL; loadfunc++) 61 | { 62 | funcPtr = GetProcAddress (hInstance, loadfunc->fnName); 63 | if (!funcPtr) { 64 | //I_GetLastErrorMsgBox (); 65 | MessageBox( NULL, va("GetProcAddress() FAILED : function '%s' not found in %s", loadfunc->fnName, dllName), "Error", MB_OK|MB_ICONINFORMATION ); 66 | return FALSE; 67 | } 68 | // store function address 69 | *((void**)loadfunc->fnPointer) = funcPtr; 70 | } 71 | } 72 | else 73 | { 74 | MessageBox( NULL, va("LoadLibrary() FAILED : couldn't load '%s'\r\n", dllName), "Warning", MB_OK|MB_ICONINFORMATION ); 75 | //I_GetLastErrorMsgBox (); 76 | } 77 | 78 | return hInstance; 79 | } 80 | 81 | 82 | // -------------------------------------------------------------------------- 83 | // Unload the DLL 84 | // -------------------------------------------------------------------------- 85 | void UnloadDLL (HINSTANCE* pInstance) 86 | { 87 | if (FreeLibrary (*pInstance)) 88 | *pInstance = NULL; 89 | else 90 | I_GetLastErrorMsgBox (); 91 | } 92 | -------------------------------------------------------------------------------- /i_net.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // System specific network interface stuff. 19 | // 20 | //----------------------------------------------------------------------------- 21 | 22 | 23 | #ifndef __I_NET__ 24 | #define __I_NET__ 25 | 26 | #ifdef __GNUG__ 27 | #pragma interface 28 | #endif 29 | 30 | #define DOOMCOM_ID 0x12345678l 31 | 32 | #define MAXPACKETLENGHT 512 33 | 34 | typedef struct 35 | { 36 | // Supposed to be DOOMCOM_ID 37 | long id; 38 | 39 | // DOOM executes an int to execute commands. 40 | short intnum; 41 | // Communication between DOOM and the driver. 42 | // Is CMD_SEND or CMD_GET. 43 | short command; 44 | // Is dest for send, set by get (-1 = no packet). 45 | short remotenode; 46 | 47 | // Number of bytes in doomdata to be sent 48 | short datalength; 49 | 50 | // Info common to all nodes. 51 | // Console is allways node 0. 52 | short numnodes; 53 | // Flag: 1 = no duplication, 2-5 = dup for slow nets. 54 | short ticdup; 55 | // Flag: 1 = send a backup tic in every packet. 56 | short extratics; 57 | // deathmatch type 0=coop, 1=deathmatch 1 ,2 = deathmatch 2. 58 | short deathmatch; 59 | // Flag: -1 = new game, 0-5 = load savegame 60 | short savegame; 61 | short episode; // 1-3 62 | short map; // 1-9 63 | short skill; // 1-5 64 | 65 | // Info specific to this node. 66 | short consoleplayer; 67 | // Number total of players 68 | short numplayers; 69 | 70 | // These are related to the 3-display mode, 71 | // in which two drones looking left and right 72 | // were used to render two additional views 73 | // on two additional computers. 74 | // Probably not operational anymore. (maybe a day in Legacy) 75 | // 1 = left, 0 = center, -1 = right 76 | short angleoffset; 77 | // 1 = drone 78 | short drone; 79 | 80 | // The packet data to be sent. 81 | char data[MAXPACKETLENGHT]; 82 | 83 | } doomcom_t; 84 | 85 | extern doomcom_t *doomcom; 86 | // Called by D_DoomMain. 87 | 88 | // to be defined by the network driver 89 | void (*I_NetGet) (void); 90 | void (*I_NetSend) (void); 91 | void (*I_NetShutdown) (void); 92 | void (*I_NetFreeNodenum) (int nodenum); 93 | 94 | void I_InitNetwork (void); 95 | 96 | #endif 97 | //----------------------------------------------------------------------------- 98 | // 99 | // $Log:$ 100 | // 101 | //----------------------------------------------------------------------------- 102 | -------------------------------------------------------------------------------- /r_data.h: -------------------------------------------------------------------------------- 1 | // DESCRIPTION: 2 | // Refresh module, data I/O, caching, retrieval of graphics 3 | // by name. 4 | 5 | 6 | #ifndef __R_DATA__ 7 | #define __R_DATA__ 8 | 9 | #include "r_defs.h" 10 | #include "r_state.h" 11 | 12 | #ifdef __GNUG__ 13 | #pragma interface 14 | #endif 15 | 16 | 17 | // moved here for r_sky.c (texture_t is used) 18 | 19 | // 20 | // Texture definition. 21 | // Each texture is composed of one or more patches, 22 | // with patches being lumps stored in the WAD. 23 | // The lumps are referenced by number, and patched 24 | // into the rectangular texture space using origin 25 | // and possibly other attributes. 26 | // 27 | typedef struct 28 | { 29 | short originx; 30 | short originy; 31 | short patch; 32 | short stepdir; 33 | short colormap; 34 | } mappatch_t; 35 | 36 | 37 | // 38 | // Texture definition. 39 | // A DOOM wall texture is a list of patches 40 | // which are to be combined in a predefined order. 41 | // 42 | typedef struct 43 | { 44 | char name[8]; 45 | boolean masked; 46 | short width; 47 | short height; 48 | void **columndirectory; // OBSOLETE 49 | short patchcount; 50 | mappatch_t patches[1]; 51 | } maptexture_t; 52 | 53 | 54 | // A single patch from a texture definition, 55 | // basically a rectangular area within 56 | // the texture rectangle. 57 | typedef struct 58 | { 59 | // Block origin (allways UL), 60 | // which has allready accounted 61 | // for the internal origin of the patch. 62 | int originx; 63 | int originy; 64 | int patch; 65 | } texpatch_t; 66 | 67 | 68 | // A maptexturedef_t describes a rectangular texture, 69 | // which is composed of one or more mappatch_t structures 70 | // that arrange graphic patches. 71 | typedef struct 72 | { 73 | // Keep name for switch changing, etc. 74 | char name[8]; 75 | short width; 76 | short height; 77 | 78 | // All the patches[patchcount] 79 | // are drawn back to front into the cached texture. 80 | short patchcount; 81 | texpatch_t patches[1]; 82 | 83 | } texture_t; 84 | 85 | 86 | // all loaded and prepared textures from the start of the game 87 | extern texture_t** textures; 88 | 89 | extern lighttable_t *colormaps; 90 | extern CV_PossibleValue_t Color_cons_t[]; 91 | 92 | // Load TEXTURE1/TEXTURE2/PNAMES definitions, create lookup tables 93 | void R_LoadTextures (void); 94 | void R_FlushTextureCache (void); 95 | 96 | // Retrieve column data for span blitting. 97 | byte* R_GetColumn (int tex, int col); 98 | 99 | byte* R_GetFlat (int flatnum); 100 | 101 | // I/O, setting up the stuff. 102 | void R_InitData (void); 103 | void R_PrecacheLevel (void); 104 | 105 | 106 | // Retrieval. 107 | // Floor/ceiling opaque texture tiles, 108 | // lookup by name. For animation? 109 | int R_FlatNumForName (char* name); 110 | 111 | 112 | // Called by P_Ticker for switches and animations, 113 | // returns the texture number for the texture name. 114 | int R_TextureNumForName (char *name); 115 | int R_CheckTextureNumForName (char *name); 116 | 117 | #endif 118 | //----------------------------------------------------------------------------- 119 | // 120 | // $Log:$ 121 | // 122 | //----------------------------------------------------------------------------- 123 | -------------------------------------------------------------------------------- /DJGPPDOS/I_net.c: -------------------------------------------------------------------------------- 1 | // i_net.c : network interface 2 | 3 | #ifdef PC_DOS 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | 15 | #include "../doomdef.h" 16 | 17 | #include "../i_system.h" 18 | #include "../d_event.h" 19 | #include "../d_net.h" 20 | #include "../m_argv.h" 21 | 22 | #include "../doomstat.h" 23 | #include "../z_zone.h" 24 | #include "../i_net.h" 25 | #include "../i_tcp.h" 26 | 27 | // 28 | // NETWORKING 29 | // 30 | 31 | typedef enum 32 | { 33 | CMD_SEND = 1, 34 | CMD_GET = 2 35 | 36 | } command_t; 37 | 38 | static int doomatic; 39 | 40 | void External_Driver_Get(void); 41 | void External_Driver_Send(void); 42 | 43 | void Internal_Get(void) 44 | { 45 | I_Error("Get without netgame\n"); 46 | } 47 | 48 | void Internal_Send(void) 49 | { 50 | I_Error("Send without netgame\n"); 51 | } 52 | 53 | void Internal_FreeNodenum(int nodenum) 54 | {} 55 | 56 | 57 | // 58 | // I_InitNetwork 59 | // 60 | void I_InitNetwork (void) 61 | { 62 | int netgamepar; 63 | 64 | I_NetGet = Internal_Get; 65 | I_NetSend = Internal_Send; 66 | I_NetShutdown = NULL; 67 | I_NetFreeNodenum = Internal_FreeNodenum; 68 | netgamepar = M_CheckParm ("-net"); 69 | if(!netgamepar) 70 | { 71 | doomcom=Z_Malloc(sizeof(doomcom_t),PU_STATIC,NULL); 72 | memset(doomcom,0,sizeof(doomcom_t)); 73 | doomcom->id = DOOMCOM_ID; 74 | 75 | if(!I_InitTcpNetwork()) 76 | { 77 | netgame = false; 78 | server = true; 79 | multiplayer = false; 80 | 81 | doomcom->numplayers = doomcom->numnodes = 1; 82 | doomcom->deathmatch = false; 83 | doomcom->consoleplayer = 0; 84 | doomcom->ticdup = 1; 85 | doomcom->extratics = 0; 86 | return; 87 | } 88 | } 89 | else 90 | { // externals drivers specific 91 | 92 | __djgpp_nearptr_enable(); 93 | // set up for network 94 | doomcom=(doomcom_t *)(__djgpp_conventional_base+atoi(myargv[netgamepar+1])); 95 | CONS_Printf("I_DosNet : Using int 0x%x for communication\n",doomcom->intnum); 96 | 97 | doomatic=M_CheckParm("-doomatic"); 98 | server = (doomcom->consoleplayer == 0); 99 | servernode=-1; 100 | 101 | I_NetGet = External_Driver_Get; 102 | I_NetSend = External_Driver_Send; 103 | I_NetShutdown = NULL; 104 | if (M_CheckParm ("-extratic")) 105 | doomcom->extratics = 1; 106 | else 107 | doomcom->extratics = 0; 108 | } 109 | 110 | // net game 111 | 112 | netgame = true; 113 | multiplayer = false; 114 | 115 | // litle optimitation with doomatic 116 | // it store the boolean packetreceived in the doomcom->drone 117 | // (see External_Driver_Get) 118 | doomcom->ticdup = 1; 119 | } 120 | 121 | void External_Driver_Get(void) 122 | { 123 | __dpmi_regs r; 124 | 125 | doomcom->command=CMD_GET; 126 | 127 | // it normaly save a task switch to the processor 128 | if(doomatic && !doomcom->drone) 129 | { 130 | doomcom->remotenode = -1; 131 | return; 132 | } 133 | 134 | __dpmi_int(doomcom->intnum,&r); 135 | } 136 | 137 | void External_Driver_Send(void) 138 | { 139 | __dpmi_regs r; 140 | 141 | doomcom->command=CMD_SEND; 142 | __dpmi_int(doomcom->intnum,&r); 143 | } 144 | 145 | #endif 146 | -------------------------------------------------------------------------------- /DJGPPDOS/BCD.H: -------------------------------------------------------------------------------- 1 | /* bcd.h -- header file for BCD, a CD-ROM audio playing library for DJGPP 2 | by Brennan Underwood, http://brennan.home.ml.org/ */ 3 | #ifndef _BCD_H 4 | #define _BCD_H 5 | 6 | #define BCD_VERSION 0x0103 7 | 8 | /* Installation and setup functions */ 9 | /* Call this first! */ 10 | int bcd_open(void); 11 | /* Call before exit. */ 12 | int bcd_close(void); 13 | 14 | /* open door, unlocking first if necessary */ 15 | int bcd_open_door(void); 16 | /* close door */ 17 | int bcd_close_door(void); 18 | 19 | /* pass 1 to lock door, 0 to unlock */ 20 | int bcd_lock(int); 21 | 22 | /* returns one of the following 3 #defined symbols */ 23 | int bcd_disc_changed(void); 24 | #define BCD_DISC_CHANGED 0xff 25 | #define BCD_DISC_NOT_CHANGED 1 26 | #define BCD_DISC_UNKNOWN 0 27 | 28 | /* perform a device reset */ 29 | int bcd_reset(void); 30 | 31 | /* compare the returned status int to the following bits */ 32 | int bcd_device_status(void); 33 | #define BCD_DOOR_OPEN 1 34 | #define BCD_DOOR_UNLOCKED 2 35 | #define BCD_SUPPORT_COOKED 4 36 | #define BCD_READ_ONLY 8 37 | #define BCD_DATA_READ_ONLY 16 38 | #define BCD_SUPPORT_INTERLEAVE 32 39 | 40 | /* returns 1 if audio is currently playing, 0 otherwise. -1 on error */ 41 | int bcd_audio_busy(void); 42 | /* current head position in frames */ 43 | int bcd_audio_position(void); 44 | /* convenience function, if audio busy, returns track# playing now */ 45 | int bcd_now_playing(void); 46 | 47 | /* query MSCDEX for track list when disc changed or just starting up */ 48 | int bcd_get_audio_info(void); 49 | /* get a particular track's info */ 50 | int bcd_get_track_address(int trackno, int *start, int *len); 51 | /* check for track's audio/data status */ 52 | int bcd_track_is_audio(int trackno); 53 | /* play a particular track from beginning to end */ 54 | int bcd_play_track(int tracknum); 55 | /* play an arbitrary section of audio for an arbitrary length of time */ 56 | int bcd_play(int start, int len); 57 | /* set the output volume. pass a parameter from 0-255 */ 58 | int bcd_set_volume(int); 59 | /* stop and pause are equivalent */ 60 | int bcd_stop(void); 61 | #define bcd_pause bcd_stop 62 | int bcd_resume(void); 63 | 64 | extern int num_tracks; 65 | extern int lowest_track, highest_track; 66 | 67 | /* Troubleshooting */ 68 | /* Returns a human readable description of the last error encountered */ 69 | char *bcd_error(void); 70 | extern int _error_code; 71 | /* If you are mad enough play the Rach 3, I mean parse _error_code yourself */ 72 | #define BCD_DE_WRITE_PROTECT 0 73 | #define BCD_DE_UNKNOWN_UNIT 1 74 | #define BCD_DE_DRIVE_NOT_READY 2 75 | #define BCD_DE_UNKNOWN_COMMAND 3 76 | #define BCD_DE_CRC_ERROR 4 77 | #define BCD_DE_STRUCT_LEN 5 78 | #define BCD_DE_SEEK_ERROR 6 79 | #define BCD_DE_UNKNOWN_MEDIA 7 80 | #define BCD_DE_SECTOR_NOT_FOUND 8 81 | #define BCD_DE_OUT_OF_PAPER 9 82 | #define BCD_DE_WRITE_FAULT 10 83 | #define BCD_DE_READ_FAULT 11 84 | #define BCD_DE_GENERAL_FAILURE 12 85 | #define BCD_DE_INVALID_DISK_CHANGE 15 86 | /* set by BCD itself, for stuff like "Out of memory" */ 87 | extern char *_bcd_error; 88 | 89 | /* uncomment this line to force BCD to use a statically allocated 90 | Track array instead of using malloc */ 91 | #define STATIC_TRACKS 92 | 93 | typedef struct { 94 | int is_audio; 95 | int start, end, len; 96 | } Track; 97 | 98 | extern Track tracks[99]; 99 | 100 | #endif 101 | -------------------------------------------------------------------------------- /i_sound.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 19 | // System interface, sound. 20 | // 21 | //----------------------------------------------------------------------------- 22 | 23 | #ifndef __I_SOUND__ 24 | #define __I_SOUND__ 25 | 26 | #include "doomdef.h" 27 | #include "sounds.h" 28 | 29 | 30 | void* I_GetSfx (sfxinfo_t* sfx); 31 | void I_FreeSfx (sfxinfo_t* sfx); 32 | 33 | 34 | // Init at program start... 35 | void I_StartupSound(); 36 | 37 | // ... update sound buffer and audio device at runtime... 38 | void I_UpdateSound(void); 39 | void I_SubmitSound(void); 40 | 41 | // ... shut down and relase at program termination. 42 | void I_ShutdownSound(void); 43 | 44 | 45 | // 46 | // SFX I/O 47 | // 48 | 49 | // Starts a sound in a particular sound channel. 50 | int 51 | I_StartSound 52 | ( int id, 53 | int vol, 54 | int sep, 55 | int pitch, 56 | int priority ); 57 | 58 | 59 | // Stops a sound channel. 60 | void I_StopSound(int handle); 61 | 62 | // Called by S_*() functions 63 | // to see if a channel is still playing. 64 | // Returns 0 if no longer playing, 1 if playing. 65 | int I_SoundIsPlaying(int handle); 66 | 67 | // Updates the volume, separation, 68 | // and pitch of a sound channel. 69 | void 70 | I_UpdateSoundParams 71 | ( int handle, 72 | int vol, 73 | int sep, 74 | int pitch ); 75 | 76 | 77 | // 78 | // MUSIC I/O 79 | // 80 | void I_InitMusic(void); 81 | void I_ShutdownMusic(void); 82 | // Volume. 83 | void I_SetMusicVolume(int volume); 84 | void I_SetSfxVolume(int volume); 85 | // PAUSE game handling. 86 | void I_PauseSong(int handle); 87 | void I_ResumeSong(int handle); 88 | // Registers a song handle to song data. 89 | int I_RegisterSong(void* data,int len); 90 | // Called by anything that wishes to start music. 91 | // plays a song, and when the song is done, 92 | // starts playing it again in an endless loop. 93 | // Horrible thing to do, considering. 94 | void 95 | I_PlaySong 96 | ( int handle, 97 | int looping ); 98 | // Stops a song over 3 seconds. 99 | void I_StopSong(int handle); 100 | // See above (register), then think backwards 101 | void I_UnRegisterSong(int handle); 102 | 103 | 104 | // i_cdmus.h : cd music interface 105 | // 106 | extern byte cdaudio_started; 107 | 108 | void I_InitCD (void); 109 | void I_StopCD (void); 110 | void I_ResumeCD (void); 111 | void I_ShutdownCD (void); 112 | void I_UpdateCD (void); 113 | void I_PlayCD (int track, boolean looping); 114 | int I_SetVolumeCD (int volume); // return 0 on failure 115 | 116 | #endif 117 | //----------------------------------------------------------------------------- 118 | // 119 | // $Log:$ 120 | // 121 | //----------------------------------------------------------------------------- 122 | -------------------------------------------------------------------------------- /z_zone.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // Zone Memory Allocation, perhaps NeXT ObjectiveC inspired. 19 | // Remark: this was the only stuff that, according 20 | // to John Carmack, might have been useful for 21 | // Quake. 22 | // 23 | //--------------------------------------------------------------------- 24 | 25 | 26 | 27 | #ifndef __Z_ZONE__ 28 | #define __Z_ZONE__ 29 | 30 | #include 31 | 32 | // 33 | // ZONE MEMORY 34 | // PU - purge tags. 35 | // Tags < 100 are not overwritten until freed. 36 | #define PU_STATIC 1 // static entire execution time 37 | #define PU_SOUND 2 // static while playing 38 | #define PU_MUSIC 3 // static while playing 39 | #define PU_DAVE 4 // anything else Dave wants static 40 | 41 | #define PU_3DFXPATCHINFO 5 // 3Dfx GlidePatch_t struct for Glide texture cache 42 | 43 | #define PU_LEVEL 50 // static until level exited 44 | #define PU_LEVSPEC 51 // a special thinker in a level 45 | // Tags >= 100 are purgable whenever needed. 46 | #define PU_PURGELEVEL 100 47 | #define PU_CACHE 101 48 | #define PU_3DFXCACHE 102 // 'second-level' cache for graphics 49 | // stored in 3Dfx format and downloaded 50 | // as needed 51 | 52 | void Z_Init (void); 53 | void* Z_Malloc (int size, int tag, void *ptr); 54 | void Z_Free (void *ptr); 55 | //void Z_Free2 (void *ptr,char *file,int line); 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 (int i); 60 | void Z_ChangeTag2 (void *ptr, int tag); 61 | 62 | // returns number of bytes allocated for one tag type 63 | int Z_TagUsage (int tagnum); 64 | 65 | void Z_FreeMemory (int *realfree,int *cachemem,int *usedmem); 66 | 67 | 68 | typedef struct memblock_s 69 | { 70 | int size; // including the header and possibly tiny fragments 71 | void** user; // NULL if a free block 72 | int tag; // purgelevel 73 | int id; // should be ZONEID 74 | struct memblock_s* next; 75 | struct memblock_s* prev; 76 | } memblock_t; 77 | 78 | // 79 | // This is used to get the local FILE:LINE info from CPP 80 | // prior to really call the function in question. 81 | // 82 | #define Z_ChangeTag(p,t) \ 83 | { \ 84 | if (( (memblock_t *)( (byte *)(p) - sizeof(memblock_t)))->id!=0x1d4a11) \ 85 | I_Error("Z_CT at "__FILE__":%i",__LINE__); \ 86 | Z_ChangeTag2(p,t); \ 87 | }; 88 | 89 | //#define Z_Free(a) Z_Free2(a,__FILE__,__LINE__) 90 | 91 | #endif 92 | //----------------------------------------------------------------------------- 93 | // 94 | // $Log:$ 95 | // 96 | //----------------------------------------------------------------------------- 97 | -------------------------------------------------------------------------------- /g_game.h: -------------------------------------------------------------------------------- 1 | // g_game.h : 2 | 3 | #ifndef __G_GAME__ 4 | #define __G_GAME__ 5 | 6 | #include "doomdef.h" 7 | #include "doomstat.h" 8 | #include "d_event.h" 9 | 10 | //added:11-02-98: yeah now you can change it! 11 | // changed to 2d array 19990220 by Kin 12 | extern char player_names[MAXPLAYERS][MAXPLAYERNAME]; 13 | extern char* team_names[]; 14 | 15 | extern boolean nomonsters; // checkparm of -nomonsters 16 | extern boolean respawnparm; // checkparm of -respawn 17 | extern boolean fastparm; // checkparm of -fast 18 | 19 | extern player_t players[MAXPLAYERS]; 20 | extern boolean playeringame[MAXPLAYERS]; 21 | 22 | // ====================================== 23 | // DEMO playback/recording related stuff. 24 | // ====================================== 25 | extern boolean usergame; 26 | 27 | // demoplaying back and demo recording 28 | extern boolean demoplayback; 29 | extern boolean demorecording; 30 | extern boolean timingdemo; // timedemo 31 | 32 | // Quit after playing a demo from cmdline. 33 | extern boolean singledemo; 34 | 35 | extern ULONG levelstarttic; // gametic at level start 36 | 37 | // used in game menu 38 | extern consvar_t cv_crosshair; 39 | extern consvar_t cv_autorun; 40 | extern consvar_t cv_invertmouse; 41 | extern consvar_t cv_alwaysfreelook; 42 | extern consvar_t cv_showmessages; 43 | extern consvar_t cv_fastmonsters; 44 | 45 | // build an internal map name ExMx MAPxx from episode,map numbers 46 | char* G_BuildMapName (int episode, int map); 47 | void G_BuildTiccmd (ticcmd_t* cmd, int realtics); 48 | void G_BuildTiccmd2(ticcmd_t* cmd, int realtics); 49 | 50 | //added:22-02-98: clip the console player aiming to the view 51 | short G_ClipAimingPitch (int* aiming); 52 | 53 | extern angle_t localangle,localangle2; 54 | extern int localaiming,localaiming2; // should be a angle_t but signed 55 | 56 | 57 | // 58 | // GAME 59 | // 60 | void G_DoReborn (int playernum); 61 | boolean G_DeathMatchSpawnPlayer (int playernum); 62 | void G_CoopSpawnPlayer (int playernum); 63 | void G_PlayerReborn (int player); 64 | 65 | void G_InitNew (skill_t skill, char* mapname); 66 | 67 | // Can be called by the startup code or M_Responder. 68 | // A normal game starts at map 1, 69 | // but a warp test can start elsewhere 70 | void G_DeferedInitNew (skill_t skill, char* mapname); 71 | 72 | void G_DeferedPlayDemo (char* demo); 73 | 74 | // Can be called by the startup code or M_Responder, 75 | // calls P_SetupLevel or W_EnterWorld. 76 | void G_LoadGame (int slot); 77 | void G_DoLoadGame (int slot); 78 | 79 | // Called by M_Responder. 80 | void G_DoSaveGame(int slot, char* description); 81 | void G_SaveGame (int slot, char* description); 82 | 83 | // Only called by startup code. 84 | void G_RecordDemo (char* name); 85 | 86 | void G_BeginRecording (void); 87 | 88 | void G_PlayDemo (char* name); 89 | void G_TimeDemo (char* name); 90 | void G_StopDemo(void); 91 | boolean G_CheckDemoStatus (void); 92 | 93 | void G_ExitLevel (void); 94 | void G_SecretExitLevel (void); 95 | 96 | void G_WorldDone (void); 97 | 98 | //added:12-02-98: init new features of Doom LEGACY by default 99 | void G_InitNewFeatures (void); 100 | 101 | void G_Ticker (void); 102 | boolean G_Responder (event_t* ev); 103 | 104 | void G_ScreenShot (void); 105 | 106 | 107 | #endif 108 | //----------------------------------------------------------------------------- 109 | // 110 | // $Log:$ 111 | // 112 | //----------------------------------------------------------------------------- 113 | -------------------------------------------------------------------------------- /g_input.h: -------------------------------------------------------------------------------- 1 | //----------------------------------------------------------------------------- 2 | // 3 | // g_input.h 4 | // 5 | //----------------------------------------------------------------------------- 6 | 7 | 8 | #ifndef __G_INPUT__ 9 | #define __G_INPUT__ 10 | 11 | #include "d_event.h" 12 | #include "keys.h" 13 | #include "command.h" 14 | 15 | #define MAXMOUSESENSITIVITY 40 // sensitivity steps 16 | 17 | // number of total 'button' inputs, include keyboard keys, plus virtual 18 | // keys (mousebuttons and joybuttons becomes keys) 19 | #define NUMKEYS 256 20 | 21 | #define MOUSEBUTTONS 3 22 | #define MOUSE2BUTTONS 2 23 | #define JOYBUTTONS 14 // 10 bases + 4 hat 24 | 25 | // 26 | // mouse and joystick buttons are handled as 'virtual' keys 27 | // 28 | #define KEY_MOUSE1 (NUMKEYS) // 256 29 | #define KEY_JOY1 (KEY_MOUSE1 +MOUSEBUTTONS) // 259 30 | #define KEY_DBLMOUSE1 (KEY_JOY1 +JOYBUTTONS) // 263 // double clicks 31 | #define KEY_DBLJOY1 (KEY_DBLMOUSE1+MOUSEBUTTONS) // 266 32 | #define KEY_2MOUSE1 (KEY_DBLJOY1 +JOYBUTTONS) 33 | 34 | #define NUMINPUTS (KEY_2MOUSE1 +MOUSE2BUTTONS) // 270 35 | 36 | enum 37 | { 38 | gc_null = 0, //a key/button mapped to gc_null has no effect 39 | gc_forward, 40 | gc_backward, 41 | gc_strafe, 42 | gc_straferight, 43 | gc_strafeleft, 44 | gc_speed, 45 | gc_turnleft, 46 | gc_turnright, 47 | gc_fire, 48 | gc_use, 49 | gc_lookup, 50 | gc_lookdown, 51 | gc_centerview, 52 | gc_mouseaiming, // mouse aiming is momentary (toggleable in the menu) 53 | gc_weapon1, 54 | gc_weapon2, 55 | gc_weapon3, 56 | gc_weapon4, 57 | gc_weapon5, 58 | gc_weapon6, 59 | gc_weapon7, 60 | gc_weapon8, 61 | gc_talkkey, 62 | gc_scores, 63 | gc_jump, 64 | gc_console, 65 | gc_nextweapon, 66 | gc_prevweapon, 67 | num_gamecontrols 68 | } gamecontrols_e; 69 | 70 | 71 | // mouse values are used once 72 | extern consvar_t cv_mousesens; 73 | extern consvar_t cv_mlooksens; 74 | extern consvar_t cv_allowjump; 75 | extern consvar_t cv_allowautoaim; 76 | extern int mousex; 77 | extern int mousey; 78 | extern int mlooky; //mousey with mlookSensitivity 79 | 80 | extern int dclicktime; 81 | extern int dclickstate; 82 | extern int dclicks; 83 | extern int dclicktime2; 84 | extern int dclickstate2; 85 | extern int dclicks2; 86 | 87 | extern int joyxmove; 88 | extern int joyymove; 89 | 90 | // current state of the keys : true if pushed 91 | extern byte gamekeydown[NUMINPUTS]; 92 | 93 | // two key codes (or virtual key) per game control 94 | extern int gamecontrol[num_gamecontrols][2]; 95 | extern int gamecontrolbis[num_gamecontrols][2]; // secondary splitscreen player 96 | 97 | // peace to my little coder fingers! 98 | // check a gamecontrol being active or not 99 | 100 | // remaps the input event to a game control. 101 | void G_MapEventsToControls (event_t *ev); 102 | 103 | // returns the name of a key 104 | char* G_KeynumToString (int keynum); 105 | int G_KeyStringtoNum(char *keystr); 106 | 107 | // detach any keys associated to the given game control 108 | void G_ClearControlKeys (int (*setupcontrols)[2], int control); 109 | void Command_Setcontrol_f(void); 110 | void Command_Setcontrol2_f(void); 111 | void G_Controldefault(void); 112 | void G_SaveKeySetting(FILE *f); 113 | 114 | #endif 115 | -------------------------------------------------------------------------------- /p_telept.c: -------------------------------------------------------------------------------- 1 | // p_telept.c : Teleportation. 2 | 3 | #include "doomdef.h" 4 | #include "g_game.h" 5 | #include "p_local.h" 6 | #include "r_state.h" 7 | #include "s_sound.h" 8 | 9 | 10 | // ========================================================================= 11 | // TELEPORTATION 12 | // ========================================================================= 13 | 14 | int EV_Teleport ( line_t* line, 15 | int side, 16 | mobj_t* thing ) 17 | { 18 | int i; 19 | int tag; 20 | mobj_t* m; 21 | mobj_t* fog; 22 | unsigned an; 23 | thinker_t* thinker; 24 | sector_t* sector; 25 | fixed_t oldx; 26 | fixed_t oldy; 27 | fixed_t oldz; 28 | 29 | // don't teleport missiles 30 | if (thing->flags & MF_MISSILE) 31 | return 0; 32 | 33 | // Don't teleport if hit back of line, 34 | // so you can get out of teleporter. 35 | if (side == 1) 36 | return 0; 37 | 38 | 39 | tag = line->tag; 40 | for (i = 0; i < numsectors; i++) 41 | { 42 | if (sectors[ i ].tag == tag ) 43 | { 44 | thinker = thinkercap.next; 45 | for (thinker = thinkercap.next; 46 | thinker != &thinkercap; 47 | thinker = thinker->next) 48 | { 49 | // not a mobj 50 | if (thinker->function.acp1 != (actionf_p1)P_MobjThinker) 51 | continue; 52 | 53 | m = (mobj_t *)thinker; 54 | 55 | // not a teleportman 56 | if (m->type != MT_TELEPORTMAN ) 57 | continue; 58 | 59 | sector = m->subsector->sector; 60 | // wrong sector 61 | if (sector-sectors != i ) 62 | continue; 63 | 64 | oldx = thing->x; 65 | oldy = thing->y; 66 | oldz = thing->z; 67 | 68 | if (!P_TeleportMove (thing, m->x, m->y)) 69 | return 0; 70 | 71 | thing->z = thing->floorz; //fixme: not needed? 72 | if (thing->player) 73 | thing->player->viewz = thing->z+thing->player->viewheight; 74 | 75 | // spawn teleport fog at source and destination 76 | fog = P_SpawnMobj (oldx, oldy, oldz, MT_TFOG); 77 | S_StartSound (fog, sfx_telept); 78 | an = m->angle >> ANGLETOFINESHIFT; 79 | fog = P_SpawnMobj (m->x+20*finecosine[an], m->y+20*finesine[an] 80 | , thing->z, MT_TFOG); 81 | 82 | // emit sound, where? 83 | S_StartSound (fog, sfx_telept); 84 | 85 | // don't move for a bit 86 | if (thing->player) 87 | { 88 | thing->reactiontime = 18; 89 | // added : absolute angle position 90 | if(thing==players[consoleplayer].mo) 91 | localangle = m->angle; 92 | if(thing==players[secondarydisplayplayer].mo) 93 | localangle2 = m->angle; 94 | 95 | // move chasecam at new player location 96 | if ( camera.chase ) 97 | P_ResetCamera (thing->player); 98 | } 99 | 100 | thing->angle = m->angle; 101 | thing->momx = thing->momy = thing->momz = 0; 102 | return 1; 103 | } 104 | } 105 | } 106 | return 0; 107 | } 108 | -------------------------------------------------------------------------------- /r_state.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // Refresh/render internal state variables (global). 19 | // 20 | //----------------------------------------------------------------------------- 21 | 22 | 23 | #ifndef __R_STATE__ 24 | #define __R_STATE__ 25 | 26 | // Need data structure definitions. 27 | #include "d_player.h" 28 | #include "r_data.h" 29 | 30 | 31 | 32 | #ifdef __GNUG__ 33 | #pragma interface 34 | #endif 35 | 36 | 37 | 38 | // 39 | // Refresh internal data structures, 40 | // for rendering. 41 | // 42 | 43 | // needed for texture pegging 44 | extern fixed_t* textureheight; 45 | 46 | // needed for pre rendering (fracs) 47 | extern fixed_t* spritewidth; 48 | extern fixed_t* spriteoffset; 49 | extern fixed_t* spritetopoffset; 50 | 51 | extern lighttable_t* colormaps; 52 | 53 | extern int viewwidth; 54 | extern int scaledviewwidth; 55 | extern int viewheight; 56 | 57 | extern int firstflat; 58 | extern int firstwaterflat; //added:18-02-98:WATER! 59 | 60 | // for global animation 61 | extern int* flattranslation; 62 | extern int* texturetranslation; 63 | 64 | 65 | // Sprite.... 66 | extern int firstspritelump; 67 | extern int lastspritelump; 68 | extern int numspritelumps; 69 | 70 | 71 | 72 | // 73 | // Lookup tables for map data. 74 | // 75 | extern int numsprites; 76 | extern spritedef_t* sprites; 77 | 78 | extern int numvertexes; 79 | extern vertex_t* vertexes; 80 | 81 | extern int numsegs; 82 | extern seg_t* segs; 83 | 84 | extern int numsectors; 85 | extern sector_t* sectors; 86 | 87 | extern int numsubsectors; 88 | extern subsector_t* subsectors; 89 | 90 | extern int numnodes; 91 | extern node_t* nodes; 92 | 93 | extern int numlines; 94 | extern line_t* lines; 95 | 96 | extern int numsides; 97 | extern side_t* sides; 98 | 99 | 100 | // 101 | // POV data. 102 | // 103 | extern fixed_t viewx; 104 | extern fixed_t viewy; 105 | extern fixed_t viewz; 106 | 107 | extern angle_t viewangle; 108 | extern player_t* viewplayer; 109 | 110 | 111 | // ? 112 | extern angle_t clipangle; 113 | 114 | extern int viewangletox[FINEANGLES/2]; 115 | extern angle_t xtoviewangle[MAXVIDWIDTH+1]; 116 | //extern fixed_t finetangent[FINEANGLES/2]; 117 | 118 | extern fixed_t rw_distance; 119 | extern angle_t rw_normalangle; 120 | 121 | 122 | 123 | // angle to line origin 124 | extern int rw_angle1; 125 | 126 | // Segs count? 127 | extern int sscount; 128 | 129 | #endif 130 | //----------------------------------------------------------------------------- 131 | // 132 | // $Log:$ 133 | // 134 | //----------------------------------------------------------------------------- 135 | -------------------------------------------------------------------------------- /p_pspr.h: -------------------------------------------------------------------------------- 1 | // Emacs style mode select -*- C++ -*- 2 | //----------------------------------------------------------------------------- 3 | // 4 | // $Id:$ 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 | // DESCRIPTION: 18 | // Sprite animation. 19 | // 20 | //----------------------------------------------------------------------------- 21 | 22 | 23 | #ifndef __P_PSPR__ 24 | #define __P_PSPR__ 25 | 26 | // Basic data types. 27 | // Needs fixed point, and BAM angles. 28 | #include "m_fixed.h" 29 | #include "tables.h" 30 | 31 | 32 | // 33 | // Needs to include the precompiled 34 | // sprite animation tables. 35 | // Header generated by multigen utility. 36 | // This includes all the data for thing animation, 37 | // i.e. the Thing Atrributes table 38 | // and the Frame Sequence table. 39 | #include "info.h" 40 | 41 | #ifdef __GNUG__ 42 | #pragma interface 43 | #endif 44 | 45 | 46 | // 47 | // Frame flags: 48 | // handles maximum brightness (torches, muzzle flare, light sources) 49 | // 50 | 51 | // faB: I noticed they didn't use the 32 bits of the frame field, 52 | // so now we use the upper 16 bits for new effects. 53 | 54 | #define FF_FRAMEMASK 0x7fff // only the frame number 55 | #define FF_FULLBRIGHT 0x8000 // frame always appear full bright (fixedcolormap) 56 | 57 | // faB: 58 | // MF_SHADOW is no more used to activate translucency (or the old fuzzy) 59 | // The frame field allows to set translucency per frame, instead of per sprite. 60 | // Now, (frame & FF_TRANSMASK) is the translucency table number, if 0 61 | // it is not translucent. 62 | 63 | // Note: 64 | // MF_SHADOW still affects the targeting for monsters (they miss more) 65 | 66 | #define FF_TRANSMASK 0x70000 // 0 = no trans(opaque), 1-7 = transl. table 67 | #define FF_TRANSSHIFT 16 68 | 69 | // faB: new 'alpha' shade effect, for smoke.. 70 | 71 | #define FF_SMOKESHADE 0x80000 // sprite is an alpha channel 72 | 73 | 74 | 75 | // translucency tables 76 | 77 | // TODO: add another asm routine which use the fg and bg indexes in the 78 | // inverse order so the 20-80 becomes 80-20 translucency, no need 79 | // for other tables (thus 1090,2080,5050,8020,9010, and fire special) 80 | 81 | typedef enum 82 | { 83 | tr_transmed=1, //sprite 50 backg 50 most shots 84 | tr_transmor=2, // 20 80 puffs 85 | tr_transhi =3, // 10 90 blur effect 86 | tr_transfir=4, // 50 50 but brighter for fireballs, shots.. 87 | tr_transfx1=5 // 50 50 brighter some colors, else opaque for torches 88 | } transnum_t; 89 | 90 | 91 | // 92 | // Overlay psprites are scaled shapes 93 | // drawn directly on the view screen, 94 | // coordinates are given for a 320*200 view screen. 95 | // 96 | typedef enum 97 | { 98 | ps_weapon, 99 | ps_flash, 100 | NUMPSPRITES 101 | 102 | } psprnum_t; 103 | 104 | typedef struct 105 | { 106 | state_t* state; // a NULL state means not active 107 | int tics; 108 | fixed_t sx; 109 | fixed_t sy; 110 | 111 | } pspdef_t; 112 | 113 | #endif 114 | //----------------------------------------------------------------------------- 115 | // 116 | // $Log:$ 117 | // 118 | //----------------------------------------------------------------------------- 119 | -------------------------------------------------------------------------------- /win32/r_glide/fabfxlib.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _TESTLIB_H_ 3 | #define _TESTLIB_H_ 4 | 5 | #include 6 | 7 | #define DEGREE (.01745328f) 8 | 9 | /* The two most commonly defined macros in the known universe */ 10 | #ifndef MIN 11 | #define MIN(__x, __y) (((__x) < (__y)) ? (__x) : (__y)) 12 | #endif 13 | 14 | #ifndef MAX 15 | #define MAX(__x, __y) (((__x) < (__y)) ? (__y) : (__x)) 16 | #endif 17 | 18 | 19 | /* 20 | ** move the vertex layout defintion to application 21 | */ 22 | typedef struct { 23 | float sow; /* s texture ordinate (s over w) */ 24 | float tow; /* t texture ordinate (t over w) */ 25 | float oow; /* 1/w (used mipmapping - really 0xfff/w) */ 26 | } GrTmuVertex; 27 | 28 | typedef struct 29 | { 30 | float x, y; /* X and Y in screen space */ 31 | float ooz; /* 65535/Z (used for Z-buffering) */ 32 | float oow; /* 1/W (used for W-buffering, texturing) */ 33 | float r, g, b, a; /* R, G, B, A [0..255.0] */ 34 | float z; /* Z is ignored */ 35 | GrTmuVertex tmuvtx[GLIDE_NUM_TMU]; 36 | } GrVertex; 37 | 38 | #define GR_VERTEX_X_OFFSET 0 39 | #define GR_VERTEX_Y_OFFSET 1 40 | #define GR_VERTEX_OOZ_OFFSET 2 41 | #define GR_VERTEX_OOW_OFFSET 3 42 | #define GR_VERTEX_R_OFFSET 4 43 | #define GR_VERTEX_G_OFFSET 5 44 | #define GR_VERTEX_B_OFFSET 6 45 | #define GR_VERTEX_A_OFFSET 7 46 | #define GR_VERTEX_Z_OFFSET 8 47 | #define GR_VERTEX_SOW_TMU0_OFFSET 9 48 | #define GR_VERTEX_TOW_TMU0_OFFSET 10 49 | #define GR_VERTEX_OOW_TMU0_OFFSET 11 50 | #define GR_VERTEX_SOW_TMU1_OFFSET 12 51 | #define GR_VERTEX_TOW_TMU1_OFFSET 13 52 | #define GR_VERTEX_OOW_TMU1_OFFSET 14 53 | #if (GLIDE_NUM_TMU > 2) 54 | #define GR_VERTEX_SOW_TMU2_OFFSET 15 55 | #define GR_VERTEX_TOW_TMU2_OFFSET 16 56 | #define GR_VERTEX_OOW_TMU2_OFFSET 17 57 | #endif 58 | 59 | void tlSetScreen( float width, float height ); 60 | 61 | float tlScaleX( float coord ); 62 | float tlScaleY( float coord ); 63 | 64 | void tlConSet( float minX, float minY, 65 | float maxX, float maxY, 66 | int columns, int rows, 67 | int color ); 68 | int tlConOutput( const char *fmt, ... ); 69 | void tlConClear(); 70 | void tlConRender(); 71 | void tlPrintNumber (int frame); //lame-o routine 72 | 73 | 74 | // ---------------- 75 | // 3D stuff 76 | // ---------------- 77 | 78 | // vertex structure as passed to hardware 79 | // - these are projected textures 80 | typedef struct { 81 | float x,y; 82 | unsigned long argb; 83 | } myVertex2D; 84 | 85 | // 3d model source coordinates, 86 | // for original & transformed coordinates 87 | typedef struct { 88 | float x; 89 | float y; 90 | float z; 91 | float w; 92 | /*float s; 93 | float t; 94 | float r; 95 | float g; 96 | float b; 97 | float a;*/ 98 | } myVertex3D; 99 | 100 | typedef float TlMatrix[4][4]; 101 | 102 | extern TlMatrix currentMatrix; 103 | 104 | const float *tlInitMatrix( void ); 105 | const float *tlZRotation( float degrees ); 106 | const float *tlYRotation( float degrees ); 107 | const float *tlXRotation( float degrees ); 108 | const float *tlTranslation( float x, float y, float z ); 109 | void tlSetMatrix( const float *m ); 110 | void tlMultMatrix( const float *m ); 111 | void tlTransformVertices( myVertex3D *dstList, 112 | myVertex3D *srcList, 113 | unsigned length ); 114 | void tlProjectVertices( myVertex2D *dstList, 115 | myVertex3D *srcList, 116 | unsigned length ); 117 | 118 | 119 | #endif -------------------------------------------------------------------------------- /r_main.h: -------------------------------------------------------------------------------- 1 | // System specific interface stuff. 2 | 3 | 4 | #ifndef __R_MAIN__ 5 | #define __R_MAIN__ 6 | 7 | #include "d_player.h" 8 | #include "r_data.h" 9 | 10 | 11 | // 12 | // POV related. 13 | // 14 | extern fixed_t viewcos; 15 | extern fixed_t viewsin; 16 | 17 | extern int viewwidth; 18 | extern int viewheight; 19 | extern int viewwindowx; 20 | extern int viewwindowy; 21 | 22 | 23 | 24 | extern int centerx; 25 | extern int centery; 26 | 27 | extern fixed_t centerxfrac; 28 | extern fixed_t centeryfrac; 29 | extern fixed_t projection; 30 | extern fixed_t projectiony; //added:02-02-98:aspect ratio test... 31 | 32 | extern int validcount; 33 | 34 | extern int linecount; 35 | extern int loopcount; 36 | 37 | // 38 | // Lighting LUT. 39 | // Used for z-depth cuing per column/row, 40 | // and other lighting effects (sector ambient, flash). 41 | // 42 | 43 | // Lighting constants. 44 | // Now why not 32 levels here? 45 | #define LIGHTLEVELS 16 46 | #define LIGHTSEGSHIFT 4 47 | 48 | #define MAXLIGHTSCALE 48 49 | #define LIGHTSCALESHIFT 12 50 | #define MAXLIGHTZ 128 51 | #define LIGHTZSHIFT 20 52 | 53 | extern lighttable_t* scalelight[LIGHTLEVELS][MAXLIGHTSCALE]; 54 | extern lighttable_t* scalelightfixed[MAXLIGHTSCALE]; 55 | extern lighttable_t* zlight[LIGHTLEVELS][MAXLIGHTZ]; 56 | 57 | extern int extralight; 58 | extern lighttable_t* fixedcolormap; 59 | 60 | // Number of diminishing brightness levels. 61 | // There a 0-31, i.e. 32 LUT in the COLORMAP lump. 62 | #define NUMCOLORMAPS 32 63 | 64 | 65 | // Blocky/low detail mode. 66 | //B remove this? 67 | // 0 = high, 1 = low 68 | extern int detailshift; 69 | 70 | 71 | // 72 | // Utility functions. 73 | int 74 | R_PointOnSide 75 | ( fixed_t x, 76 | fixed_t y, 77 | node_t* node ); 78 | 79 | int 80 | R_PointOnSegSide 81 | ( fixed_t x, 82 | fixed_t y, 83 | seg_t* line ); 84 | 85 | angle_t 86 | R_PointToAngle 87 | ( fixed_t x, 88 | fixed_t y ); 89 | 90 | angle_t 91 | R_PointToAngle2 92 | ( fixed_t x1, 93 | fixed_t y1, 94 | fixed_t x2, 95 | fixed_t y2 ); 96 | 97 | fixed_t 98 | R_PointToDist 99 | ( fixed_t x, 100 | fixed_t y ); 101 | 102 | 103 | fixed_t R_ScaleFromGlobalAngle (angle_t visangle); 104 | 105 | subsector_t* 106 | R_PointInSubsector 107 | ( fixed_t x, 108 | fixed_t y ); 109 | 110 | subsector_t* R_IsPointInSubsector ( fixed_t x, fixed_t y ); 111 | 112 | void 113 | R_AddPointToBox 114 | ( int x, 115 | int y, 116 | fixed_t* box ); 117 | 118 | 119 | 120 | // 121 | // REFRESH - the actual rendering functions. 122 | // 123 | 124 | extern consvar_t cv_psprites; 125 | extern consvar_t cv_perspcorr; 126 | extern consvar_t cv_tiltview; 127 | extern consvar_t cv_splitscreen; 128 | 129 | 130 | // Called by startup code. 131 | void R_Init (void); 132 | 133 | 134 | // just sets setsizeneeded true 135 | extern boolean setsizeneeded; 136 | void R_SetViewSize (void); 137 | 138 | // do it (sometimes explicitly called) 139 | void R_ExecuteSetViewSize (void); 140 | 141 | void R_SetupFrame (player_t* player); 142 | // Called by G_Drawer. 143 | void R_RenderPlayerView (player_t *player); 144 | 145 | // add commands related to engine, at game startup 146 | void R_RegisterEngineStuff (void); 147 | 148 | #endif 149 | //----------------------------------------------------------------------------- 150 | // 151 | // $Log:$ 152 | // 153 | //----------------------------------------------------------------------------- 154 | -------------------------------------------------------------------------------- /win32/r_d3d/r_d3d.001: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="r_d3d" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 5.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 6 | 7 | CFG=r_d3d - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "r_d3d.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "r_d3d.mak" CFG="r_d3d - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "r_d3d - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") 21 | !MESSAGE "r_d3d - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP Scc_ProjName "" 26 | # PROP Scc_LocalPath "" 27 | CPP=cl.exe 28 | MTL=midl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "r_d3d - Win32 Release" 32 | 33 | # PROP BASE Use_MFC 0 34 | # PROP BASE Use_Debug_Libraries 0 35 | # PROP BASE Output_Dir "Release" 36 | # PROP BASE Intermediate_Dir "Release" 37 | # PROP BASE Target_Dir "" 38 | # PROP Use_MFC 0 39 | # PROP Use_Debug_Libraries 0 40 | # PROP Output_Dir "Release" 41 | # PROP Intermediate_Dir "Release" 42 | # PROP Ignore_Export_Lib 0 43 | # PROP Target_Dir "" 44 | # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c 45 | # ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "__MSC__" /YX /FD /c 46 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 47 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o NUL /win32 48 | # ADD BASE RSC /l 0x40c /d "NDEBUG" 49 | # ADD RSC /l 0x40c /d "NDEBUG" 50 | BSC32=bscmake.exe 51 | # ADD BASE BSC32 /nologo 52 | # ADD BSC32 /nologo 53 | LINK32=link.exe 54 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 55 | # ADD LINK32 dxguid.lib d3dim.lib ddraw.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"h:\jeux\doom2dev\r_d3d.dll" 56 | 57 | !ELSEIF "$(CFG)" == "r_d3d - Win32 Debug" 58 | 59 | # PROP BASE Use_MFC 0 60 | # PROP BASE Use_Debug_Libraries 1 61 | # PROP BASE Output_Dir "Debug" 62 | # PROP BASE Intermediate_Dir "Debug" 63 | # PROP BASE Target_Dir "" 64 | # PROP Use_MFC 0 65 | # PROP Use_Debug_Libraries 1 66 | # PROP Output_Dir "Debug" 67 | # PROP Intermediate_Dir "Debug" 68 | # PROP Target_Dir "" 69 | # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c 70 | # ADD CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c 71 | # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 72 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o NUL /win32 73 | # ADD BASE RSC /l 0x40c /d "_DEBUG" 74 | # ADD RSC /l 0x40c /d "_DEBUG" 75 | BSC32=bscmake.exe 76 | # ADD BASE BSC32 /nologo 77 | # ADD BSC32 /nologo 78 | LINK32=link.exe 79 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept 80 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept 81 | 82 | !ENDIF 83 | 84 | # Begin Target 85 | 86 | # Name "r_d3d - Win32 Release" 87 | # Name "r_d3d - Win32 Debug" 88 | # Begin Source File 89 | 90 | SOURCE=..\hwr_drv.h 91 | # End Source File 92 | # Begin Source File 93 | 94 | SOURCE=.\r_d3d.cpp 95 | # End Source File 96 | # End Target 97 | # End Project 98 | -------------------------------------------------------------------------------- /win32/r_d3d/r_d3d.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="r_d3d" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Dynamic-Link Library" 0x0102 6 | 7 | CFG=r_d3d - Win32 Debug 8 | !MESSAGE This is not a valid makefile. To build this project using NMAKE, 9 | !MESSAGE use the Export Makefile command and run 10 | !MESSAGE 11 | !MESSAGE NMAKE /f "r_d3d.mak". 12 | !MESSAGE 13 | !MESSAGE You can specify a configuration when running NMAKE 14 | !MESSAGE by defining the macro CFG on the command line. For example: 15 | !MESSAGE 16 | !MESSAGE NMAKE /f "r_d3d.mak" CFG="r_d3d - Win32 Debug" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "r_d3d - Win32 Release" (based on "Win32 (x86) Dynamic-Link Library") 21 | !MESSAGE "r_d3d - Win32 Debug" (based on "Win32 (x86) Dynamic-Link Library") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | MTL=midl.exe 30 | RSC=rc.exe 31 | 32 | !IF "$(CFG)" == "r_d3d - Win32 Release" 33 | 34 | # PROP BASE Use_MFC 0 35 | # PROP BASE Use_Debug_Libraries 0 36 | # PROP BASE Output_Dir "Release" 37 | # PROP BASE Intermediate_Dir "Release" 38 | # PROP BASE Target_Dir "" 39 | # PROP Use_MFC 0 40 | # PROP Use_Debug_Libraries 0 41 | # PROP Output_Dir "Release" 42 | # PROP Intermediate_Dir "Release" 43 | # PROP Ignore_Export_Lib 0 44 | # PROP Target_Dir "" 45 | # ADD BASE CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c 46 | # ADD CPP /nologo /MT /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "__MSC__" /YX /FD /c 47 | # ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 48 | # ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32 49 | # ADD BASE RSC /l 0x40c /d "NDEBUG" 50 | # ADD RSC /l 0x40c /d "NDEBUG" 51 | BSC32=bscmake.exe 52 | # ADD BASE BSC32 /nologo 53 | # ADD BSC32 /nologo 54 | LINK32=link.exe 55 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 56 | # ADD LINK32 dxguid.lib d3dim.lib ddraw.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /machine:I386 /out:"h:\jeux\doom2dev\r_d3d.dll" 57 | 58 | !ELSEIF "$(CFG)" == "r_d3d - Win32 Debug" 59 | 60 | # PROP BASE Use_MFC 0 61 | # PROP BASE Use_Debug_Libraries 1 62 | # PROP BASE Output_Dir "Debug" 63 | # PROP BASE Intermediate_Dir "Debug" 64 | # PROP BASE Target_Dir "" 65 | # PROP Use_MFC 0 66 | # PROP Use_Debug_Libraries 1 67 | # PROP Output_Dir "Debug" 68 | # PROP Intermediate_Dir "Debug" 69 | # PROP Target_Dir "" 70 | # ADD BASE CPP /nologo /MTd /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c 71 | # ADD CPP /nologo /MTd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c 72 | # ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 73 | # ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32 74 | # ADD BASE RSC /l 0x40c /d "_DEBUG" 75 | # ADD RSC /l 0x40c /d "_DEBUG" 76 | BSC32=bscmake.exe 77 | # ADD BASE BSC32 /nologo 78 | # ADD BSC32 /nologo 79 | LINK32=link.exe 80 | # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept 81 | # ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /dll /debug /machine:I386 /pdbtype:sept 82 | 83 | !ENDIF 84 | 85 | # Begin Target 86 | 87 | # Name "r_d3d - Win32 Release" 88 | # Name "r_d3d - Win32 Debug" 89 | # Begin Source File 90 | 91 | SOURCE=..\hwr_drv.h 92 | # End Source File 93 | # Begin Source File 94 | 95 | SOURCE=.\r_d3d.cpp 96 | # End Source File 97 | # End Target 98 | # End Project 99 | -------------------------------------------------------------------------------- /LINUX_X/musserv/musserver.h: -------------------------------------------------------------------------------- 1 | /************************************************************************* 2 | * musserver.h 3 | * 4 | * Copyright (C) 1995 Michael Heasley (mheasley@hmc.edu) 5 | * 6 | * This program is free software; you can redistribute it and/or modify 7 | * it under the terms of the GNU General Public License as published by 8 | * the Free Software Foundation; either version 2 of the License, or 9 | * (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 | * You should have received a copy of the GNU General Public License 17 | * along with this program; if not, write to the Free Software 18 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 19 | *************************************************************************/ 20 | 21 | 22 | /**************************************************/ 23 | /* User-configurable parameters: program defaults */ 24 | /**************************************************/ 25 | 26 | 27 | /************************************************************************* 28 | * Change this to your preferred default playback device: external midi, * 29 | * FM synth, or AWE32 synth * 30 | *************************************************************************/ 31 | 32 | /* #define DEFAULT_EXT_MIDI */ 33 | #define DEFAULT_FM_SYNTH 34 | /* #define DEFAULT_AWE32_SYNTH */ 35 | 36 | 37 | /************************************************************************ 38 | * To compile in support for AWE32 synth (requires AWE32 kernel driver, * 39 | * see README) regardless of the default playback device, define the * 40 | * following * 41 | ************************************************************************/ 42 | 43 | #define AWE32_SYNTH_SUPPORT 44 | 45 | 46 | /*************************************************************************** 47 | * If you normally need the -u command-line switch to specify a particular * 48 | * device type, uncomment this line and change the type as needed * 49 | ***************************************************************************/ 50 | 51 | /* #define DEFAULT_TYPE 8 */ 52 | 53 | 54 | /************************************/ 55 | /* End of user-configurable section */ 56 | /************************************/ 57 | 58 | #ifdef DEFAULT_AWE32_SYNTH 59 | # define AWE32_SYNTH_SUPPORT 60 | #endif 61 | 62 | #ifdef linux 63 | # include 64 | # ifdef AWE32_SYNTH_SUPPORT 65 | # include 66 | # endif 67 | #elif defined(SCOOS5) || defined(SCOUW2) || defined(SCOUW7) 68 | # include 69 | # ifdef AWE32_SYNTH_SUPPORT 70 | # include 71 | # endif 72 | #elif defined(__FreeBSD__) 73 | # include 74 | # ifdef AWE32_SYNTH_SUPPORT 75 | # include 76 | # endif 77 | #endif 78 | 79 | #define MUS_VERSION "1.4" 80 | 81 | struct mus_header { /* header of music lump */ 82 | char id[4]; 83 | unsigned short music_size; 84 | unsigned short header_size; 85 | unsigned short channels; 86 | unsigned short sec_channels; 87 | unsigned short instrnum; 88 | unsigned short dummy; 89 | }; 90 | 91 | struct opl_instr { 92 | unsigned short flags; 93 | unsigned char finetune; 94 | unsigned char note; 95 | sbi_instr_data patchdata; 96 | }; 97 | 98 | struct synth_voice { 99 | signed int note; 100 | signed int channel; 101 | }; 102 | 103 | #define NO_SYNTH -1 104 | #define FM_SYNTH 1 105 | #define EXT_MIDI 2 106 | #define AWE32_SYNTH 3 107 | #define LIST_DEV -1 108 | #define TERMINATED 4 109 | #define MSG_WAIT 0 110 | 111 | #ifdef DEFAULT_AWE32_SYNTH 112 | # define DEFAULT_DEV AWE32_SYNTH 113 | #elif defined(DEFAULT_FM_SYNTH) 114 | # define DEFAULT_DEV FM_SYNTH 115 | #else 116 | # define DEFAULT_DEV EXT_MIDI 117 | #endif 118 | -------------------------------------------------------------------------------- /LINUX_X/endtxt.c: -------------------------------------------------------------------------------- 1 | /* 2 | * Function to write the Doom end message text 3 | * 4 | * Copyright (C) 1998 by Udo Munk 5 | * 6 | * This code is provided AS IS and there are no guarantees, none. 7 | * Feel free to share and modify. 8 | */ 9 | 10 | #include 11 | #include 12 | 13 | // need this 19990118 by Kin 14 | #include "doomdef.h" 15 | #include "w_wad.h" 16 | #include "z_zone.h" 17 | #include "m_argv.h" 18 | #include "endtxt.h" 19 | 20 | void ShowEndTxt() 21 | { 22 | int i, j; 23 | int att = 0; 24 | int nlflag = 0; 25 | unsigned short *text; 26 | char *col; 27 | 28 | /* if option -noendtxt is set, don't print the text */ 29 | if (M_CheckParm("-noendtxt")) 30 | return; 31 | 32 | /* if the xterm has more then 80 columns we need to add nl's */ 33 | col = getenv("COLUMNS"); 34 | if (col) { 35 | if (atoi(col) > 80) 36 | nlflag++; 37 | } 38 | 39 | /* get the lump with the text */ 40 | text = W_CacheLumpNum(W_GetNumForName("ENDOOM"), PU_CACHE); 41 | 42 | /* print 80x25 text and deal with the attributes too */ 43 | for (i=1; i<=80*25; i++) { 44 | /* attribute first */ 45 | /* attribute changed? */ 46 | if ((j = *text >> 8) != att) { 47 | /* save current attribute */ 48 | att = j; 49 | /* set new attribute, forground color first */ 50 | printf("\033["); 51 | switch (j & 0x0f) { 52 | case 0: /* black */ 53 | printf("30"); 54 | break; 55 | case 1: /* blue */ 56 | printf("34"); 57 | break; 58 | case 2: /* green */ 59 | printf("32"); 60 | break; 61 | case 3: /* cyan */ 62 | printf("36"); 63 | break; 64 | case 4: /* red */ 65 | printf("31"); 66 | break; 67 | case 5: /* magenta */ 68 | printf("35"); 69 | break; 70 | case 6: /* brown */ 71 | printf("33"); 72 | break; 73 | case 7: /* bright grey */ 74 | printf("37"); 75 | break; 76 | case 8: /* dark grey */ 77 | printf("1;30"); 78 | break; 79 | case 9: /* bright blue */ 80 | printf("1;34"); 81 | break; 82 | case 10: /* bright green */ 83 | printf("1;32"); 84 | break; 85 | case 11: /* bright cyan */ 86 | printf("1;36"); 87 | break; 88 | case 12: /* bright red */ 89 | printf("1;31"); 90 | break; 91 | case 13: /* bright magenta */ 92 | printf("1;35"); 93 | break; 94 | case 14: /* yellow */ 95 | printf("1;33"); 96 | break; 97 | case 15: /* white */ 98 | printf("1;37"); 99 | break; 100 | } 101 | printf("m"); 102 | /* now background color */ 103 | printf("\033["); 104 | switch((j >> 4) & 0x0f) { 105 | case 0: /* black */ 106 | printf("40"); 107 | break; 108 | case 1: /* blue */ 109 | printf("44"); 110 | break; 111 | case 2: /* green */ 112 | printf("42"); 113 | break; 114 | case 3: /* cyan */ 115 | printf("46"); 116 | break; 117 | case 4: /* red */ 118 | printf("41"); 119 | break; 120 | case 5: /* magenta */ 121 | printf("45"); 122 | break; 123 | case 6: /* brown */ 124 | printf("43"); 125 | break; 126 | case 7: /* bright grey */ 127 | printf("47"); 128 | break; 129 | case 8: /* dark grey */ 130 | printf("1;40"); 131 | break; 132 | case 9: /* bright blue */ 133 | printf("1;44"); 134 | break; 135 | case 10: /* bright green */ 136 | printf("1;42"); 137 | break; 138 | case 11: /* bright cyan */ 139 | printf("1;46"); 140 | break; 141 | case 12: /* bright red */ 142 | printf("1;41"); 143 | break; 144 | case 13: /* bright magenta */ 145 | printf("1;45"); 146 | break; 147 | case 14: /* yellow */ 148 | printf("1;43"); 149 | break; 150 | case 15: /* white */ 151 | printf("1;47"); 152 | break; 153 | } 154 | printf("m"); 155 | } 156 | 157 | /* now the text */ 158 | putchar(*text++ & 0xff); 159 | 160 | /* do we need a nl? */ 161 | if (nlflag) { 162 | if (!(i % 80)) { 163 | printf("\033[0m"); 164 | att = 0; 165 | printf("\n"); 166 | } 167 | } 168 | } 169 | /* all attributes off */ 170 | printf("\033[0m"); 171 | 172 | if (nlflag) 173 | printf("\n"); 174 | } 175 | --------------------------------------------------------------------------------