├── .gitignore ├── 3dfx.txt ├── AUTHORS ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.Solaris ├── Makefile.am ├── Makefile.linuxi386 ├── NEWS ├── README.SDL ├── README.Solaris ├── README.md ├── WinQuake.dsp ├── WinQuake.dsw ├── WinQuake.mdp ├── WinQuake.ncb ├── WinQuake.opt ├── WinQuake.plg ├── aclocal.m4 ├── adivtab.h ├── anorm_dots.h ├── anorms.h ├── asm_draw.h ├── asm_i386.h ├── autogen.sh ├── block16.h ├── block8.h ├── bspfile.h ├── cd_audio.c ├── cd_linux.c ├── cd_null.c ├── cd_sdl.c ├── cd_win.c ├── cdaudio.h ├── chase.c ├── cl_demo.c ├── cl_input.c ├── cl_main.c ├── cl_parse.c ├── cl_tent.c ├── clean.bat ├── client.h ├── cmd.c ├── cmd.h ├── common.c ├── common.h ├── compile ├── config.guess ├── config.h.in ├── config.sub ├── configure.ac ├── conproc.c ├── conproc.h ├── console.c ├── console.h ├── crc.c ├── crc.h ├── cvar.c ├── cvar.h ├── cwsdpmi.exe ├── d_copy.S ├── d_draw.S ├── d_draw16.S ├── d_edge.c ├── d_fill.c ├── d_iface.h ├── d_ifacea.h ├── d_init.c ├── d_local.h ├── d_modech.c ├── d_part.c ├── d_parta.S ├── d_polysa.S ├── d_polyse.c ├── d_scan.c ├── d_scana.S ├── d_sky.c ├── d_spr8.S ├── d_sprite.c ├── d_surf.c ├── d_vars.c ├── d_varsa.S ├── d_zpoint.c ├── data ├── COMEXP.TXT ├── HELP.TXT ├── LICINFO.TXT ├── MANUAL.TXT ├── ORDER.TXT ├── README.TXT ├── RLICNSE.TXT ├── SLICNSE.TXT └── TECHINFO.TXT ├── depcomp ├── docs ├── INSTALL ├── INSTALL.Q2Mission ├── INSTALL.Quake ├── INSTALL.Quake2 ├── README ├── README.X11 ├── readme.glquake └── readme.squake ├── dos_v2.c ├── dosasm.S ├── dosisms.h ├── draw.c ├── draw.h ├── dxsdk └── SDK │ ├── INC │ ├── D3D.H │ ├── D3DCAPS.H │ ├── D3DRM.H │ ├── D3DRMDEF.H │ ├── D3DRMOBJ.H │ ├── D3DRMWIN.H │ ├── D3DTYPES.H │ ├── DDRAW.H │ ├── DINPUT.H │ ├── DPLAY.H │ ├── DSETUP.H │ ├── DSOUND.H │ └── FASTFILE.H │ └── LIB │ ├── DINPUT.LIB │ └── DXGUID.LIB ├── gas2masm ├── gas2masm.c ├── gas2masm.dsp ├── gas2masm.dsw ├── gas2masm.mdp └── gas2masm.plg ├── gl_draw.c ├── gl_mesh.c ├── gl_model.c ├── gl_model.h ├── gl_refrag.c ├── gl_rlight.c ├── gl_rmain.c ├── gl_rmisc.c ├── gl_rsurf.c ├── gl_screen.c ├── gl_test.c ├── gl_vidlinux.c ├── gl_vidlinuxglx.c ├── gl_vidnt.c ├── gl_warp.c ├── gl_warp_sin.h ├── glqnotes.txt ├── glquake.h ├── glquake2.h ├── host.c ├── host_cmd.c ├── in_dos.c ├── in_null.c ├── in_sun.c ├── in_win.c ├── input.h ├── install-sh ├── keys.c ├── keys.h ├── kit ├── 3DFX.TXT ├── GLQUAKE.EXE ├── JOYSTICK.TXT ├── OPENGL32.DLL └── README.TXT ├── m4 └── ax_check_compile_flag.m4 ├── makezip.bat ├── math.S ├── mathlib.c ├── mathlib.h ├── menu.c ├── menu.h ├── missing ├── mkinstalldirs ├── model.c ├── model.h ├── modelgen.h ├── mpdosock.h ├── mplib.c ├── mplpc.c ├── net.h ├── net_bsd.c ├── net_bw.c ├── net_bw.h ├── net_comx.c ├── net_dgrm.c ├── net_dgrm.h ├── net_dos.c ├── net_ipx.c ├── net_ipx.h ├── net_loop.c ├── net_loop.h ├── net_main.c ├── net_mp.c ├── net_mp.h ├── net_none.c ├── net_ser.c ├── net_ser.h ├── net_udp.c ├── net_udp.h ├── net_vcr.c ├── net_vcr.h ├── net_win.c ├── net_wins.c ├── net_wins.h ├── net_wipx.c ├── net_wipx.h ├── net_wso.c ├── nonintel.c ├── pr_cmds.c ├── pr_comp.h ├── pr_edict.c ├── pr_exec.c ├── progdefs.h ├── progdefs.q1 ├── progdefs.q2 ├── progs.h ├── protocol.h ├── q.bat ├── qa.bat ├── qb.bat ├── qe3.ico ├── qt.bat ├── quake-data.spec.sh ├── quake-hipnotic.spec.sh ├── quake-rogue.spec.sh ├── quake-shareware.spec.sh ├── quake.gif ├── quake.ico ├── quake.spec.sh ├── quakeasm.h ├── quakedef.h ├── r_aclip.c ├── r_aclipa.S ├── r_alias.c ├── r_aliasa.S ├── r_bsp.c ├── r_draw.c ├── r_drawa.S ├── r_edge.c ├── r_edgea.S ├── r_efrag.c ├── r_light.c ├── r_local.h ├── r_main.c ├── r_misc.c ├── r_part.c ├── r_shared.h ├── r_sky.c ├── r_sprite.c ├── r_surf.c ├── r_vars.c ├── r_varsa.S ├── render.h ├── resource.h ├── sbar.c ├── sbar.h ├── scitech ├── INCLUDE │ ├── DEBUG.H │ ├── MGLDOS.H │ ├── MGLWIN.H │ └── MGRAPH.H └── LIB │ └── WIN32 │ └── VC │ └── MGLLT.LIB ├── screen.c ├── screen.h ├── server.h ├── snd_dma.c ├── snd_dos.c ├── snd_gus.c ├── snd_linux.c ├── snd_mem.c ├── snd_mix.c ├── snd_mixa.S ├── snd_next.c ├── snd_null.c ├── snd_sdl.c ├── snd_sun.c ├── snd_win.c ├── sound.h ├── spritegn.h ├── surf16.S ├── surf8.S ├── sv_main.c ├── sv_move.c ├── sv_phys.c ├── sv_user.c ├── sys.h ├── sys_dos.c ├── sys_dosa.S ├── sys_linux.c ├── sys_null.c ├── sys_sdl.c ├── sys_sun.c ├── sys_win.c ├── sys_wina.S ├── sys_wind.c ├── vgamodes.h ├── vid.h ├── vid_dos.c ├── vid_dos.h ├── vid_ext.c ├── vid_null.c ├── vid_sdl.c ├── vid_sunx.c ├── vid_sunxil.c ├── vid_svgalib.c ├── vid_vga.c ├── vid_win.c ├── vid_x.c ├── view.c ├── view.h ├── vregset.c ├── vregset.h ├── wad.c ├── wad.h ├── winquake.aps ├── winquake.h ├── winquake.rc ├── world.c ├── world.h ├── worlda.S ├── wq.bat ├── wqreadme.txt ├── zone.c └── zone.h /.gitignore: -------------------------------------------------------------------------------- 1 | *.o 2 | *~ 3 | \#* 4 | Makefile 5 | Makefile.in 6 | config.h 7 | config.log 8 | config.status 9 | stamp* 10 | .deps 11 | sdlquake 12 | .* 13 | *.kdev* 14 | autom4* 15 | TAGS 16 | configure 17 | -------------------------------------------------------------------------------- /3dfx.txt: -------------------------------------------------------------------------------- 1 | GLQuake Drivers 2 | 3 | Graphics Subsystem: Voodoo Graphics or Voodoo Rush 4 | 5 | Copyright ( 1997 3Dfx Interactive, Inc. ) 6 | All Rights Reserved 7 | 8 | 3Dfx Interactive, Inc. 9 | www: www.3dfx.com 10 | news: news.3dfx.com 11 | 12 | ----------------------------------------------------------------------- 13 | NOTE: GLQuake requires DirectX support DirectSound. DirectX can be 14 | installed from the media provided with your Voodoo Based 3D Accelerator. 15 | 16 | Glide 2.31 or HIGHER runtime drivers *MUST* be installed to use this 17 | GLQuake driver. Please download these drivers from your board 18 | manufacturer OR unsupported drivers from http://www.3dfx.com 19 | ----------------------------------------------------------------------- 20 | 21 | Release Notes for GLQuake's mini-GL driver 22 | 23 | What's in the distribution? 24 | --------------------------- 25 | 26 | This distribution contains GLQuake Drivers for Voodoo Based 3D 27 | Accelerators. These drivers were tested on the following boards: 28 | 29 | Voodoo Graphics: 30 | - Quantum 3D Obsidian 31 | - Diamond Monster 3D 32 | - Orchid Righteous 3D 33 | - Deltron Realvision Flash 3D 34 | - Guillemot MaxiGamer 35 | - Skywell Magic 3D 36 | 37 | Voodoo Rush: 38 | - Hercules Stringray 128-3D 39 | - Intergraph Intense 3D Voodoo 40 | - Jazz Multimedia Adrenaline Rush 41 | 42 | NOTE: The enclosed drivers are not meant to replace any Direct3D or 43 | Glide drivers provided by your Voodoo Graphics card manufacturer. 44 | Please obtain supported drivers from your board manufacturer. 45 | 46 | OEMSR2 and NT users: Do NOT replace OPENGL32.DLL located in your 47 | Windows\SYSTEM directory. 48 | 49 | Requirements 50 | ------------ 51 | 52 | - Voodoo Graphics or Voodoo Rush Based 3D Accelerator 53 | - Windows 95 (Windows NT is supported for Voodoo Rush) 54 | - A PC with a Pentium 90 or higher CPU 55 | - 16MB of RAM 56 | - 2D Video card set at 16 bit color 57 | 58 | Support and Frequently Asked Questions 59 | -------------------------------------- 60 | 61 | GLQuake is currently unsupported. You may however find answers to 62 | questions on various Quake dedicated websites. 3Dfx provides a GLQuake 63 | newsgroup on news.3dfx.com (Newsgroup name is 3dfx.games.glquake ) to 64 | discuss GLQuake with other users. 3Dfx also provides a regularly 65 | updated GLQuake FAQ at: http://www.3dfx.com/game_dev/quake_faq.html 66 | 67 | 68 | Voodoo Graphics and Voodoo Rush are trademarks of 3Dfx Interactive, Inc. 69 | All other trademarks are the property of their respective owners. -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | id Software 2 | 3 | Sam Lantinga 4 | https://www.libsdl.org/projects/quake/ 5 | 6 | Andy Hefner 7 | https://github.com/ahefner/sdlquake 8 | 9 | Mightyjo 10 | https://github.com/Mightyjo/sdlquake 11 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/ChangeLog -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/NEWS -------------------------------------------------------------------------------- /README.SDL: -------------------------------------------------------------------------------- 1 | 2 | This is a quick hack of Quake ported to the Simple DirectMedia Layer library. 3 | http://www.devolution.com/~slouken/SDL/ 4 | 5 | To build under Linux, simply run ./configure; make 6 | 7 | This game requires the original Quake datafiles. You can get the shareware 8 | data files from http://www.idsoftware.com/. 9 | 10 | Of interest in the original X sources is the following: 11 | // Duff's Device 12 | count = width; 13 | n = (count + 7) / 8; 14 | dest = ((PIXEL16 *)src) + x+width - 1; 15 | src += x+width - 1; 16 | 17 | switch (count % 8) { 18 | case 0: do { *dest-- = st2d_8to16table[*src--]; 19 | case 7: *dest-- = st2d_8to16table[*src--]; 20 | case 6: *dest-- = st2d_8to16table[*src--]; 21 | case 5: *dest-- = st2d_8to16table[*src--]; 22 | case 4: *dest-- = st2d_8to16table[*src--]; 23 | case 3: *dest-- = st2d_8to16table[*src--]; 24 | case 2: *dest-- = st2d_8to16table[*src--]; 25 | case 1: *dest-- = st2d_8to16table[*src--]; 26 | } while (--n > 0); 27 | } 28 | This idea may make it into the SDL blitters if it turns out to be faster 29 | than my current code. :) 30 | 31 | Thanks to Zoid, Dave Taylor, John Carmack, and everyone else involved in the 32 | open source release of id games. :) 33 | 34 | - Sam Lantinga (slouken@devolution.com) 12/25/1999 35 | -------------------------------------------------------------------------------- /README.Solaris: -------------------------------------------------------------------------------- 1 | Solaris 2 Quake / QuakeWorld 2 | ---------------------------- 3 | 4 | This is an UNSUPPORTED version of Quake and QuakeWorld. Don't 5 | bother id software about it. Bug reports will be ignored. 6 | 7 | PORT DETAILS 8 | ------------ 9 | 10 | There are a few major difference between this port and the 11 | vanilla Quake/QuakeWorld available on the internet. For 12 | optimum performance, you should copy everything to a directory 13 | on your local system before starting play so that you are 14 | not mounting files from a remote filesystem. 15 | 16 | In order to use this program, you need the files pak0.pak 17 | and pak1.pak in the id1 directory found on a registered copy of 18 | Quake. You can ftp them to your Solaris host from a Windows95 19 | machine for example. The files must be in an id1 subdirectory from 20 | the directory you install Quake/QuakeWorld, and all file names must 21 | be lowercase. Add on packages such as ThreeWave CTF work fine as 22 | well, just place such addon packages in their own directory as you 23 | would on a Windows95 installation. But again, make sure all files 24 | are lowercase. 25 | 26 | COMMAND LINE FLAGS: 27 | 28 | +pixel_multiply 29 | 30 | You can magnify the screen by using this flag: 31 | 32 | Ex: % quake +pixel_multiply 2 33 | 34 | You can also use this command (without the dash) 35 | from the Quake console. pixel_multiply is a Quake 36 | cvar and is saved from session to session in the 37 | config.cfg file. 38 | 39 | -winsize 40 | 41 | Set the size of the window when you start 42 | 43 | -count_frames 44 | 45 | See how many frames per second you're getting 46 | 47 | GAME SETTINGS 48 | 49 | mouse binding 50 | 51 | You can bind and unbind the mouse to the Quake window 52 | by using the Use Mouse selection in the Options menu, 53 | or with the "_windowed_mouse" command in the console, 54 | ex "_windowed_mouse 1" Now, moving the mouse will move 55 | your player. Use "_windowed_mouse 0" to unbind. You 56 | can bind or alias this to a key. 57 | 58 | Example command: 59 | 60 | % quake.xil +pixel_multiply 2 -winsize 400 300 61 | 62 | WHAT IS "QUAKEWORLD" AND HOW DO I USE IT? 63 | ----------------------------------------- 64 | 65 | In a nutshell, QuakeWorld is an extension of Quake that is 66 | much more user friendly. It allows the user to dynamically 67 | download changes from the server, such as new maps and new 68 | weapons while inside the Quake client. It is not directly 69 | compatible with Quake (ie, you can't connect to a Quake server 70 | from a QuakeWorld client) but in general it is superior to 71 | Quake. QuakeWorld also offers much smoother play over the 72 | Internet by using client prediction. For more information, 73 | check out http://www.quakeworld.net/. 74 | 75 | In order to use it, you must make a copy of the "qw" 76 | directory. Any new stuff that is downloaded from a QuakeWorld 77 | server will be stored in this directory. All regular Quake 78 | flags apply so you can use the same command line as before. 79 | 80 | Example command: 81 | 82 | % qwcl.xil +pixel_multiply 2 -winsize 400 300 83 | 84 | WHERE CAN I FIND OUT ABOUT... 85 | ----------------------------- 86 | 87 | If you've got questions about Quake, rest assured that there 88 | are answers out there. Try checking out these web sites: 89 | 90 | http://www.planetquake.com/ 91 | http://www.stomped.com/ 92 | http://www.quakeworld.net/ 93 | 94 | If all else fails use a search engine. 95 | 96 | Happy fragging, 97 | the Quake/Solaris team 98 | 99 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | SDLquake 1.0.9 (approximately) 2 | ============================== 3 | 4 | This is SDLquake, a port of id Software's Quake engine to the Simple Direct-media Layer 1.2 for Linux. The Autotools build system has been updated to 2015 standards more or less. 5 | 6 | Installation 7 | ------------ 8 | 9 | Run `autogen.sh` to generate the `configure` file. Then execute `./configure && make` to build the `sdlquake` executable. Run the `sdlquake` executable from within a directory containing the original Quake data files. 10 | 11 | The Quake data files are expected to be named in lower case! This is true if you installed from Linux Quake installation media, but not necessarily true if you copied the data files over from Windows or performed the installation inside of DOSBox. If `sdlquake` fails to start and complains about missing files, be sure the `id1` directory and the `.pak` files within it are renamed to lower case. 12 | 13 | See `INSTALL` for detailed build instructions. Support for building on 64-bit multiarch systems has been added and may need explanation. 14 | 15 | See `README.SDL` for the original porter's comments. 16 | 17 | Notes 18 | ----- 19 | 20 | Currently plays demos at startup, but crashes when starting a new game on my x86-64 Linux system. Presumed to be some lingering 64-bit cleanness or uninitialized data issue. Investigating. 21 | 22 | License 23 | ------- 24 | 25 | SDLquake is licensed under the GPLv2. You should have received a copy of the GPLv2 in a file called COPYING in the same directory as this README. If you did not, contact the distributor from whom you recieved this software for a copy. 26 | -------------------------------------------------------------------------------- /WinQuake.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: "gas2masm"=.\gas2masm\gas2masm.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Project: "winquake"=.\WinQuake.dsp - Package Owner=<4> 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<4> 25 | {{{ 26 | Begin Project Dependency 27 | Project_Dep_Name gas2masm 28 | End Project Dependency 29 | }}} 30 | 31 | ############################################################################### 32 | 33 | Global: 34 | 35 | Package=<5> 36 | {{{ 37 | }}} 38 | 39 | Package=<3> 40 | {{{ 41 | }}} 42 | 43 | ############################################################################### 44 | 45 | -------------------------------------------------------------------------------- /WinQuake.mdp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/WinQuake.mdp -------------------------------------------------------------------------------- /WinQuake.ncb: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/WinQuake.ncb -------------------------------------------------------------------------------- /WinQuake.opt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/WinQuake.opt -------------------------------------------------------------------------------- /asm_i386.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #ifndef __ASM_I386__ 22 | #define __ASM_I386__ 23 | 24 | #ifdef ELF 25 | #define C(label) label 26 | #else 27 | #define C(label) _##label 28 | #endif 29 | 30 | // 31 | // !!! note that this file must match the corresponding C structures at all 32 | // times !!! 33 | // 34 | 35 | // plane_t structure 36 | // !!! if this is changed, it must be changed in model.h too !!! 37 | // !!! if the size of this is changed, the array lookup in SV_HullPointContents 38 | // must be changed too !!! 39 | #define pl_normal 0 40 | #define pl_dist 12 41 | #define pl_type 16 42 | #define pl_signbits 17 43 | #define pl_pad 18 44 | #define pl_size 20 45 | 46 | // hull_t structure 47 | // !!! if this is changed, it must be changed in model.h too !!! 48 | #define hu_clipnodes 0 49 | #define hu_planes 4 50 | #define hu_firstclipnode 8 51 | #define hu_lastclipnode 12 52 | #define hu_clip_mins 16 53 | #define hu_clip_maxs 28 54 | #define hu_size 40 55 | 56 | // dnode_t structure 57 | // !!! if this is changed, it must be changed in bspfile.h too !!! 58 | #define nd_planenum 0 59 | #define nd_children 4 60 | #define nd_mins 8 61 | #define nd_maxs 20 62 | #define nd_firstface 32 63 | #define nd_numfaces 36 64 | #define nd_size 40 65 | 66 | // sfxcache_t structure 67 | // !!! if this is changed, it much be changed in sound.h too !!! 68 | #define sfxc_length 0 69 | #define sfxc_loopstart 4 70 | #define sfxc_speed 8 71 | #define sfxc_width 12 72 | #define sfxc_stereo 16 73 | #define sfxc_data 20 74 | 75 | // channel_t structure 76 | // !!! if this is changed, it much be changed in sound.h too !!! 77 | #define ch_sfx 0 78 | #define ch_leftvol 4 79 | #define ch_rightvol 8 80 | #define ch_end 12 81 | #define ch_pos 16 82 | #define ch_looping 20 83 | #define ch_entnum 24 84 | #define ch_entchannel 28 85 | #define ch_origin 32 86 | #define ch_dist_mult 44 87 | #define ch_master_vol 48 88 | #define ch_size 52 89 | 90 | // portable_samplepair_t structure 91 | // !!! if this is changed, it much be changed in sound.h too !!! 92 | #define psp_left 0 93 | #define psp_right 4 94 | #define psp_size 8 95 | 96 | #endif 97 | 98 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | autoreconf --install || exit 1 3 | -------------------------------------------------------------------------------- /block16.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | LEnter16_16: 21 | movb (%esi),%al 22 | movb (%esi,%ebx,),%cl 23 | movb %dh,%ah 24 | addl %ebp,%edx 25 | movb %dh,%ch 26 | leal (%esi,%ebx,2),%esi 27 | movw 0x12345678(,%eax,2),%ax 28 | LBPatch0: 29 | addl %ebp,%edx 30 | movw %ax,(%edi) 31 | movw 0x12345678(,%ecx,2),%cx 32 | LBPatch1: 33 | movw %cx,2(%edi) 34 | addl $0x4,%edi 35 | 36 | movb (%esi),%al 37 | movb (%esi,%ebx,),%cl 38 | movb %dh,%ah 39 | addl %ebp,%edx 40 | movb %dh,%ch 41 | leal (%esi,%ebx,2),%esi 42 | movw 0x12345678(,%eax,2),%ax 43 | LBPatch2: 44 | addl %ebp,%edx 45 | movw %ax,(%edi) 46 | movw 0x12345678(,%ecx,2),%cx 47 | LBPatch3: 48 | movw %cx,2(%edi) 49 | addl $0x4,%edi 50 | 51 | movb (%esi),%al 52 | movb (%esi,%ebx,),%cl 53 | movb %dh,%ah 54 | addl %ebp,%edx 55 | movb %dh,%ch 56 | leal (%esi,%ebx,2),%esi 57 | movw 0x12345678(,%eax,2),%ax 58 | LBPatch4: 59 | addl %ebp,%edx 60 | movw %ax,(%edi) 61 | movw 0x12345678(,%ecx,2),%cx 62 | LBPatch5: 63 | movw %cx,2(%edi) 64 | addl $0x4,%edi 65 | 66 | movb (%esi),%al 67 | movb (%esi,%ebx,),%cl 68 | movb %dh,%ah 69 | addl %ebp,%edx 70 | movb %dh,%ch 71 | leal (%esi,%ebx,2),%esi 72 | movw 0x12345678(,%eax,2),%ax 73 | LBPatch6: 74 | addl %ebp,%edx 75 | movw %ax,(%edi) 76 | movw 0x12345678(,%ecx,2),%cx 77 | LBPatch7: 78 | movw %cx,2(%edi) 79 | addl $0x4,%edi 80 | 81 | LEnter8_16: 82 | movb (%esi),%al 83 | movb (%esi,%ebx,),%cl 84 | movb %dh,%ah 85 | addl %ebp,%edx 86 | movb %dh,%ch 87 | leal (%esi,%ebx,2),%esi 88 | movw 0x12345678(,%eax,2),%ax 89 | LBPatch8: 90 | addl %ebp,%edx 91 | movw %ax,(%edi) 92 | movw 0x12345678(,%ecx,2),%cx 93 | LBPatch9: 94 | movw %cx,2(%edi) 95 | addl $0x4,%edi 96 | 97 | movb (%esi),%al 98 | movb (%esi,%ebx,),%cl 99 | movb %dh,%ah 100 | addl %ebp,%edx 101 | movb %dh,%ch 102 | leal (%esi,%ebx,2),%esi 103 | movw 0x12345678(,%eax,2),%ax 104 | LBPatch10: 105 | addl %ebp,%edx 106 | movw %ax,(%edi) 107 | movw 0x12345678(,%ecx,2),%cx 108 | LBPatch11: 109 | movw %cx,2(%edi) 110 | addl $0x4,%edi 111 | 112 | LEnter4_16: 113 | movb (%esi),%al 114 | movb (%esi,%ebx,),%cl 115 | movb %dh,%ah 116 | addl %ebp,%edx 117 | movb %dh,%ch 118 | leal (%esi,%ebx,2),%esi 119 | movw 0x12345678(,%eax,2),%ax 120 | LBPatch12: 121 | addl %ebp,%edx 122 | movw %ax,(%edi) 123 | movw 0x12345678(,%ecx,2),%cx 124 | LBPatch13: 125 | movw %cx,2(%edi) 126 | addl $0x4,%edi 127 | 128 | LEnter2_16: 129 | movb (%esi),%al 130 | movb (%esi,%ebx,),%cl 131 | movb %dh,%ah 132 | addl %ebp,%edx 133 | movb %dh,%ch 134 | leal (%esi,%ebx,2),%esi 135 | movw 0x12345678(,%eax,2),%ax 136 | LBPatch14: 137 | addl %ebp,%edx 138 | movw %ax,(%edi) 139 | movw 0x12345678(,%ecx,2),%cx 140 | LBPatch15: 141 | movw %cx,2(%edi) 142 | addl $0x4,%edi 143 | -------------------------------------------------------------------------------- /block8.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | LEnter16_8: 21 | movb (%esi),%al 22 | movb (%esi,%ebx,),%cl 23 | movb %dh,%ah 24 | addl %ebp,%edx 25 | movb %dh,%ch 26 | leal (%esi,%ebx,2),%esi 27 | movb 0x12345678(%eax),%al 28 | LBPatch0: 29 | addl %ebp,%edx 30 | movb %al,(%edi) 31 | movb 0x12345678(%ecx),%cl 32 | LBPatch1: 33 | movb %cl,1(%edi) 34 | addl $0x2,%edi 35 | 36 | movb (%esi),%al 37 | movb (%esi,%ebx,),%cl 38 | movb %dh,%ah 39 | addl %ebp,%edx 40 | movb %dh,%ch 41 | leal (%esi,%ebx,2),%esi 42 | movb 0x12345678(%eax),%al 43 | LBPatch2: 44 | addl %ebp,%edx 45 | movb %al,(%edi) 46 | movb 0x12345678(%ecx),%cl 47 | LBPatch3: 48 | movb %cl,1(%edi) 49 | addl $0x2,%edi 50 | 51 | movb (%esi),%al 52 | movb (%esi,%ebx,),%cl 53 | movb %dh,%ah 54 | addl %ebp,%edx 55 | movb %dh,%ch 56 | leal (%esi,%ebx,2),%esi 57 | movb 0x12345678(%eax),%al 58 | LBPatch4: 59 | addl %ebp,%edx 60 | movb %al,(%edi) 61 | movb 0x12345678(%ecx),%cl 62 | LBPatch5: 63 | movb %cl,1(%edi) 64 | addl $0x2,%edi 65 | 66 | movb (%esi),%al 67 | movb (%esi,%ebx,),%cl 68 | movb %dh,%ah 69 | addl %ebp,%edx 70 | movb %dh,%ch 71 | leal (%esi,%ebx,2),%esi 72 | movb 0x12345678(%eax),%al 73 | LBPatch6: 74 | addl %ebp,%edx 75 | movb %al,(%edi) 76 | movb 0x12345678(%ecx),%cl 77 | LBPatch7: 78 | movb %cl,1(%edi) 79 | addl $0x2,%edi 80 | 81 | LEnter8_8: 82 | movb (%esi),%al 83 | movb (%esi,%ebx,),%cl 84 | movb %dh,%ah 85 | addl %ebp,%edx 86 | movb %dh,%ch 87 | leal (%esi,%ebx,2),%esi 88 | movb 0x12345678(%eax),%al 89 | LBPatch8: 90 | addl %ebp,%edx 91 | movb %al,(%edi) 92 | movb 0x12345678(%ecx),%cl 93 | LBPatch9: 94 | movb %cl,1(%edi) 95 | addl $0x2,%edi 96 | 97 | movb (%esi),%al 98 | movb (%esi,%ebx,),%cl 99 | movb %dh,%ah 100 | addl %ebp,%edx 101 | movb %dh,%ch 102 | leal (%esi,%ebx,2),%esi 103 | movb 0x12345678(%eax),%al 104 | LBPatch10: 105 | addl %ebp,%edx 106 | movb %al,(%edi) 107 | movb 0x12345678(%ecx),%cl 108 | LBPatch11: 109 | movb %cl,1(%edi) 110 | addl $0x2,%edi 111 | 112 | LEnter4_8: 113 | movb (%esi),%al 114 | movb (%esi,%ebx,),%cl 115 | movb %dh,%ah 116 | addl %ebp,%edx 117 | movb %dh,%ch 118 | leal (%esi,%ebx,2),%esi 119 | movb 0x12345678(%eax),%al 120 | LBPatch12: 121 | addl %ebp,%edx 122 | movb %al,(%edi) 123 | movb 0x12345678(%ecx),%cl 124 | LBPatch13: 125 | movb %cl,1(%edi) 126 | addl $0x2,%edi 127 | 128 | LEnter2_8: 129 | movb (%esi),%al 130 | movb (%esi,%ebx,),%cl 131 | movb %dh,%ah 132 | addl %ebp,%edx 133 | movb %dh,%ch 134 | leal (%esi,%ebx,2),%esi 135 | movb 0x12345678(%eax),%al 136 | LBPatch14: 137 | addl %ebp,%edx 138 | movb %al,(%edi) 139 | movb 0x12345678(%ecx),%cl 140 | LBPatch15: 141 | movb %cl,1(%edi) 142 | addl $0x2,%edi 143 | 144 | -------------------------------------------------------------------------------- /cd_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | #include "quakedef.h" 21 | 22 | void CDAudio_Play(byte track, qboolean looping) 23 | { 24 | } 25 | 26 | 27 | void CDAudio_Stop(void) 28 | { 29 | } 30 | 31 | 32 | void CDAudio_Pause(void) 33 | { 34 | } 35 | 36 | 37 | void CDAudio_Resume(void) 38 | { 39 | } 40 | 41 | 42 | void CDAudio_Update(void) 43 | { 44 | } 45 | 46 | 47 | int CDAudio_Init(void) 48 | { 49 | return 0; 50 | } 51 | 52 | 53 | void CDAudio_Shutdown(void) 54 | { 55 | } -------------------------------------------------------------------------------- /cdaudio.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | int CDAudio_Init(void); 22 | void CDAudio_Play(byte track, qboolean looping); 23 | void CDAudio_Stop(void); 24 | void CDAudio_Pause(void); 25 | void CDAudio_Resume(void); 26 | void CDAudio_Shutdown(void); 27 | void CDAudio_Update(void); 28 | -------------------------------------------------------------------------------- /chase.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // chase.c -- chase camera code 21 | 22 | #include "quakedef.h" 23 | 24 | cvar_t chase_back = {"chase_back", "100"}; 25 | cvar_t chase_up = {"chase_up", "16"}; 26 | cvar_t chase_right = {"chase_right", "0"}; 27 | cvar_t chase_active = {"chase_active", "0"}; 28 | 29 | vec3_t chase_pos; 30 | vec3_t chase_angles; 31 | 32 | vec3_t chase_dest; 33 | vec3_t chase_dest_angles; 34 | 35 | 36 | void Chase_Init (void) 37 | { 38 | Cvar_RegisterVariable (&chase_back); 39 | Cvar_RegisterVariable (&chase_up); 40 | Cvar_RegisterVariable (&chase_right); 41 | Cvar_RegisterVariable (&chase_active); 42 | } 43 | 44 | void Chase_Reset (void) 45 | { 46 | // for respawning and teleporting 47 | // start position 12 units behind head 48 | } 49 | 50 | void TraceLine (vec3_t start, vec3_t end, vec3_t impact) 51 | { 52 | trace_t trace; 53 | 54 | memset (&trace, 0, sizeof(trace)); 55 | SV_RecursiveHullCheck (cl.worldmodel->hulls, 0, 0, 1, start, end, &trace); 56 | 57 | VectorCopy (trace.endpos, impact); 58 | } 59 | 60 | void Chase_Update (void) 61 | { 62 | int i; 63 | float dist; 64 | vec3_t forward, up, right; 65 | vec3_t dest, stop; 66 | 67 | 68 | // if can't see player, reset 69 | AngleVectors (cl.viewangles, forward, right, up); 70 | 71 | // calc exact destination 72 | for (i=0 ; i<3 ; i++) 73 | chase_dest[i] = r_refdef.vieworg[i] 74 | - forward[i]*chase_back.value 75 | - right[i]*chase_right.value; 76 | chase_dest[2] = r_refdef.vieworg[2] + chase_up.value; 77 | 78 | // find the spot the player is looking at 79 | VectorMA (r_refdef.vieworg, 4096, forward, dest); 80 | TraceLine (r_refdef.vieworg, dest, stop); 81 | 82 | // calculate pitch to look at the same spot from camera 83 | VectorSubtract (stop, r_refdef.vieworg, stop); 84 | dist = DotProduct (stop, forward); 85 | if (dist < 1) 86 | dist = 1; 87 | r_refdef.viewangles[PITCH] = -atan(stop[2] / dist) / M_PI * 180; 88 | 89 | // move towards destination 90 | VectorCopy (chase_dest, r_refdef.vieworg); 91 | } 92 | 93 | -------------------------------------------------------------------------------- /clean.bat: -------------------------------------------------------------------------------- 1 | rmdir /s /q debug 2 | rmdir /s /q release 3 | rmdir /s /q debug_gl 4 | rmdir /s /q release_gl 5 | 6 | rmdir /s /q gas2masm\debug 7 | rmdir /s /q gas2masm\release 8 | 9 | del gas2masm\gas2masm.opt 10 | del gas2masm\gas2masm.plg 11 | del gas2masm\gas2masm.ncb 12 | del gas2masm\gas2masm.stt 13 | 14 | del WinQuake.opt 15 | del WinQuake.plg 16 | del WinQuake.ncb 17 | del WinQuake.stt 18 | 19 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | dnl Process this file with autoconf to produce a configure script. 2 | AC_PREREQ([2.69]) 3 | AC_INIT([SDL Quake],[1.0.9],[]) 4 | AC_CONFIG_AUX_DIR([.]) 5 | AC_CONFIG_MACRO_DIR([m4]) 6 | AC_CONFIG_SRCDIR([README.SDL]) 7 | AC_CONFIG_HEADERS([config.h]) 8 | 9 | dnl Detect the canonical target build environment 10 | dnl AC_CANONICAL_TARGET 11 | AC_CANONICAL_HOST 12 | 13 | dnl Setup for automake 14 | AM_INIT_AUTOMAKE([tar-pax subdir-objects]) 15 | 16 | dnl Check for programs 17 | AC_PROG_CC 18 | AC_PROG_INSTALL 19 | AC_PROG_MAKE_SET 20 | AM_PROG_AS 21 | PKG_PROG_PKG_CONFIG 22 | 23 | # Checks for libraries. 24 | 25 | # Checks for header files. 26 | AC_PATH_X 27 | AC_CHECK_HEADERS([arpa/inet.h fcntl.h limits.h netdb.h netinet/in.h stddef.h stdlib.h string.h sys/file.h sys/ioctl.h sys/param.h sys/socket.h sys/time.h termios.h unistd.h]) 28 | 29 | # Checks for typedefs, structures, and compiler characteristics. 30 | AC_CHECK_HEADER_STDBOOL 31 | AC_C_INLINE 32 | AC_TYPE_SIZE_T 33 | 34 | # Checks for library functions. 35 | AC_FUNC_ALLOCA 36 | AC_FUNC_MALLOC 37 | AC_FUNC_MMAP 38 | AC_CHECK_FUNCS([atexit floor gethostbyaddr gethostbyname gethostname gethrtime getpagesize gettimeofday inet_ntoa memset mkdir munmap pow select socket sqrt strcasecmp strchr strerror strstr]) 39 | 40 | #AS_IF([test "$GCC" = "yes"], [CFLAGS="-g -O6"], []) 41 | 42 | dnl The alpha architecture needs special flags for binary portability 43 | AS_CASE( 44 | [$host], 45 | [alpha*-*-linux*],[CFLAGS="$CFLAGS -mcpu=ev4 -Wa,-mall"], 46 | [x86_64-*-linux*],[CHECK_M32="yes" CFLAGS="$CFLAGS -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"], 47 | [*-linux*],[CFLAGS="$CFLAGS -ffast-math -funroll-loops -fomit-frame-pointer -fexpensive-optimizations"], 48 | AC_MSG_ERROR(["Unrecognized platform $host."])) 49 | 50 | #AS_IF([test "$CHECK_M32" = "yes"], 51 | # AX_CHECK_COMPILE_FLAG( 52 | # [-m32], 53 | # [CFLAGS="-m32 $CFLAGS" CCASFLAGS="-m32 $CCASFLAGS"], 54 | # AC_MSG_ERROR(["$CC does not build 32-bit programs correctly. See your distribution's documentation on cross-compiling to i386."]))) 55 | 56 | dnl Figure out which math and networking libraries to use 57 | AS_CASE( 58 | [$host], 59 | [*-*-mingw32*],[MATHLIB=''; INETLIB='-lwsock32'], 60 | [*-*-beos*],[MATHLIB=''; INETLIB=''], 61 | [MATHLIB='-lm'; INETLIB='']) 62 | AC_SUBST(MATHLIB) 63 | AC_SUBST(INETLIB) 64 | 65 | dnl Check for SDL 66 | PKG_CHECK_MODULES([SDL], 67 | [sdl >= 1.2.0], 68 | [CFLAGS="$CFLAGS $SDL_CFLAGS"; CPPFLAGS="$CPPFLAGS -DSDL"; LIBS="$LIBS $SDL_LIBS"], 69 | AC_MSG_ERROR([*** SDL version 1.2 not found!])) 70 | 71 | dnl Set up the icon object file, for Mingw32 72 | AS_CASE( 73 | [$host], 74 | [*-*-mingw32*], 75 | [cp ico_o ico.o; ICONOBJ="ico.o"], 76 | [ICONOBJ=""]) 77 | AC_SUBST(ICONOBJ) 78 | 79 | dnl Enable/disable the i686 asm 80 | AC_ARG_ENABLE( 81 | asm, 82 | AS_HELP_STRING( 83 | [--enable-asm], 84 | [enable i686 assembly routines (default=no)])) 85 | AM_CONDITIONAL([MAKE_ASM], [test "$enable_asm" = yes]) 86 | AM_COND_IF([MAKE_ASM], 87 | AC_DEFINE([USE_ASM],[],[Define to use i686 assembly sources])) 88 | 89 | CPPFLAGS="$CPPFLAGS -DELF" 90 | 91 | # Finally create all the generated files 92 | AC_CONFIG_FILES([Makefile]) 93 | AC_OUTPUT 94 | -------------------------------------------------------------------------------- /conproc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // conproc.h 21 | 22 | #define CCOM_WRITE_TEXT 0x2 23 | // Param1 : Text 24 | 25 | #define CCOM_GET_TEXT 0x3 26 | // Param1 : Begin line 27 | // Param2 : End line 28 | 29 | #define CCOM_GET_SCR_LINES 0x4 30 | // No params 31 | 32 | #define CCOM_SET_SCR_LINES 0x5 33 | // Param1 : Number of lines 34 | 35 | void InitConProc (HANDLE hFile, HANDLE heventParent, HANDLE heventChild); 36 | void DeinitConProc (void); 37 | 38 | -------------------------------------------------------------------------------- /console.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | // 22 | // console 23 | // 24 | extern int con_totallines; 25 | extern int con_backscroll; 26 | extern qboolean con_forcedup; // because no entities to refresh 27 | extern qboolean con_initialized; 28 | extern byte *con_chars; 29 | extern int con_notifylines; // scan lines to clear for notify lines 30 | 31 | void Con_DrawCharacter (int cx, int line, int num); 32 | 33 | void Con_CheckResize (void); 34 | void Con_Init (void); 35 | void Con_DrawConsole (int lines, qboolean drawinput); 36 | void Con_Print (char *txt); 37 | void Con_Printf (char *fmt, ...); 38 | void Con_DPrintf (char *fmt, ...); 39 | void Con_SafePrintf (char *fmt, ...); 40 | void Con_Clear_f (void); 41 | void Con_DrawNotify (void); 42 | void Con_ClearNotify (void); 43 | void Con_ToggleConsole_f (void); 44 | 45 | void Con_NotifyBox (char *text); // during startup for sound / cd warnings 46 | 47 | -------------------------------------------------------------------------------- /crc.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | /* crc.c */ 21 | 22 | #include "quakedef.h" 23 | #include "crc.h" 24 | 25 | // this is a 16 bit, non-reflected CRC using the polynomial 0x1021 26 | // and the initial and final xor values shown below... in other words, the 27 | // CCITT standard CRC used by XMODEM 28 | 29 | #define CRC_INIT_VALUE 0xffff 30 | #define CRC_XOR_VALUE 0x0000 31 | 32 | static unsigned short crctable[256] = 33 | { 34 | 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50a5, 0x60c6, 0x70e7, 35 | 0x8108, 0x9129, 0xa14a, 0xb16b, 0xc18c, 0xd1ad, 0xe1ce, 0xf1ef, 36 | 0x1231, 0x0210, 0x3273, 0x2252, 0x52b5, 0x4294, 0x72f7, 0x62d6, 37 | 0x9339, 0x8318, 0xb37b, 0xa35a, 0xd3bd, 0xc39c, 0xf3ff, 0xe3de, 38 | 0x2462, 0x3443, 0x0420, 0x1401, 0x64e6, 0x74c7, 0x44a4, 0x5485, 39 | 0xa56a, 0xb54b, 0x8528, 0x9509, 0xe5ee, 0xf5cf, 0xc5ac, 0xd58d, 40 | 0x3653, 0x2672, 0x1611, 0x0630, 0x76d7, 0x66f6, 0x5695, 0x46b4, 41 | 0xb75b, 0xa77a, 0x9719, 0x8738, 0xf7df, 0xe7fe, 0xd79d, 0xc7bc, 42 | 0x48c4, 0x58e5, 0x6886, 0x78a7, 0x0840, 0x1861, 0x2802, 0x3823, 43 | 0xc9cc, 0xd9ed, 0xe98e, 0xf9af, 0x8948, 0x9969, 0xa90a, 0xb92b, 44 | 0x5af5, 0x4ad4, 0x7ab7, 0x6a96, 0x1a71, 0x0a50, 0x3a33, 0x2a12, 45 | 0xdbfd, 0xcbdc, 0xfbbf, 0xeb9e, 0x9b79, 0x8b58, 0xbb3b, 0xab1a, 46 | 0x6ca6, 0x7c87, 0x4ce4, 0x5cc5, 0x2c22, 0x3c03, 0x0c60, 0x1c41, 47 | 0xedae, 0xfd8f, 0xcdec, 0xddcd, 0xad2a, 0xbd0b, 0x8d68, 0x9d49, 48 | 0x7e97, 0x6eb6, 0x5ed5, 0x4ef4, 0x3e13, 0x2e32, 0x1e51, 0x0e70, 49 | 0xff9f, 0xefbe, 0xdfdd, 0xcffc, 0xbf1b, 0xaf3a, 0x9f59, 0x8f78, 50 | 0x9188, 0x81a9, 0xb1ca, 0xa1eb, 0xd10c, 0xc12d, 0xf14e, 0xe16f, 51 | 0x1080, 0x00a1, 0x30c2, 0x20e3, 0x5004, 0x4025, 0x7046, 0x6067, 52 | 0x83b9, 0x9398, 0xa3fb, 0xb3da, 0xc33d, 0xd31c, 0xe37f, 0xf35e, 53 | 0x02b1, 0x1290, 0x22f3, 0x32d2, 0x4235, 0x5214, 0x6277, 0x7256, 54 | 0xb5ea, 0xa5cb, 0x95a8, 0x8589, 0xf56e, 0xe54f, 0xd52c, 0xc50d, 55 | 0x34e2, 0x24c3, 0x14a0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, 56 | 0xa7db, 0xb7fa, 0x8799, 0x97b8, 0xe75f, 0xf77e, 0xc71d, 0xd73c, 57 | 0x26d3, 0x36f2, 0x0691, 0x16b0, 0x6657, 0x7676, 0x4615, 0x5634, 58 | 0xd94c, 0xc96d, 0xf90e, 0xe92f, 0x99c8, 0x89e9, 0xb98a, 0xa9ab, 59 | 0x5844, 0x4865, 0x7806, 0x6827, 0x18c0, 0x08e1, 0x3882, 0x28a3, 60 | 0xcb7d, 0xdb5c, 0xeb3f, 0xfb1e, 0x8bf9, 0x9bd8, 0xabbb, 0xbb9a, 61 | 0x4a75, 0x5a54, 0x6a37, 0x7a16, 0x0af1, 0x1ad0, 0x2ab3, 0x3a92, 62 | 0xfd2e, 0xed0f, 0xdd6c, 0xcd4d, 0xbdaa, 0xad8b, 0x9de8, 0x8dc9, 63 | 0x7c26, 0x6c07, 0x5c64, 0x4c45, 0x3ca2, 0x2c83, 0x1ce0, 0x0cc1, 64 | 0xef1f, 0xff3e, 0xcf5d, 0xdf7c, 0xaf9b, 0xbfba, 0x8fd9, 0x9ff8, 65 | 0x6e17, 0x7e36, 0x4e55, 0x5e74, 0x2e93, 0x3eb2, 0x0ed1, 0x1ef0 66 | }; 67 | 68 | void CRC_Init(unsigned short *crcvalue) 69 | { 70 | *crcvalue = CRC_INIT_VALUE; 71 | } 72 | 73 | void CRC_ProcessByte(unsigned short *crcvalue, byte data) 74 | { 75 | *crcvalue = (*crcvalue << 8) ^ crctable[(*crcvalue >> 8) ^ data]; 76 | } 77 | 78 | unsigned short CRC_Value(unsigned short crcvalue) 79 | { 80 | return crcvalue ^ CRC_XOR_VALUE; 81 | } -------------------------------------------------------------------------------- /crc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | /* crc.h */ 21 | 22 | void CRC_Init(unsigned short *crcvalue); 23 | void CRC_ProcessByte(unsigned short *crcvalue, byte data); 24 | unsigned short CRC_Value(unsigned short crcvalue); 25 | -------------------------------------------------------------------------------- /cvar.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // cvar.h 21 | 22 | /* 23 | 24 | cvar_t variables are used to hold scalar or string variables that can be changed or displayed at the console or prog code as well as accessed directly 25 | in C code. 26 | 27 | it is sufficient to initialize a cvar_t with just the first two fields, or 28 | you can add a ,true flag for variables that you want saved to the configuration 29 | file when the game is quit: 30 | 31 | cvar_t r_draworder = {"r_draworder","1"}; 32 | cvar_t scr_screensize = {"screensize","1",true}; 33 | 34 | Cvars must be registered before use, or they will have a 0 value instead of the float interpretation of the string. Generally, all cvar_t declarations should be registered in the apropriate init function before any console commands are executed: 35 | Cvar_RegisterVariable (&host_framerate); 36 | 37 | 38 | C code usually just references a cvar in place: 39 | if ( r_draworder.value ) 40 | 41 | It could optionally ask for the value to be looked up for a string name: 42 | if (Cvar_VariableValue ("r_draworder")) 43 | 44 | Interpreted prog code can access cvars with the cvar(name) or 45 | cvar_set (name, value) internal functions: 46 | teamplay = cvar("teamplay"); 47 | cvar_set ("registered", "1"); 48 | 49 | The user can access cvars from the console in two ways: 50 | r_draworder prints the current value 51 | r_draworder 0 sets the current value to 0 52 | Cvars are restricted from having the same names as commands to keep this 53 | interface from being ambiguous. 54 | */ 55 | 56 | typedef struct cvar_s 57 | { 58 | char *name; 59 | char *string; 60 | qboolean archive; // set to true to cause it to be saved to vars.rc 61 | qboolean server; // notifies players when changed 62 | float value; 63 | struct cvar_s *next; 64 | } cvar_t; 65 | 66 | void Cvar_RegisterVariable (cvar_t *variable); 67 | // registers a cvar that allready has the name, string, and optionally the 68 | // archive elements set. 69 | 70 | void Cvar_Set (char *var_name, char *value); 71 | // equivelant to " " typed at the console 72 | 73 | void Cvar_SetValue (char *var_name, float value); 74 | // expands value to a string and calls Cvar_Set 75 | 76 | float Cvar_VariableValue (char *var_name); 77 | // returns 0 if not defined or non numeric 78 | 79 | char *Cvar_VariableString (char *var_name); 80 | // returns an empty string if not defined 81 | 82 | char *Cvar_CompleteVariable (char *partial); 83 | // attempts to match a partial variable name for command line completion 84 | // returns NULL if nothing fits 85 | 86 | qboolean Cvar_Command (void); 87 | // called by Cmd_ExecuteString when Cmd_Argv(0) doesn't match a known 88 | // command. Returns true if the command was a variable reference that 89 | // was handled. (print or change) 90 | 91 | void Cvar_WriteVariables (FILE *f); 92 | // Writes lines containing "set variable value" for all variables 93 | // with the archive flag set to true. 94 | 95 | cvar_t *Cvar_FindVar (char *var_name); 96 | 97 | extern cvar_t *cvar_vars; 98 | -------------------------------------------------------------------------------- /cwsdpmi.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/cwsdpmi.exe -------------------------------------------------------------------------------- /d_copy.S: -------------------------------------------------------------------------------- 1 | // 2 | // d_copy.s 3 | // x86 assembly-language screen copying code. 4 | // 5 | 6 | #include "asm_i386.h" 7 | #include "quakeasm.h" 8 | #include "asm_draw.h" 9 | 10 | .data 11 | 12 | LCopyWidth: .long 0 13 | LBlockSrcStep: .long 0 14 | LBlockDestStep: .long 0 15 | LSrcDelta: .long 0 16 | LDestDelta: .long 0 17 | 18 | #define bufptr 4+16 19 | 20 | // copies 16 rows per plane at a pop; idea is that 16*512 = 8k, and since 21 | // no Mode X mode is wider than 360, all the data should fit in the cache for 22 | // the passes for the next 3 planes 23 | 24 | .text 25 | 26 | .globl C(VGA_UpdatePlanarScreen) 27 | C(VGA_UpdatePlanarScreen): 28 | pushl %ebp // preserve caller's stack frame 29 | pushl %edi 30 | pushl %esi // preserve register variables 31 | pushl %ebx 32 | 33 | movl C(VGA_bufferrowbytes),%eax 34 | shll $1,%eax 35 | movl %eax,LBlockSrcStep 36 | movl C(VGA_rowbytes),%eax 37 | shll $1,%eax 38 | movl %eax,LBlockDestStep 39 | 40 | movl $0x3C4,%edx 41 | movb $2,%al 42 | outb %al,%dx // point the SC to the Map Mask 43 | incl %edx 44 | 45 | movl bufptr(%esp),%esi 46 | movl C(VGA_pagebase),%edi 47 | movl C(VGA_height),%ebp 48 | shrl $1,%ebp 49 | 50 | movl C(VGA_width),%ecx 51 | movl C(VGA_bufferrowbytes),%eax 52 | subl %ecx,%eax 53 | movl %eax,LSrcDelta 54 | movl C(VGA_rowbytes),%eax 55 | shll $2,%eax 56 | subl %ecx,%eax 57 | movl %eax,LDestDelta 58 | shrl $4,%ecx 59 | movl %ecx,LCopyWidth 60 | 61 | LRowLoop: 62 | movb $1,%al 63 | 64 | LPlaneLoop: 65 | outb %al,%dx 66 | movb $2,%ah 67 | 68 | pushl %esi 69 | pushl %edi 70 | LRowSetLoop: 71 | movl LCopyWidth,%ecx 72 | LColumnLoop: 73 | movb 12(%esi),%bh 74 | movb 8(%esi),%bl 75 | shll $16,%ebx 76 | movb 4(%esi),%bh 77 | movb (%esi),%bl 78 | movl %ebx,(%edi) 79 | addl $16,%esi 80 | addl $4,%edi 81 | decl %ecx 82 | jnz LColumnLoop 83 | 84 | addl LDestDelta,%edi 85 | addl LSrcDelta,%esi 86 | decb %ah 87 | jnz LRowSetLoop 88 | 89 | popl %edi 90 | popl %esi 91 | incl %esi 92 | 93 | shlb $1,%al 94 | cmpb $16,%al 95 | jnz LPlaneLoop 96 | 97 | subl $4,%esi 98 | addl LBlockSrcStep,%esi 99 | addl LBlockDestStep,%edi 100 | decl %ebp 101 | jnz LRowLoop 102 | 103 | popl %ebx // restore register variables 104 | popl %esi 105 | popl %edi 106 | popl %ebp // restore the caller's stack frame 107 | 108 | ret 109 | 110 | 111 | #define srcptr 4+16 112 | #define destptr 8+16 113 | #define width 12+16 114 | #define height 16+16 115 | #define srcrowbytes 20+16 116 | #define destrowbytes 24+16 117 | 118 | .globl C(VGA_UpdateLinearScreen) 119 | C(VGA_UpdateLinearScreen): 120 | pushl %ebp // preserve caller's stack frame 121 | pushl %edi 122 | pushl %esi // preserve register variables 123 | pushl %ebx 124 | 125 | cld 126 | movl srcptr(%esp),%esi 127 | movl destptr(%esp),%edi 128 | movl width(%esp),%ebx 129 | movl srcrowbytes(%esp),%eax 130 | subl %ebx,%eax 131 | movl destrowbytes(%esp),%edx 132 | subl %ebx,%edx 133 | shrl $2,%ebx 134 | movl height(%esp),%ebp 135 | LLRowLoop: 136 | movl %ebx,%ecx 137 | rep/movsl (%esi),(%edi) 138 | addl %eax,%esi 139 | addl %edx,%edi 140 | decl %ebp 141 | jnz LLRowLoop 142 | 143 | popl %ebx // restore register variables 144 | popl %esi 145 | popl %edi 146 | popl %ebp // restore the caller's stack frame 147 | 148 | ret 149 | 150 | -------------------------------------------------------------------------------- /d_fill.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // d_clear: clears a specified rectangle to the specified color 21 | 22 | #include "quakedef.h" 23 | 24 | 25 | /* 26 | ================ 27 | D_FillRect 28 | ================ 29 | */ 30 | void D_FillRect (vrect_t *rect, int color) 31 | { 32 | int rx, ry, rwidth, rheight; 33 | unsigned char *dest; 34 | unsigned *ldest; 35 | 36 | rx = rect->x; 37 | ry = rect->y; 38 | rwidth = rect->width; 39 | rheight = rect->height; 40 | 41 | if (rx < 0) 42 | { 43 | rwidth += rx; 44 | rx = 0; 45 | } 46 | if (ry < 0) 47 | { 48 | rheight += ry; 49 | ry = 0; 50 | } 51 | if (rx+rwidth > vid.width) 52 | rwidth = vid.width - rx; 53 | if (ry+rheight > vid.height) 54 | rheight = vid.height - rx; 55 | 56 | if (rwidth < 1 || rheight < 1) 57 | return; 58 | 59 | dest = ((byte *)vid.buffer + ry*vid.rowbytes + rx); 60 | 61 | if (((rwidth & 0x03) == 0) && (((long)dest & 0x03) == 0)) 62 | { 63 | // faster aligned dword clear 64 | ldest = (unsigned *)dest; 65 | color += color << 16; 66 | 67 | rwidth >>= 2; 68 | color += color << 8; 69 | 70 | for (ry=0 ; ry xscale) 70 | scale_for_mip = yscale; 71 | 72 | d_zrowbytes = vid.width * 2; 73 | d_zwidth = vid.width; 74 | 75 | d_pix_min = r_refdef.vrect.width / 320; 76 | if (d_pix_min < 1) 77 | d_pix_min = 1; 78 | 79 | d_pix_max = (int)((float)r_refdef.vrect.width / (320.0 / 4.0) + 0.5); 80 | d_pix_shift = 8 - (int)((float)r_refdef.vrect.width / 320.0 + 0.5); 81 | if (d_pix_max < 1) 82 | d_pix_max = 1; 83 | 84 | if (pixelAspect > 1.4) 85 | d_y_aspect_shift = 1; 86 | else 87 | d_y_aspect_shift = 0; 88 | 89 | d_vrectx = r_refdef.vrect.x; 90 | d_vrecty = r_refdef.vrect.y; 91 | d_vrectright_particle = r_refdef.vrectright - d_pix_max; 92 | d_vrectbottom_particle = 93 | r_refdef.vrectbottom - (d_pix_max << d_y_aspect_shift); 94 | 95 | { 96 | int i; 97 | 98 | for (i=0 ; i= r_refdef.vrect.height) 41 | temp = (float)r_refdef.vrect.width; 42 | else 43 | temp = (float)r_refdef.vrect.height; 44 | 45 | wu = 8192.0 * (float)(u-((int)vid.width>>1)) / temp; 46 | wv = 8192.0 * (float)(((int)vid.height>>1)-v) / temp; 47 | 48 | end[0] = 4096*vpn[0] + wu*vright[0] + wv*vup[0]; 49 | end[1] = 4096*vpn[1] + wu*vright[1] + wv*vup[1]; 50 | end[2] = 4096*vpn[2] + wu*vright[2] + wv*vup[2]; 51 | end[2] *= 3; 52 | VectorNormalize (end); 53 | 54 | temp = skytime*skyspeed; // TODO: add D_SetupFrame & set this there 55 | *s = (int)((temp + 6*(SKYSIZE/2-1)*end[0]) * 0x10000); 56 | *t = (int)((temp + 6*(SKYSIZE/2-1)*end[1]) * 0x10000); 57 | } 58 | 59 | 60 | /* 61 | ================= 62 | D_DrawSkyScans8 63 | ================= 64 | */ 65 | void D_DrawSkyScans8 (espan_t *pspan) 66 | { 67 | int count, spancount, u, v; 68 | unsigned char *pdest; 69 | fixed16_t s, t, snext, tnext, sstep, tstep; 70 | int spancountminus1; 71 | 72 | sstep = 0; // keep compiler happy 73 | tstep = 0; // ditto 74 | 75 | do 76 | { 77 | pdest = (unsigned char *)((byte *)d_viewbuffer + 78 | (screenwidth * pspan->v) + pspan->u); 79 | 80 | count = pspan->count; 81 | 82 | // calculate the initial s & t 83 | u = pspan->u; 84 | v = pspan->v; 85 | D_Sky_uv_To_st (u, v, &s, &t); 86 | 87 | do 88 | { 89 | if (count >= SKY_SPAN_MAX) 90 | spancount = SKY_SPAN_MAX; 91 | else 92 | spancount = count; 93 | 94 | count -= spancount; 95 | 96 | if (count) 97 | { 98 | u += spancount; 99 | 100 | // calculate s and t at far end of span, 101 | // calculate s and t steps across span by shifting 102 | D_Sky_uv_To_st (u, v, &snext, &tnext); 103 | 104 | sstep = (snext - s) >> SKY_SPAN_SHIFT; 105 | tstep = (tnext - t) >> SKY_SPAN_SHIFT; 106 | } 107 | else 108 | { 109 | // calculate s and t at last pixel in span, 110 | // calculate s and t steps across span by division 111 | spancountminus1 = (float)(spancount - 1); 112 | 113 | if (spancountminus1 > 0) 114 | { 115 | u += spancountminus1; 116 | D_Sky_uv_To_st (u, v, &snext, &tnext); 117 | 118 | sstep = (snext - s) / spancountminus1; 119 | tstep = (tnext - t) / spancountminus1; 120 | } 121 | } 122 | 123 | do 124 | { 125 | *pdest++ = r_skysource[((t & R_SKY_TMASK) >> 8) + 126 | ((s & R_SKY_SMASK) >> 16)]; 127 | s += sstep; 128 | t += tstep; 129 | } while (--spancount > 0); 130 | 131 | s = snext; 132 | t = tnext; 133 | 134 | } while (count > 0); 135 | 136 | } while ((pspan = pspan->pnext) != NULL); 137 | } 138 | 139 | -------------------------------------------------------------------------------- /d_vars.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // r_vars.c: global refresh variables 21 | 22 | #include "quakedef.h" 23 | 24 | #if !id386 25 | 26 | // all global and static refresh variables are collected in a contiguous block 27 | // to avoid cache conflicts. 28 | 29 | //------------------------------------------------------- 30 | // global refresh variables 31 | //------------------------------------------------------- 32 | 33 | // FIXME: make into one big structure, like cl or sv 34 | // FIXME: do separately for refresh engine and driver 35 | 36 | float d_sdivzstepu, d_tdivzstepu, d_zistepu; 37 | float d_sdivzstepv, d_tdivzstepv, d_zistepv; 38 | float d_sdivzorigin, d_tdivzorigin, d_ziorigin; 39 | 40 | fixed16_t sadjust, tadjust, bbextents, bbextentt; 41 | 42 | pixel_t *cacheblock; 43 | int cachewidth; 44 | pixel_t *d_viewbuffer; 45 | short *d_pzbuffer; 46 | unsigned int d_zrowbytes; 47 | unsigned int d_zwidth; 48 | 49 | #endif // !id386 50 | 51 | -------------------------------------------------------------------------------- /d_zpoint.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // d_zpoint.c: software driver module for drawing z-buffered points 21 | 22 | #include "quakedef.h" 23 | #include "d_local.h" 24 | 25 | 26 | /* 27 | ===================== 28 | D_DrawZPoint 29 | ===================== 30 | */ 31 | void D_DrawZPoint (void) 32 | { 33 | byte *pdest; 34 | short *pz; 35 | int izi; 36 | 37 | pz = d_pzbuffer + (d_zwidth * r_zpointdesc.v) + r_zpointdesc.u; 38 | pdest = d_viewbuffer + d_scantable[r_zpointdesc.v] + r_zpointdesc.u; 39 | izi = (int)(r_zpointdesc.zi * 0x8000); 40 | 41 | if (*pz <= izi) 42 | { 43 | *pz = izi; 44 | *pdest = r_zpointdesc.color; 45 | } 46 | } 47 | 48 | -------------------------------------------------------------------------------- /data/ORDER.TXT: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/data/ORDER.TXT -------------------------------------------------------------------------------- /docs/INSTALL.Q2Mission: -------------------------------------------------------------------------------- 1 | INSTALL for Linux Quake2 Mission Packs 2 | -------------------------------------- 3 | 4 | Installation 5 | ------------ 6 | 7 | Mount the Quake2 Mission Pack CD as one would usually mount a CDROM, this can 8 | be accomplished by using the command: 9 | 10 | mount /dev/cdrom /mnt 11 | 12 | As root. Once the CD is mounted, run the setup script on the CD as root. 13 | 14 | $ su 15 | Password: 16 | # mount /dev/cdrom /mnt 17 | # /bin/sh /mnt/setup 18 | 19 | The script will ask some questions about what options you want to install 20 | and automatically install the software into /usr/local/games/quake2. 21 | 22 | After Installation 23 | ------------------ 24 | 25 | To run Quake2 Mission Pack #1: The Reckoning add the following option when 26 | executing Quake2: 27 | 28 | ./quake2 +set game xatrix 29 | 30 | To run Quake2 Mission Pack #2: Ground Zero add the following: 31 | 32 | ./quake2 +set game rogue 33 | 34 | Requirements 35 | ------------ 36 | 37 | The Quake2 Mission Packs require a previous installation of Quake2. 38 | 39 | 40 | -------------------------------------------------------------------------------- /docs/README.X11: -------------------------------------------------------------------------------- 1 | 2 | README for Linux SVGALib Quake 3 | ------------------------------ 4 | 5 | Requirements: 6 | 7 | - X11R5 later, only tested with XFree86, should work with most X Servers 8 | - libc 5.2.18 or later (5.0.9 will not work, /lib/libc.so.5.2.18) 9 | - CD-ROM for CDAudio 10 | - Soundcard capable of mmap'd buffers. USSLite 3.5.4 was used to build squake 11 | with. Works fine on SoundBlaster 16 and Gravis Ultrasound MAX. 12 | - SVGALib supported mouse (usually if it works with X, it'll work with 13 | squake). 14 | - Kernel 2.0.24 or later 15 | - untested with 2.1 kernels, your mileage may vary 16 | 17 | This is a windowed version that is generic for X11. It runs in a window 18 | and can be resized. You can specify a starting window size with: 19 | -width 20 | -height 21 | -winsize 22 | Default is 320x200. It works in 16bit modes, but it's slower (twice as many 23 | bytes to copy). 24 | 25 | No other video modes are supported (just runs windowed). Mouse is read, but 26 | not "grabbed" by default. Go to the Options menu and turn on Use Mouse to grab 27 | the mouse and use it in the game. If you want to move the mouse out of 28 | QWCL, you have to turn Use Mouse off. 29 | 30 | Full sound support is included. The default sound rate is 16-bit stereo, 31 | 11KHz. You can change this in the options section below. 32 | 33 | New Command Line Options for Linux SVGAlib Quake 34 | ------------------------------------------------ 35 | 36 | -mem 37 | Specify memory in megabytes to allocate (default is 8MB, which should be fine 38 | for most needs). 39 | 40 | -nostdout 41 | Don't do any output to stdout 42 | 43 | -cddev 44 | CD device, default is /dev/cdrom 45 | 46 | -sndbits <8 or 16> 47 | Set sound bit sample size. Default is 16 if supported. 48 | 49 | -sndspeed 50 | Set sound speed. Usual values are 8000, 11025, 22051 and 44100. 51 | Default is 11025. 52 | 53 | -sndmono 54 | Set mono sound 55 | 56 | -sndstereo 57 | Set stereo sound (default if supported) 58 | 59 | Installation 60 | ------------ 61 | 62 | Boot DOS (I know, but you need it to run the Quake install program) and 63 | install Quake from your Quake CD to a DOS parition. 64 | 65 | Boot Linux and make a directory for Quake. Copy everything from the DOS Quake 66 | directory into it. i.e.: 67 | (cd /dos/quake; tar cf - .) | (cd ~/quake; tar xf -) 68 | 69 | Quake for X11 does not need to be setuid root. Sound can fail if /dev/dsp is 70 | not mode 666. 71 | 72 | Quake may segfault if it tries to initialize your sound card and their isn't 73 | one. Same with the CDROM. If it dies, try it with -nosound and/or 74 | -nocdaudio. If you have a sound card it died on and you know it is 75 | supported by USSLite (the driver that comes with the Linux kernel), let me 76 | know and I'll take a look at it. 77 | 78 | It should work with SCSI CDROMs, but is untested. 79 | 80 | Full TCP/IP network support is in, including listen and dedicated server 81 | modes. 82 | 83 | All of the options described in TECHINFO.TXT and MANUAL.TXT from the Quake 84 | distribution will work, 'cept for stuff with vid modes and stuff. 85 | 86 | End Notes 87 | --------- 88 | 89 | Linux Quake is *NOT* an officially supported product. Mail about it 90 | will be deleted. Do not email id about this product. If you are having 91 | technical difficultly, you can email me, but make sure you have the correct 92 | kernel, libc, svgalib and other software versions before you email me. 93 | 94 | Dave 'Zoid' Kirsch 95 | zoid@idsoftware.com 96 | Official Quake Unix Port Administrator 97 | 98 | Acks 99 | ---- 100 | 101 | Greg Alexander for initial work in SVGALib 102 | support. 103 | Dave Taylor for basic Linux support. 104 | id Software for Quake and making me port it. :) 105 | 106 | Lots of people on #linux, #quake for testing. 107 | 108 | -------------------------------------------------------------------------------- /dosasm.S: -------------------------------------------------------------------------------- 1 | #include "asm_i386.h" 2 | 3 | .data 4 | fpenv: .long 0, 0, 0, 0, 0, 0, 0, 0 5 | 6 | .text 7 | .globl C(StartMSRInterval) 8 | C(StartMSRInterval): 9 | movl $0x11,%ecx // read the CESR 10 | .byte 0x0F 11 | .byte 0x32 // RDMSR 12 | 13 | andl $0xFE3FFE3F,%eax // stop both counters 14 | .byte 0x0F 15 | .byte 0x30 // WRMSR 16 | 17 | movl 4(%esp),%eax // point counter 0 to desired event, with counters 18 | andl $0x3F,%eax // still stopped 19 | movl $0x11,%ecx 20 | .byte 0x0F 21 | .byte 0x30 // WRMSR 22 | 23 | movl $0x12,%ecx // set counter 0 to the value 0 24 | subl %eax,%eax 25 | subl %edx,%edx 26 | .byte 0x0F 27 | .byte 0x30 // WRMSR 28 | 29 | movl 4(%esp),%eax // restart counter 0 with selected event 30 | andl $0x3F,%eax 31 | subl %edx,%edx 32 | orl $0xC0,%eax 33 | movl $0x11,%ecx // control and event select 34 | .byte 0x0F 35 | .byte 0x30 // WRMSR 36 | 37 | ret 38 | 39 | .globl C(EndMSRInterval) 40 | C(EndMSRInterval): 41 | movl $0x12,%ecx // counter 0 42 | .byte 0x0F 43 | .byte 0x32 // RDMSR 44 | 45 | ret // lower 32 bits of count in %eax 46 | 47 | #if 0 48 | .data 49 | Lxxx: .long 0 50 | 51 | .text 52 | 53 | .globl C(setstackcheck) 54 | C(setstackcheck): 55 | 56 | movl %esp,%eax 57 | subl $0x38000,%eax 58 | movl $0x5A5A5A5A,(%eax) 59 | movl %eax,Lxxx 60 | 61 | ret 62 | 63 | 64 | .globl C(dostackcheck) 65 | C(dostackcheck): 66 | 67 | movl Lxxx,%edx 68 | movl $0,%eax 69 | 70 | cmpl $0x5A5A5A5A,(%edx) 71 | jz qqq 72 | incl %eax 73 | qqq: 74 | 75 | ret 76 | #endif 77 | 78 | -------------------------------------------------------------------------------- /dosisms.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | // 22 | // dosisms.h: I'd call it dos.h, but the name's taken 23 | // 24 | 25 | #ifndef _DOSISMS_H_ 26 | #define _DOSISMS_H_ 27 | 28 | int dos_lockmem(void *addr, int size); 29 | int dos_unlockmem(void *addr, int size); 30 | 31 | typedef union { 32 | struct { 33 | unsigned long edi; 34 | unsigned long esi; 35 | unsigned long ebp; 36 | unsigned long res; 37 | unsigned long ebx; 38 | unsigned long edx; 39 | unsigned long ecx; 40 | unsigned long eax; 41 | } d; 42 | struct { 43 | unsigned short di, di_hi; 44 | unsigned short si, si_hi; 45 | unsigned short bp, bp_hi; 46 | unsigned short res, res_hi; 47 | unsigned short bx, bx_hi; 48 | unsigned short dx, dx_hi; 49 | unsigned short cx, cx_hi; 50 | unsigned short ax, ax_hi; 51 | unsigned short flags; 52 | unsigned short es; 53 | unsigned short ds; 54 | unsigned short fs; 55 | unsigned short gs; 56 | unsigned short ip; 57 | unsigned short cs; 58 | unsigned short sp; 59 | unsigned short ss; 60 | } x; 61 | struct { 62 | unsigned char edi[4]; 63 | unsigned char esi[4]; 64 | unsigned char ebp[4]; 65 | unsigned char res[4]; 66 | unsigned char bl, bh, ebx_b2, ebx_b3; 67 | unsigned char dl, dh, edx_b2, edx_b3; 68 | unsigned char cl, ch, ecx_b2, ecx_b3; 69 | unsigned char al, ah, eax_b2, eax_b3; 70 | } h; 71 | } regs_t; 72 | 73 | unsigned int ptr2real(void *ptr); 74 | void *real2ptr(unsigned int real); 75 | void *far2ptr(unsigned int farptr); 76 | unsigned int ptr2far(void *ptr); 77 | 78 | int dos_inportb(int port); 79 | int dos_inportw(int port); 80 | void dos_outportb(int port, int val); 81 | void dos_outportw(int port, int val); 82 | 83 | void dos_irqenable(void); 84 | void dos_irqdisable(void); 85 | void dos_registerintr(int intr, void (*handler)(void)); 86 | void dos_restoreintr(int intr); 87 | 88 | int dos_int86(int vec); 89 | 90 | void *dos_getmemory(int size); 91 | void dos_freememory(void *ptr); 92 | 93 | void dos_usleep(int usecs); 94 | 95 | int dos_getheapsize(void); 96 | 97 | extern regs_t regs; 98 | 99 | #endif // _DOSISMS_H_ 100 | 101 | -------------------------------------------------------------------------------- /draw.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | // draw.h -- these are the only functions outside the refresh allowed 22 | // to touch the vid buffer 23 | 24 | extern qpic_t *draw_disc; // also used on sbar 25 | 26 | void Draw_Init (void); 27 | void Draw_Character (int x, int y, int num); 28 | void Draw_DebugChar (char num); 29 | void Draw_Pic (int x, int y, qpic_t *pic); 30 | void Draw_TransPic (int x, int y, qpic_t *pic); 31 | void Draw_TransPicTranslate (int x, int y, qpic_t *pic, byte *translation); 32 | void Draw_ConsoleBackground (int lines); 33 | void Draw_BeginDisc (void); 34 | void Draw_EndDisc (void); 35 | void Draw_TileClear (int x, int y, int w, int h); 36 | void Draw_Fill (int x, int y, int w, int h, int c); 37 | void Draw_FadeScreen (void); 38 | void Draw_String (int x, int y, char *str); 39 | qpic_t *Draw_PicFromWad (char *name); 40 | qpic_t *Draw_CachePic (char *path); 41 | -------------------------------------------------------------------------------- /dxsdk/SDK/INC/D3DRMWIN.H: -------------------------------------------------------------------------------- 1 | /*==========================================================================; 2 | * 3 | * Copyright (C) 1995-1996 Microsoft Corporation. All Rights Reserved. 4 | * 5 | * File: d3drm.h 6 | * Content: Direct3DRM include file 7 | * 8 | ***************************************************************************/ 9 | 10 | #ifndef __D3DRMWIN_H__ 11 | #define __D3DRMWIN_H__ 12 | 13 | #ifndef WIN32 14 | #define WIN32 15 | #endif 16 | 17 | #include "d3drm.h" 18 | #include "ddraw.h" 19 | #include "d3d.h" 20 | 21 | /* 22 | * GUIDS used by Direct3DRM Windows interface 23 | */ 24 | DEFINE_GUID(IID_IDirect3DRMWinDevice, 0xc5016cc0, 0xd273, 0x11ce, 0xac, 0x48, 0x0, 0x0, 0xc0, 0x38, 0x25, 0xa1); 25 | 26 | WIN_TYPES(IDirect3DRMWinDevice, DIRECT3DRMWINDEVICE); 27 | 28 | #undef INTERFACE 29 | #define INTERFACE IDirect3DRMWinDevice 30 | 31 | DECLARE_INTERFACE_(IDirect3DRMWinDevice, IDirect3DRMObject) 32 | { 33 | IUNKNOWN_METHODS(PURE); 34 | IDIRECT3DRMOBJECT_METHODS(PURE); 35 | 36 | /* 37 | * IDirect3DRMWinDevice methods 38 | */ 39 | 40 | /* Repaint the window with the last frame which was rendered. */ 41 | STDMETHOD(HandlePaint)(THIS_ HDC hdc) PURE; 42 | 43 | /* Respond to a WM_ACTIVATE message. */ 44 | STDMETHOD(HandleActivate)(THIS_ WORD wparam) PURE; 45 | }; 46 | 47 | 48 | #endif 49 | -------------------------------------------------------------------------------- /dxsdk/SDK/INC/DSETUP.H: -------------------------------------------------------------------------------- 1 | /*========================================================================== 2 | * 3 | * Copyright (C) 1995-1996 Microsoft Corporation. All Rights Reserved. 4 | * 5 | * File: dsetup.h 6 | * Content: DirectXSetup, error codes and flags 7 | ***************************************************************************/ 8 | 9 | #ifndef __DSETUP_H__ 10 | #define __DSETUP_H__ 11 | 12 | #ifdef _WIN32 13 | #define COM_NO_WINDOWS_H 14 | #include 15 | #else 16 | #define GUID void 17 | #endif 18 | 19 | #ifdef __cplusplus 20 | extern "C" { 21 | #endif 22 | 23 | #define DSETUPERR_BADWINDOWSVERSION -1 24 | #define DSETUPERR_SOURCEFILENOTFOUND -2 25 | #define DSETUPERR_BADSOURCESIZE -3 26 | #define DSETUPERR_BADSOURCETIME -4 27 | #define DSETUPERR_NOCOPY -5 28 | #define DSETUPERR_OUTOFDISKSPACE -6 29 | #define DSETUPERR_CANTFINDINF -7 30 | #define DSETUPERR_CANTFINDDIR -8 31 | #define DSETUPERR_INTERNAL -9 32 | #define DSETUPERR_NTWITHNO3D -10 33 | 34 | 35 | #define MAX_INFLINE (16*1024) 36 | #define MAX_DESCRIPTION 256 37 | 38 | #define DSETUP_DDRAW 0x00000001 /* install DirectDraw */ 39 | #define DSETUP_DSOUND 0x00000002 /* install DirectSound */ 40 | #define DSETUP_DPLAY 0x00000004 /* install DirectPlay */ 41 | #define DSETUP_DDRAWDRV 0x00000008 /* install DirectDraw Drivers */ 42 | #define DSETUP_DSOUNDDRV 0x00000010 /* install DirectSound Drivers */ 43 | #define DSETUP_DPLAYSP 0x00000020 /* install DirectPlay Providers */ 44 | #define DSETUP_DVIDEO 0x00000040 /* install DirectVideo */ 45 | #define DSETUP_REINSTALL 0x00000080 /* install DirectX even if existing components have the same version */ 46 | #define DSETUP_DRVINFONLY 0x00000100 /* install DirectX inf files but not drivers */ 47 | #define DSETUP_D3D 0x00000200 /* install Direct3D */ 48 | #define DSETUP_REQUIRESD3D 0x00000400 | DSETUP_D3D /* install Direct3D, pop up dialog box on NT, if no D3D present */ 49 | 50 | #define DSETUP_DIRECTX (DSETUP_D3D | DSETUP_DDRAW | DSETUP_DSOUND | DSETUP_DPLAY | DSETUP_DDRAWDRV | DSETUP_DSOUNDDRV | DSETUP_DPLAYSP) 51 | 52 | int WINAPI DirectXSetup( HWND hwnd, LPSTR root_path, DWORD flags ); 53 | int WINAPI DirectXDeviceDriverSetup( HWND hwnd, LPSTR driver_class, LPSTR inf_path, LPSTR driver_path, DWORD flags ); 54 | int WINAPI DirectXSetupIsJapan( void ); 55 | int WINAPI DirectXSetupIsJapanNec( void ); 56 | 57 | typedef int (WINAPI * LPDIRECTXSETUP)( HWND, LPSTR, DWORD ); 58 | typedef int (WINAPI * LPDIRECTXDEVICEDRIVERSETUP)( HWND, LPSTR, LPSTR, LPSTR, DWORD ); 59 | typedef int (WINAPI * LPDIRECTXSETUPISJAPAN)( void ); 60 | typedef int (WINAPI * LPDIRECTXSETUPISJAPANNEC)( void ); 61 | 62 | #ifdef __cplusplus 63 | }; 64 | #endif 65 | 66 | #endif 67 | -------------------------------------------------------------------------------- /dxsdk/SDK/INC/FASTFILE.H: -------------------------------------------------------------------------------- 1 | /*========================================================================== 2 | * 3 | * Copyright (C) 1995-1996 Microsoft Corporation. All Rights Reserved. 4 | * 5 | * File: fastfile.h 6 | * Content: Definitions for fastfile access. 7 | * 8 | * THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, 9 | * EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED 10 | * WARRANTIES OF MERCHANTBILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE. 11 | * 12 | ***************************************************************************/ 13 | 14 | typedef LPVOID HFASTFILE; 15 | 16 | extern BOOL FastFileInit( LPSTR fname, int max_handles ); 17 | extern void FastFileFini( void ); 18 | extern HFASTFILE FastFileOpen( LPSTR name ); 19 | extern BOOL FastFileClose( HFASTFILE pfe ); 20 | extern BOOL FastFileRead( HFASTFILE pfh, LPVOID ptr, int size ); 21 | extern BOOL FastFileSeek( HFASTFILE pfe, int off, int how ); 22 | extern long FastFileTell( HFASTFILE pfe ); 23 | extern LPVOID FastFileLock( HFASTFILE pfe, int off, int len ); 24 | extern BOOL FastFileUnlock( HFASTFILE pfe, int off, int len ); 25 | -------------------------------------------------------------------------------- /dxsdk/SDK/LIB/DINPUT.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/dxsdk/SDK/LIB/DINPUT.LIB -------------------------------------------------------------------------------- /dxsdk/SDK/LIB/DXGUID.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/dxsdk/SDK/LIB/DXGUID.LIB -------------------------------------------------------------------------------- /gas2masm/gas2masm.dsp: -------------------------------------------------------------------------------- 1 | # Microsoft Developer Studio Project File - Name="gas2masm" - Package Owner=<4> 2 | # Microsoft Developer Studio Generated Build File, Format Version 6.00 3 | # ** DO NOT EDIT ** 4 | 5 | # TARGTYPE "Win32 (x86) Console Application" 0x0103 6 | 7 | CFG=gas2masm - Win32 Release 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 "gas2masm.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 "gas2masm.mak" CFG="gas2masm - Win32 Release" 17 | !MESSAGE 18 | !MESSAGE Possible choices for configuration are: 19 | !MESSAGE 20 | !MESSAGE "gas2masm - Win32 Release" (based on "Win32 (x86) Console Application") 21 | !MESSAGE "gas2masm - Win32 Debug" (based on "Win32 (x86) Console Application") 22 | !MESSAGE 23 | 24 | # Begin Project 25 | # PROP AllowPerConfigDependencies 0 26 | # PROP Scc_ProjName "" 27 | # PROP Scc_LocalPath "" 28 | CPP=cl.exe 29 | RSC=rc.exe 30 | 31 | !IF "$(CFG)" == "gas2masm - 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 Target_Dir "" 43 | # ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /c 44 | # ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /YX /FD /c 45 | # ADD BASE RSC /l 0x409 /d "NDEBUG" 46 | # ADD RSC /l 0x409 /d "NDEBUG" 47 | BSC32=bscmake.exe 48 | # ADD BASE BSC32 /nologo 49 | # ADD BSC32 /nologo 50 | LINK32=link.exe 51 | # 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:console /machine:I386 52 | # 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:console /machine:I386 53 | 54 | !ELSEIF "$(CFG)" == "gas2masm - Win32 Debug" 55 | 56 | # PROP BASE Use_MFC 0 57 | # PROP BASE Use_Debug_Libraries 1 58 | # PROP BASE Output_Dir ".\Debug" 59 | # PROP BASE Intermediate_Dir ".\Debug" 60 | # PROP BASE Target_Dir "" 61 | # PROP Use_MFC 0 62 | # PROP Use_Debug_Libraries 1 63 | # PROP Output_Dir ".\Debug" 64 | # PROP Intermediate_Dir ".\Debug" 65 | # PROP Target_Dir "" 66 | # ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /c 67 | # ADD CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /YX /FD /c 68 | # ADD BASE RSC /l 0x409 /d "_DEBUG" 69 | # ADD RSC /l 0x409 /d "_DEBUG" 70 | BSC32=bscmake.exe 71 | # ADD BASE BSC32 /nologo 72 | # ADD BSC32 /nologo 73 | LINK32=link.exe 74 | # 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:console /debug /machine:I386 75 | # 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:console /debug /machine:I386 76 | 77 | !ENDIF 78 | 79 | # Begin Target 80 | 81 | # Name "gas2masm - Win32 Release" 82 | # Name "gas2masm - Win32 Debug" 83 | # Begin Group "Source Files" 84 | 85 | # PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat;for;f90" 86 | # Begin Source File 87 | 88 | SOURCE=.\gas2masm.c 89 | # End Source File 90 | # End Group 91 | # Begin Group "Header Files" 92 | 93 | # PROP Default_Filter "h;hpp;hxx;hm;inl;fi;fd" 94 | # End Group 95 | # Begin Group "Resource Files" 96 | 97 | # PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;cnt;rtf;gif;jpg;jpeg;jpe" 98 | # End Group 99 | # End Target 100 | # End Project 101 | -------------------------------------------------------------------------------- /gas2masm/gas2masm.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: "gas2masm"=.\gas2masm.dsp - Package Owner=<4> 7 | 8 | Package=<5> 9 | {{{ 10 | }}} 11 | 12 | Package=<4> 13 | {{{ 14 | }}} 15 | 16 | ############################################################################### 17 | 18 | Global: 19 | 20 | Package=<5> 21 | {{{ 22 | }}} 23 | 24 | Package=<3> 25 | {{{ 26 | }}} 27 | 28 | ############################################################################### 29 | 30 | -------------------------------------------------------------------------------- /gas2masm/gas2masm.mdp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/gas2masm/gas2masm.mdp -------------------------------------------------------------------------------- /gas2masm/gas2masm.plg: -------------------------------------------------------------------------------- 1 | 2 | 3 |
 4 | 

Build Log

5 |

6 | --------------------Configuration: gas2masm - Win32 Debug-------------------- 7 |

8 |

Command Lines

9 | Creating temporary file "C:\TEMP\RSP730.tmp" with contents 10 | [ 11 | /nologo /MLd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_CONSOLE" /Fp".\Debug/gas2masm.pch" /YX /Fo".\Debug/" /Fd".\Debug/" /FD /c 12 | "D:\Work\quake source\WinQuake\gas2masm\gas2masm.c" 13 | ] 14 | Creating command line "cl.exe @C:\TEMP\RSP730.tmp" 15 | Creating temporary file "C:\TEMP\RSP731.tmp" with contents 16 | [ 17 | 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:console /incremental:yes /pdb:".\Debug/gas2masm.pdb" /debug /machine:I386 /out:".\Debug/gas2masm.exe" 18 | ".\Debug\gas2masm.obj" 19 | ] 20 | Creating command line "link.exe @C:\TEMP\RSP731.tmp" 21 |

Output Window

22 | Compiling... 23 | gas2masm.c 24 | Linking... 25 | 26 | 27 | 28 |

Results

29 | gas2masm.exe - 0 error(s), 0 warning(s) 30 |
31 | 32 | 33 | -------------------------------------------------------------------------------- /gl_warp_sin.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 0, 0.19633, 0.392541, 0.588517, 0.784137, 0.979285, 1.17384, 1.3677, 21 | 1.56072, 1.75281, 1.94384, 2.1337, 2.32228, 2.50945, 2.69512, 2.87916, 22 | 3.06147, 3.24193, 3.42044, 3.59689, 3.77117, 3.94319, 4.11282, 4.27998, 23 | 4.44456, 4.60647, 4.76559, 4.92185, 5.07515, 5.22538, 5.37247, 5.51632, 24 | 5.65685, 5.79398, 5.92761, 6.05767, 6.18408, 6.30677, 6.42566, 6.54068, 25 | 6.65176, 6.75883, 6.86183, 6.9607, 7.05537, 7.14579, 7.23191, 7.31368, 26 | 7.39104, 7.46394, 7.53235, 7.59623, 7.65552, 7.71021, 7.76025, 7.80562, 27 | 7.84628, 7.88222, 7.91341, 7.93984, 7.96148, 7.97832, 7.99036, 7.99759, 28 | 8, 7.99759, 7.99036, 7.97832, 7.96148, 7.93984, 7.91341, 7.88222, 29 | 7.84628, 7.80562, 7.76025, 7.71021, 7.65552, 7.59623, 7.53235, 7.46394, 30 | 7.39104, 7.31368, 7.23191, 7.14579, 7.05537, 6.9607, 6.86183, 6.75883, 31 | 6.65176, 6.54068, 6.42566, 6.30677, 6.18408, 6.05767, 5.92761, 5.79398, 32 | 5.65685, 5.51632, 5.37247, 5.22538, 5.07515, 4.92185, 4.76559, 4.60647, 33 | 4.44456, 4.27998, 4.11282, 3.94319, 3.77117, 3.59689, 3.42044, 3.24193, 34 | 3.06147, 2.87916, 2.69512, 2.50945, 2.32228, 2.1337, 1.94384, 1.75281, 35 | 1.56072, 1.3677, 1.17384, 0.979285, 0.784137, 0.588517, 0.392541, 0.19633, 36 | 9.79717e-16, -0.19633, -0.392541, -0.588517, -0.784137, -0.979285, -1.17384, -1.3677, 37 | -1.56072, -1.75281, -1.94384, -2.1337, -2.32228, -2.50945, -2.69512, -2.87916, 38 | -3.06147, -3.24193, -3.42044, -3.59689, -3.77117, -3.94319, -4.11282, -4.27998, 39 | -4.44456, -4.60647, -4.76559, -4.92185, -5.07515, -5.22538, -5.37247, -5.51632, 40 | -5.65685, -5.79398, -5.92761, -6.05767, -6.18408, -6.30677, -6.42566, -6.54068, 41 | -6.65176, -6.75883, -6.86183, -6.9607, -7.05537, -7.14579, -7.23191, -7.31368, 42 | -7.39104, -7.46394, -7.53235, -7.59623, -7.65552, -7.71021, -7.76025, -7.80562, 43 | -7.84628, -7.88222, -7.91341, -7.93984, -7.96148, -7.97832, -7.99036, -7.99759, 44 | -8, -7.99759, -7.99036, -7.97832, -7.96148, -7.93984, -7.91341, -7.88222, 45 | -7.84628, -7.80562, -7.76025, -7.71021, -7.65552, -7.59623, -7.53235, -7.46394, 46 | -7.39104, -7.31368, -7.23191, -7.14579, -7.05537, -6.9607, -6.86183, -6.75883, 47 | -6.65176, -6.54068, -6.42566, -6.30677, -6.18408, -6.05767, -5.92761, -5.79398, 48 | -5.65685, -5.51632, -5.37247, -5.22538, -5.07515, -4.92185, -4.76559, -4.60647, 49 | -4.44456, -4.27998, -4.11282, -3.94319, -3.77117, -3.59689, -3.42044, -3.24193, 50 | -3.06147, -2.87916, -2.69512, -2.50945, -2.32228, -2.1337, -1.94384, -1.75281, 51 | -1.56072, -1.3677, -1.17384, -0.979285, -0.784137, -0.588517, -0.392541, -0.19633, 52 | -------------------------------------------------------------------------------- /in_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // in_null.c -- for systems without a mouse 21 | 22 | #include "quakedef.h" 23 | 24 | void IN_Init (void) 25 | { 26 | } 27 | 28 | void IN_Shutdown (void) 29 | { 30 | } 31 | 32 | void IN_Commands (void) 33 | { 34 | } 35 | 36 | void IN_Move (usercmd_t *cmd) 37 | { 38 | } 39 | 40 | -------------------------------------------------------------------------------- /input.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // input.h -- external (non-keyboard) input devices 21 | 22 | void IN_Init (void); 23 | 24 | void IN_Shutdown (void); 25 | 26 | void IN_Commands (void); 27 | // oportunity for devices to stick commands on the script buffer 28 | 29 | void IN_Move (usercmd_t *cmd); 30 | // add additional movement on top of the keyboard move cmd 31 | 32 | void IN_ClearStates (void); 33 | // restores all button and position states to defaults 34 | 35 | -------------------------------------------------------------------------------- /keys.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | // 22 | // these are the key numbers that should be passed to Key_Event 23 | // 24 | #define K_TAB 9 25 | #define K_ENTER 13 26 | #define K_ESCAPE 27 27 | #define K_SPACE 32 28 | 29 | // normal keys should be passed as lowercased ascii 30 | 31 | #define K_BACKSPACE 127 32 | #define K_UPARROW 128 33 | #define K_DOWNARROW 129 34 | #define K_LEFTARROW 130 35 | #define K_RIGHTARROW 131 36 | 37 | #define K_ALT 132 38 | #define K_CTRL 133 39 | #define K_SHIFT 134 40 | #define K_F1 135 41 | #define K_F2 136 42 | #define K_F3 137 43 | #define K_F4 138 44 | #define K_F5 139 45 | #define K_F6 140 46 | #define K_F7 141 47 | #define K_F8 142 48 | #define K_F9 143 49 | #define K_F10 144 50 | #define K_F11 145 51 | #define K_F12 146 52 | #define K_INS 147 53 | #define K_DEL 148 54 | #define K_PGDN 149 55 | #define K_PGUP 150 56 | #define K_HOME 151 57 | #define K_END 152 58 | 59 | #define K_PAUSE 255 60 | 61 | // 62 | // mouse buttons generate virtual keys 63 | // 64 | #define K_MOUSE1 200 65 | #define K_MOUSE2 201 66 | #define K_MOUSE3 202 67 | 68 | // 69 | // joystick buttons 70 | // 71 | #define K_JOY1 203 72 | #define K_JOY2 204 73 | #define K_JOY3 205 74 | #define K_JOY4 206 75 | 76 | // 77 | // aux keys are for multi-buttoned joysticks to generate so they can use 78 | // the normal binding process 79 | // 80 | #define K_AUX1 207 81 | #define K_AUX2 208 82 | #define K_AUX3 209 83 | #define K_AUX4 210 84 | #define K_AUX5 211 85 | #define K_AUX6 212 86 | #define K_AUX7 213 87 | #define K_AUX8 214 88 | #define K_AUX9 215 89 | #define K_AUX10 216 90 | #define K_AUX11 217 91 | #define K_AUX12 218 92 | #define K_AUX13 219 93 | #define K_AUX14 220 94 | #define K_AUX15 221 95 | #define K_AUX16 222 96 | #define K_AUX17 223 97 | #define K_AUX18 224 98 | #define K_AUX19 225 99 | #define K_AUX20 226 100 | #define K_AUX21 227 101 | #define K_AUX22 228 102 | #define K_AUX23 229 103 | #define K_AUX24 230 104 | #define K_AUX25 231 105 | #define K_AUX26 232 106 | #define K_AUX27 233 107 | #define K_AUX28 234 108 | #define K_AUX29 235 109 | #define K_AUX30 236 110 | #define K_AUX31 237 111 | #define K_AUX32 238 112 | 113 | // JACK: Intellimouse(c) Mouse Wheel Support 114 | 115 | #define K_MWHEELUP 239 116 | #define K_MWHEELDOWN 240 117 | 118 | 119 | 120 | typedef enum {key_game, key_console, key_message, key_menu} keydest_t; 121 | 122 | extern keydest_t key_dest; 123 | extern char *keybindings[256]; 124 | extern int key_repeats[256]; 125 | extern int key_count; // incremented every key event 126 | extern int key_lastpress; 127 | 128 | void Key_Event (int key, qboolean down); 129 | void Key_Init (void); 130 | void Key_WriteBindings (FILE *f); 131 | void Key_SetBinding (int keynum, char *binding); 132 | void Key_ClearStates (void); 133 | 134 | -------------------------------------------------------------------------------- /kit/GLQUAKE.EXE: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/kit/GLQUAKE.EXE -------------------------------------------------------------------------------- /kit/OPENGL32.DLL: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/kit/OPENGL32.DLL -------------------------------------------------------------------------------- /m4/ax_check_compile_flag.m4: -------------------------------------------------------------------------------- 1 | # =========================================================================== 2 | # http://www.gnu.org/software/autoconf-archive/ax_check_compile_flag.html 3 | # =========================================================================== 4 | # 5 | # SYNOPSIS 6 | # 7 | # AX_CHECK_COMPILE_FLAG(FLAG, [ACTION-SUCCESS], [ACTION-FAILURE], [EXTRA-FLAGS], [INPUT]) 8 | # 9 | # DESCRIPTION 10 | # 11 | # Check whether the given FLAG works with the current language's compiler 12 | # or gives an error. (Warnings, however, are ignored) 13 | # 14 | # ACTION-SUCCESS/ACTION-FAILURE are shell commands to execute on 15 | # success/failure. 16 | # 17 | # If EXTRA-FLAGS is defined, it is added to the current language's default 18 | # flags (e.g. CFLAGS) when the check is done. The check is thus made with 19 | # the flags: "CFLAGS EXTRA-FLAGS FLAG". This can for example be used to 20 | # force the compiler to issue an error when a bad flag is given. 21 | # 22 | # INPUT gives an alternative input source to AC_COMPILE_IFELSE. 23 | # 24 | # NOTE: Implementation based on AX_CFLAGS_GCC_OPTION. Please keep this 25 | # macro in sync with AX_CHECK_{PREPROC,LINK}_FLAG. 26 | # 27 | # LICENSE 28 | # 29 | # Copyright (c) 2008 Guido U. Draheim 30 | # Copyright (c) 2011 Maarten Bosmans 31 | # 32 | # This program is free software: you can redistribute it and/or modify it 33 | # under the terms of the GNU General Public License as published by the 34 | # Free Software Foundation, either version 3 of the License, or (at your 35 | # option) any later version. 36 | # 37 | # This program is distributed in the hope that it will be useful, but 38 | # WITHOUT ANY WARRANTY; without even the implied warranty of 39 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General 40 | # Public License for more details. 41 | # 42 | # You should have received a copy of the GNU General Public License along 43 | # with this program. If not, see . 44 | # 45 | # As a special exception, the respective Autoconf Macro's copyright owner 46 | # gives unlimited permission to copy, distribute and modify the configure 47 | # scripts that are the output of Autoconf when processing the Macro. You 48 | # need not follow the terms of the GNU General Public License when using 49 | # or distributing such scripts, even though portions of the text of the 50 | # Macro appear in them. The GNU General Public License (GPL) does govern 51 | # all other use of the material that constitutes the Autoconf Macro. 52 | # 53 | # This special exception to the GPL applies to versions of the Autoconf 54 | # Macro released by the Autoconf Archive. When you make and distribute a 55 | # modified version of the Autoconf Macro, you may extend this special 56 | # exception to the GPL to apply to your modified version as well. 57 | 58 | #serial 4 59 | 60 | AC_DEFUN([AX_CHECK_COMPILE_FLAG], 61 | [AC_PREREQ(2.64)dnl for _AC_LANG_PREFIX and AS_VAR_IF 62 | AS_VAR_PUSHDEF([CACHEVAR],[ax_cv_check_[]_AC_LANG_ABBREV[]flags_$4_$1])dnl 63 | AC_CACHE_CHECK([whether _AC_LANG compiler accepts $1], CACHEVAR, [ 64 | ax_check_save_flags=$[]_AC_LANG_PREFIX[]FLAGS 65 | _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1" 66 | AC_COMPILE_IFELSE([m4_default([$5],[AC_LANG_PROGRAM()])], 67 | [AS_VAR_SET(CACHEVAR,[yes])], 68 | [AS_VAR_SET(CACHEVAR,[no])]) 69 | _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags]) 70 | AS_VAR_IF(CACHEVAR,yes, 71 | [m4_default([$2], :)], 72 | [m4_default([$3], :)]) 73 | AS_VAR_POPDEF([CACHEVAR])dnl 74 | ])dnl AX_CHECK_COMPILE_FLAGS 75 | -------------------------------------------------------------------------------- /makezip.bat: -------------------------------------------------------------------------------- 1 | zip -9 -r code * -x *.obj -x *.sbr -x *.pch -x *.pdb -x *.o -x *.exe -x *.dll -x *.map -x *.bsc -x *.lib -x *.ilk -x *.exp -x *.idb -x *.zip 2 | -------------------------------------------------------------------------------- /mathlib.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // mathlib.h 21 | 22 | typedef float vec_t; 23 | typedef vec_t vec3_t[3]; 24 | typedef vec_t vec5_t[5]; 25 | 26 | typedef int fixed4_t; 27 | typedef int fixed8_t; 28 | typedef int fixed16_t; 29 | 30 | #ifndef M_PI 31 | #define M_PI 3.14159265358979323846 // matches value in gcc v2 math.h 32 | #endif 33 | 34 | struct mplane_s; 35 | 36 | extern vec3_t vec3_origin; 37 | extern int nanmask; 38 | 39 | #define IS_NAN(x) (((*(int *)&x)&nanmask)==nanmask) 40 | 41 | #define DotProduct(x,y) (x[0]*y[0]+x[1]*y[1]+x[2]*y[2]) 42 | #define VectorSubtract(a,b,c) {c[0]=a[0]-b[0];c[1]=a[1]-b[1];c[2]=a[2]-b[2];} 43 | #define VectorAdd(a,b,c) {c[0]=a[0]+b[0];c[1]=a[1]+b[1];c[2]=a[2]+b[2];} 44 | #define VectorCopy(a,b) {b[0]=a[0];b[1]=a[1];b[2]=a[2];} 45 | 46 | void VectorMA (vec3_t veca, float scale, vec3_t vecb, vec3_t vecc); 47 | 48 | vec_t _DotProduct (vec3_t v1, vec3_t v2); 49 | void _VectorSubtract (vec3_t veca, vec3_t vecb, vec3_t out); 50 | void _VectorAdd (vec3_t veca, vec3_t vecb, vec3_t out); 51 | void _VectorCopy (vec3_t in, vec3_t out); 52 | 53 | int VectorCompare (vec3_t v1, vec3_t v2); 54 | vec_t Length (vec3_t v); 55 | void CrossProduct (vec3_t v1, vec3_t v2, vec3_t cross); 56 | float VectorNormalize (vec3_t v); // returns vector length 57 | void VectorInverse (vec3_t v); 58 | void VectorScale (vec3_t in, vec_t scale, vec3_t out); 59 | int Q_log2(int val); 60 | 61 | void R_ConcatRotations (float in1[3][3], float in2[3][3], float out[3][3]); 62 | void R_ConcatTransforms (float in1[3][4], float in2[3][4], float out[3][4]); 63 | 64 | void FloorDivMod (double numer, double denom, int *quotient, 65 | int *rem); 66 | fixed16_t Invert24To16(fixed16_t val); 67 | int GreatestCommonDivisor (int i1, int i2); 68 | 69 | void AngleVectors (vec3_t angles, vec3_t forward, vec3_t right, vec3_t up); 70 | int BoxOnPlaneSide (vec3_t emins, vec3_t emaxs, struct mplane_s *plane); 71 | float anglemod(float a); 72 | 73 | 74 | 75 | #define BOX_ON_PLANE_SIDE(emins, emaxs, p) \ 76 | (((p)->type < 3)? \ 77 | ( \ 78 | ((p)->dist <= (emins)[(p)->type])? \ 79 | 1 \ 80 | : \ 81 | ( \ 82 | ((p)->dist >= (emaxs)[(p)->type])?\ 83 | 2 \ 84 | : \ 85 | 3 \ 86 | ) \ 87 | ) \ 88 | : \ 89 | BoxOnPlaneSide( (emins), (emaxs), (p))) 90 | -------------------------------------------------------------------------------- /menu.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | // 22 | // the net drivers should just set the apropriate bits in m_activenet, 23 | // instead of having the menu code look through their internal tables 24 | // 25 | #define MNET_IPX 1 26 | #define MNET_TCP 2 27 | 28 | extern int m_activenet; 29 | 30 | // 31 | // menus 32 | // 33 | void M_Init (void); 34 | void M_Keydown (int key); 35 | void M_Draw (void); 36 | void M_ToggleMenu_f (void); 37 | 38 | 39 | -------------------------------------------------------------------------------- /modelgen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // modelgen.h: header file for model generation program 22 | // 23 | 24 | // ********************************************************* 25 | // * This file must be identical in the modelgen directory * 26 | // * and in the Quake directory, because it's used to * 27 | // * pass data from one to the other via model files. * 28 | // ********************************************************* 29 | 30 | #ifdef INCLUDELIBS 31 | 32 | #include 33 | #include 34 | #include 35 | #include 36 | 37 | #include "cmdlib.h" 38 | #include "scriplib.h" 39 | #include "trilib.h" 40 | #include "lbmlib.h" 41 | #include "mathlib.h" 42 | 43 | #endif 44 | 45 | #define ALIAS_VERSION 6 46 | 47 | #define ALIAS_ONSEAM 0x0020 48 | 49 | // must match definition in spritegn.h 50 | #ifndef SYNCTYPE_T 51 | #define SYNCTYPE_T 52 | typedef enum {ST_SYNC=0, ST_RAND } synctype_t; 53 | #endif 54 | 55 | typedef enum { ALIAS_SINGLE=0, ALIAS_GROUP } aliasframetype_t; 56 | 57 | typedef enum { ALIAS_SKIN_SINGLE=0, ALIAS_SKIN_GROUP } aliasskintype_t; 58 | 59 | typedef struct { 60 | int ident; 61 | int version; 62 | vec3_t scale; 63 | vec3_t scale_origin; 64 | float boundingradius; 65 | vec3_t eyeposition; 66 | int numskins; 67 | int skinwidth; 68 | int skinheight; 69 | int numverts; 70 | int numtris; 71 | int numframes; 72 | synctype_t synctype; 73 | int flags; 74 | float size; 75 | } mdl_t; 76 | 77 | // TODO: could be shorts 78 | 79 | typedef struct { 80 | int onseam; 81 | int s; 82 | int t; 83 | } stvert_t; 84 | 85 | typedef struct dtriangle_s { 86 | int facesfront; 87 | int vertindex[3]; 88 | } dtriangle_t; 89 | 90 | #define DT_FACES_FRONT 0x0010 91 | 92 | // This mirrors trivert_t in trilib.h, is present so Quake knows how to 93 | // load this data 94 | 95 | typedef struct { 96 | byte v[3]; 97 | byte lightnormalindex; 98 | } trivertx_t; 99 | 100 | typedef struct { 101 | trivertx_t bboxmin; // lightnormal isn't used 102 | trivertx_t bboxmax; // lightnormal isn't used 103 | char name[16]; // frame name from grabbing 104 | } daliasframe_t; 105 | 106 | typedef struct { 107 | int numframes; 108 | trivertx_t bboxmin; // lightnormal isn't used 109 | trivertx_t bboxmax; // lightnormal isn't used 110 | } daliasgroup_t; 111 | 112 | typedef struct { 113 | int numskins; 114 | } daliasskingroup_t; 115 | 116 | typedef struct { 117 | float interval; 118 | } daliasinterval_t; 119 | 120 | typedef struct { 121 | float interval; 122 | } daliasskininterval_t; 123 | 124 | typedef struct { 125 | aliasframetype_t type; 126 | } daliasframetype_t; 127 | 128 | typedef struct { 129 | aliasskintype_t type; 130 | } daliasskintype_t; 131 | 132 | #define IDPOLYHEADER (('O'<<24)+('P'<<16)+('D'<<8)+'I') 133 | // little-endian "IDPO" 134 | 135 | -------------------------------------------------------------------------------- /net_bsd.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | #include "quakedef.h" 21 | 22 | #include "net_loop.h" 23 | #include "net_dgrm.h" 24 | 25 | net_driver_t net_drivers[MAX_NET_DRIVERS] = 26 | { 27 | { 28 | "Loopback", 29 | false, 30 | Loop_Init, 31 | Loop_Listen, 32 | Loop_SearchForHosts, 33 | Loop_Connect, 34 | Loop_CheckNewConnections, 35 | Loop_GetMessage, 36 | Loop_SendMessage, 37 | Loop_SendUnreliableMessage, 38 | Loop_CanSendMessage, 39 | Loop_CanSendUnreliableMessage, 40 | Loop_Close, 41 | Loop_Shutdown 42 | } 43 | , 44 | { 45 | "Datagram", 46 | false, 47 | Datagram_Init, 48 | Datagram_Listen, 49 | Datagram_SearchForHosts, 50 | Datagram_Connect, 51 | Datagram_CheckNewConnections, 52 | Datagram_GetMessage, 53 | Datagram_SendMessage, 54 | Datagram_SendUnreliableMessage, 55 | Datagram_CanSendMessage, 56 | Datagram_CanSendUnreliableMessage, 57 | Datagram_Close, 58 | Datagram_Shutdown 59 | } 60 | }; 61 | 62 | int net_numdrivers = 2; 63 | 64 | #include "net_udp.h" 65 | 66 | net_landriver_t net_landrivers[MAX_NET_DRIVERS] = 67 | { 68 | { 69 | "UDP", 70 | false, 71 | 0, 72 | UDP_Init, 73 | UDP_Shutdown, 74 | UDP_Listen, 75 | UDP_OpenSocket, 76 | UDP_CloseSocket, 77 | UDP_Connect, 78 | UDP_CheckNewConnections, 79 | UDP_Read, 80 | UDP_Write, 81 | UDP_Broadcast, 82 | UDP_AddrToString, 83 | UDP_StringToAddr, 84 | UDP_GetSocketAddr, 85 | UDP_GetNameFromAddr, 86 | UDP_GetAddrFromName, 87 | UDP_AddrCompare, 88 | UDP_GetSocketPort, 89 | UDP_SetSocketPort 90 | } 91 | }; 92 | 93 | int net_numlandrivers = 1; 94 | -------------------------------------------------------------------------------- /net_bw.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // net_bw.h 21 | 22 | int BW_Init (void); 23 | void BW_Shutdown (void); 24 | void BW_Listen (qboolean state); 25 | int BW_OpenSocket (int port); 26 | int BW_CloseSocket (int socket); 27 | int BW_Connect (int socket, struct qsockaddr *addr); 28 | int BW_CheckNewConnections (void); 29 | int BW_Read (int socket, byte *buf, int len, struct qsockaddr *addr); 30 | int BW_Write (int socket, byte *buf, int len, struct qsockaddr *addr); 31 | int BW_Broadcast (int socket, byte *buf, int len); 32 | char *BW_AddrToString (struct qsockaddr *addr); 33 | int BW_StringToAddr (char *string, struct qsockaddr *addr); 34 | int BW_GetSocketAddr (int socket, struct qsockaddr *addr); 35 | int BW_GetNameFromAddr (struct qsockaddr *addr, char *name); 36 | int BW_GetAddrFromName (char *name, struct qsockaddr *addr); 37 | int BW_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2); 38 | int BW_GetSocketPort (struct qsockaddr *addr); 39 | int BW_SetSocketPort (struct qsockaddr *addr, int port); 40 | -------------------------------------------------------------------------------- /net_dgrm.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // net_dgrm.h 21 | 22 | 23 | int Datagram_Init (void); 24 | void Datagram_Listen (qboolean state); 25 | void Datagram_SearchForHosts (qboolean xmit); 26 | qsocket_t *Datagram_Connect (char *host); 27 | qsocket_t *Datagram_CheckNewConnections (void); 28 | int Datagram_GetMessage (qsocket_t *sock); 29 | int Datagram_SendMessage (qsocket_t *sock, sizebuf_t *data); 30 | int Datagram_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data); 31 | qboolean Datagram_CanSendMessage (qsocket_t *sock); 32 | qboolean Datagram_CanSendUnreliableMessage (qsocket_t *sock); 33 | void Datagram_Close (qsocket_t *sock); 34 | void Datagram_Shutdown (void); 35 | -------------------------------------------------------------------------------- /net_dos.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | #include "quakedef.h" 21 | 22 | #include "net_loop.h" 23 | #include "net_dgrm.h" 24 | #include "net_ser.h" 25 | 26 | net_driver_t net_drivers[MAX_NET_DRIVERS] = 27 | { 28 | { 29 | "Loopback", 30 | false, 31 | Loop_Init, 32 | Loop_Listen, 33 | Loop_SearchForHosts, 34 | Loop_Connect, 35 | Loop_CheckNewConnections, 36 | Loop_GetMessage, 37 | Loop_SendMessage, 38 | Loop_SendUnreliableMessage, 39 | Loop_CanSendMessage, 40 | Loop_CanSendUnreliableMessage, 41 | Loop_Close, 42 | Loop_Shutdown 43 | } 44 | , 45 | { 46 | "Datagram", 47 | false, 48 | Datagram_Init, 49 | Datagram_Listen, 50 | Datagram_SearchForHosts, 51 | Datagram_Connect, 52 | Datagram_CheckNewConnections, 53 | Datagram_GetMessage, 54 | Datagram_SendMessage, 55 | Datagram_SendUnreliableMessage, 56 | Datagram_CanSendMessage, 57 | Datagram_CanSendUnreliableMessage, 58 | Datagram_Close, 59 | Datagram_Shutdown 60 | } 61 | , 62 | { 63 | "Serial", 64 | false, 65 | Serial_Init, 66 | Serial_Listen, 67 | Serial_SearchForHosts, 68 | Serial_Connect, 69 | Serial_CheckNewConnections, 70 | Serial_GetMessage, 71 | Serial_SendMessage, 72 | Serial_SendUnreliableMessage, 73 | Serial_CanSendMessage, 74 | Serial_CanSendUnreliableMessage, 75 | Serial_Close, 76 | Serial_Shutdown 77 | } 78 | }; 79 | 80 | int net_numdrivers = 3; 81 | 82 | 83 | #include "net_bw.h" 84 | #include "net_ipx.h" 85 | #include "net_mp.h" 86 | 87 | net_landriver_t net_landrivers[MAX_NET_DRIVERS] = 88 | { 89 | { 90 | "Beame & Whiteside TCP/IP", 91 | false, 92 | 0, 93 | BW_Init, 94 | BW_Shutdown, 95 | BW_Listen, 96 | BW_OpenSocket, 97 | BW_CloseSocket, 98 | BW_Connect, 99 | BW_CheckNewConnections, 100 | BW_Read, 101 | BW_Write, 102 | BW_Broadcast, 103 | BW_AddrToString, 104 | BW_StringToAddr, 105 | BW_GetSocketAddr, 106 | BW_GetNameFromAddr, 107 | BW_GetAddrFromName, 108 | BW_AddrCompare, 109 | BW_GetSocketPort, 110 | BW_SetSocketPort 111 | } 112 | , 113 | { 114 | "IPX", 115 | false, 116 | 0, 117 | IPX_Init, 118 | IPX_Shutdown, 119 | IPX_Listen, 120 | IPX_OpenSocket, 121 | IPX_CloseSocket, 122 | IPX_Connect, 123 | IPX_CheckNewConnections, 124 | IPX_Read, 125 | IPX_Write, 126 | IPX_Broadcast, 127 | IPX_AddrToString, 128 | IPX_StringToAddr, 129 | IPX_GetSocketAddr, 130 | IPX_GetNameFromAddr, 131 | IPX_GetAddrFromName, 132 | IPX_AddrCompare, 133 | IPX_GetSocketPort, 134 | IPX_SetSocketPort 135 | } 136 | , 137 | { 138 | "Win95 TCP/IP", 139 | false, 140 | 0, 141 | MPATH_Init, 142 | MPATH_Shutdown, 143 | MPATH_Listen, 144 | MPATH_OpenSocket, 145 | MPATH_CloseSocket, 146 | MPATH_Connect, 147 | MPATH_CheckNewConnections, 148 | MPATH_Read, 149 | MPATH_Write, 150 | MPATH_Broadcast, 151 | MPATH_AddrToString, 152 | MPATH_StringToAddr, 153 | MPATH_GetSocketAddr, 154 | MPATH_GetNameFromAddr, 155 | MPATH_GetAddrFromName, 156 | MPATH_AddrCompare, 157 | MPATH_GetSocketPort, 158 | MPATH_SetSocketPort 159 | } 160 | }; 161 | 162 | int net_numlandrivers = 3; 163 | -------------------------------------------------------------------------------- /net_ipx.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // net_ipx.h 21 | 22 | int IPX_Init (void); 23 | void IPX_Shutdown (void); 24 | void IPX_Listen (qboolean state); 25 | int IPX_OpenSocket (int port); 26 | int IPX_CloseSocket (int socket); 27 | int IPX_Connect (int socket, struct qsockaddr *addr); 28 | int IPX_CheckNewConnections (void); 29 | int IPX_Read (int socket, byte *buf, int len, struct qsockaddr *addr); 30 | int IPX_Write (int socket, byte *buf, int len, struct qsockaddr *addr); 31 | int IPX_Broadcast (int socket, byte *buf, int len); 32 | char *IPX_AddrToString (struct qsockaddr *addr); 33 | int IPX_StringToAddr (char *string, struct qsockaddr *addr); 34 | int IPX_GetSocketAddr (int socket, struct qsockaddr *addr); 35 | int IPX_GetNameFromAddr (struct qsockaddr *addr, char *name); 36 | int IPX_GetAddrFromName (char *name, struct qsockaddr *addr); 37 | int IPX_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2); 38 | int IPX_GetSocketPort (struct qsockaddr *addr); 39 | int IPX_SetSocketPort (struct qsockaddr *addr, int port); 40 | -------------------------------------------------------------------------------- /net_loop.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // net_loop.h 21 | 22 | int Loop_Init (void); 23 | void Loop_Listen (qboolean state); 24 | void Loop_SearchForHosts (qboolean xmit); 25 | qsocket_t *Loop_Connect (char *host); 26 | qsocket_t *Loop_CheckNewConnections (void); 27 | int Loop_GetMessage (qsocket_t *sock); 28 | int Loop_SendMessage (qsocket_t *sock, sizebuf_t *data); 29 | int Loop_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data); 30 | qboolean Loop_CanSendMessage (qsocket_t *sock); 31 | qboolean Loop_CanSendUnreliableMessage (qsocket_t *sock); 32 | void Loop_Close (qsocket_t *sock); 33 | void Loop_Shutdown (void); 34 | -------------------------------------------------------------------------------- /net_mp.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // net_mpath.h 21 | 22 | int MPATH_Init (void); 23 | void MPATH_Shutdown (void); 24 | void MPATH_Listen (qboolean state); 25 | int MPATH_OpenSocket (int port); 26 | int MPATH_CloseSocket (int socket); 27 | int MPATH_Connect (int socket, struct qsockaddr *addr); 28 | int MPATH_CheckNewConnections (void); 29 | int MPATH_Read (int socket, byte *buf, int len, struct qsockaddr *addr); 30 | int MPATH_Write (int socket, byte *buf, int len, struct qsockaddr *addr); 31 | int MPATH_Broadcast (int socket, byte *buf, int len); 32 | char *MPATH_AddrToString (struct qsockaddr *addr); 33 | int MPATH_StringToAddr (char *string, struct qsockaddr *addr); 34 | int MPATH_GetSocketAddr (int socket, struct qsockaddr *addr); 35 | int MPATH_GetNameFromAddr (struct qsockaddr *addr, char *name); 36 | int MPATH_GetAddrFromName (char *name, struct qsockaddr *addr); 37 | int MPATH_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2); 38 | int MPATH_GetSocketPort (struct qsockaddr *addr); 39 | int MPATH_SetSocketPort (struct qsockaddr *addr, int port); 40 | -------------------------------------------------------------------------------- /net_none.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | #include "quakedef.h" 21 | 22 | #include "net_loop.h" 23 | 24 | net_driver_t net_drivers[MAX_NET_DRIVERS] = 25 | { 26 | { 27 | "Loopback", 28 | false, 29 | Loop_Init, 30 | Loop_Listen, 31 | Loop_SearchForHosts, 32 | Loop_Connect, 33 | Loop_CheckNewConnections, 34 | Loop_GetMessage, 35 | Loop_SendMessage, 36 | Loop_SendUnreliableMessage, 37 | Loop_CanSendMessage, 38 | Loop_CanSendUnreliableMessage, 39 | Loop_Close, 40 | Loop_Shutdown 41 | } 42 | }; 43 | int net_numdrivers = 1; 44 | 45 | net_landriver_t net_landrivers[MAX_NET_DRIVERS]; 46 | int net_numlandrivers = 0; 47 | -------------------------------------------------------------------------------- /net_ser.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // net_ser.h 21 | 22 | int Serial_Init (void); 23 | void Serial_Listen (qboolean state); 24 | void Serial_SearchForHosts (qboolean xmit); 25 | qsocket_t *Serial_Connect (char *host); 26 | qsocket_t *Serial_CheckNewConnections (void); 27 | int Serial_GetMessage (qsocket_t *sock); 28 | int Serial_SendMessage (qsocket_t *sock, sizebuf_t *data); 29 | int Serial_SendUnreliableMessage (qsocket_t *sock, sizebuf_t *data); 30 | qboolean Serial_CanSendMessage (qsocket_t *sock); 31 | qboolean Serial_CanSendUnreliableMessage (qsocket_t *sock); 32 | void Serial_Close (qsocket_t *sock); 33 | void Serial_Shutdown (void); 34 | -------------------------------------------------------------------------------- /net_udp.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // net_udp.h 21 | 22 | int UDP_Init (void); 23 | void UDP_Shutdown (void); 24 | void UDP_Listen (qboolean state); 25 | int UDP_OpenSocket (int port); 26 | int UDP_CloseSocket (int socket); 27 | int UDP_Connect (int socket, struct qsockaddr *addr); 28 | int UDP_CheckNewConnections (void); 29 | int UDP_Read (int socket, byte *buf, int len, struct qsockaddr *addr); 30 | int UDP_Write (int socket, byte *buf, int len, struct qsockaddr *addr); 31 | int UDP_Broadcast (int socket, byte *buf, int len); 32 | char *UDP_AddrToString (struct qsockaddr *addr); 33 | int UDP_StringToAddr (char *string, struct qsockaddr *addr); 34 | int UDP_GetSocketAddr (int socket, struct qsockaddr *addr); 35 | int UDP_GetNameFromAddr (struct qsockaddr *addr, char *name); 36 | int UDP_GetAddrFromName (char *name, struct qsockaddr *addr); 37 | int UDP_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2); 38 | int UDP_GetSocketPort (struct qsockaddr *addr); 39 | int UDP_SetSocketPort (struct qsockaddr *addr, int port); 40 | -------------------------------------------------------------------------------- /net_vcr.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // net_vcr.h 21 | 22 | #define VCR_OP_CONNECT 1 23 | #define VCR_OP_GETMESSAGE 2 24 | #define VCR_OP_SENDMESSAGE 3 25 | #define VCR_OP_CANSENDMESSAGE 4 26 | #define VCR_MAX_MESSAGE 4 27 | 28 | int VCR_Init (void); 29 | void VCR_Listen (qboolean state); 30 | void VCR_SearchForHosts (qboolean xmit); 31 | qsocket_t *VCR_Connect (char *host); 32 | qsocket_t *VCR_CheckNewConnections (void); 33 | int VCR_GetMessage (qsocket_t *sock); 34 | int VCR_SendMessage (qsocket_t *sock, sizebuf_t *data); 35 | qboolean VCR_CanSendMessage (qsocket_t *sock); 36 | void VCR_Close (qsocket_t *sock); 37 | void VCR_Shutdown (void); 38 | -------------------------------------------------------------------------------- /net_win.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | #include "quakedef.h" 21 | 22 | #include "net_loop.h" 23 | #include "net_dgrm.h" 24 | #include "net_ser.h" 25 | 26 | net_driver_t net_drivers[MAX_NET_DRIVERS] = 27 | { 28 | { 29 | "Loopback", 30 | false, 31 | Loop_Init, 32 | Loop_Listen, 33 | Loop_SearchForHosts, 34 | Loop_Connect, 35 | Loop_CheckNewConnections, 36 | Loop_GetMessage, 37 | Loop_SendMessage, 38 | Loop_SendUnreliableMessage, 39 | Loop_CanSendMessage, 40 | Loop_CanSendUnreliableMessage, 41 | Loop_Close, 42 | Loop_Shutdown 43 | } 44 | , 45 | { 46 | "Datagram", 47 | false, 48 | Datagram_Init, 49 | Datagram_Listen, 50 | Datagram_SearchForHosts, 51 | Datagram_Connect, 52 | Datagram_CheckNewConnections, 53 | Datagram_GetMessage, 54 | Datagram_SendMessage, 55 | Datagram_SendUnreliableMessage, 56 | Datagram_CanSendMessage, 57 | Datagram_CanSendUnreliableMessage, 58 | Datagram_Close, 59 | Datagram_Shutdown 60 | } 61 | }; 62 | 63 | int net_numdrivers = 2; 64 | 65 | 66 | #include "net_wins.h" 67 | #include "net_wipx.h" 68 | 69 | net_landriver_t net_landrivers[MAX_NET_DRIVERS] = 70 | { 71 | { 72 | "Winsock TCPIP", 73 | false, 74 | 0, 75 | WINS_Init, 76 | WINS_Shutdown, 77 | WINS_Listen, 78 | WINS_OpenSocket, 79 | WINS_CloseSocket, 80 | WINS_Connect, 81 | WINS_CheckNewConnections, 82 | WINS_Read, 83 | WINS_Write, 84 | WINS_Broadcast, 85 | WINS_AddrToString, 86 | WINS_StringToAddr, 87 | WINS_GetSocketAddr, 88 | WINS_GetNameFromAddr, 89 | WINS_GetAddrFromName, 90 | WINS_AddrCompare, 91 | WINS_GetSocketPort, 92 | WINS_SetSocketPort 93 | }, 94 | { 95 | "Winsock IPX", 96 | false, 97 | 0, 98 | WIPX_Init, 99 | WIPX_Shutdown, 100 | WIPX_Listen, 101 | WIPX_OpenSocket, 102 | WIPX_CloseSocket, 103 | WIPX_Connect, 104 | WIPX_CheckNewConnections, 105 | WIPX_Read, 106 | WIPX_Write, 107 | WIPX_Broadcast, 108 | WIPX_AddrToString, 109 | WIPX_StringToAddr, 110 | WIPX_GetSocketAddr, 111 | WIPX_GetNameFromAddr, 112 | WIPX_GetAddrFromName, 113 | WIPX_AddrCompare, 114 | WIPX_GetSocketPort, 115 | WIPX_SetSocketPort 116 | } 117 | 118 | }; 119 | 120 | int net_numlandrivers = 2; 121 | -------------------------------------------------------------------------------- /net_wins.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // net_wins.h 21 | 22 | int WINS_Init (void); 23 | void WINS_Shutdown (void); 24 | void WINS_Listen (qboolean state); 25 | int WINS_OpenSocket (int port); 26 | int WINS_CloseSocket (int socket); 27 | int WINS_Connect (int socket, struct qsockaddr *addr); 28 | int WINS_CheckNewConnections (void); 29 | int WINS_Read (int socket, byte *buf, int len, struct qsockaddr *addr); 30 | int WINS_Write (int socket, byte *buf, int len, struct qsockaddr *addr); 31 | int WINS_Broadcast (int socket, byte *buf, int len); 32 | char *WINS_AddrToString (struct qsockaddr *addr); 33 | int WINS_StringToAddr (char *string, struct qsockaddr *addr); 34 | int WINS_GetSocketAddr (int socket, struct qsockaddr *addr); 35 | int WINS_GetNameFromAddr (struct qsockaddr *addr, char *name); 36 | int WINS_GetAddrFromName (char *name, struct qsockaddr *addr); 37 | int WINS_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2); 38 | int WINS_GetSocketPort (struct qsockaddr *addr); 39 | int WINS_SetSocketPort (struct qsockaddr *addr, int port); 40 | -------------------------------------------------------------------------------- /net_wipx.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // net_wipx.h 21 | 22 | int WIPX_Init (void); 23 | void WIPX_Shutdown (void); 24 | void WIPX_Listen (qboolean state); 25 | int WIPX_OpenSocket (int port); 26 | int WIPX_CloseSocket (int socket); 27 | int WIPX_Connect (int socket, struct qsockaddr *addr); 28 | int WIPX_CheckNewConnections (void); 29 | int WIPX_Read (int socket, byte *buf, int len, struct qsockaddr *addr); 30 | int WIPX_Write (int socket, byte *buf, int len, struct qsockaddr *addr); 31 | int WIPX_Broadcast (int socket, byte *buf, int len); 32 | char *WIPX_AddrToString (struct qsockaddr *addr); 33 | int WIPX_StringToAddr (char *string, struct qsockaddr *addr); 34 | int WIPX_GetSocketAddr (int socket, struct qsockaddr *addr); 35 | int WIPX_GetNameFromAddr (struct qsockaddr *addr, char *name); 36 | int WIPX_GetAddrFromName (char *name, struct qsockaddr *addr); 37 | int WIPX_AddrCompare (struct qsockaddr *addr1, struct qsockaddr *addr2); 38 | int WIPX_GetSocketPort (struct qsockaddr *addr); 39 | int WIPX_SetSocketPort (struct qsockaddr *addr, int port); 40 | -------------------------------------------------------------------------------- /net_wso.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/net_wso.c -------------------------------------------------------------------------------- /nonintel.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // nonintel.c: code for non-Intel processors only 22 | // 23 | 24 | #include "quakedef.h" 25 | #include "r_local.h" 26 | #include "d_local.h" 27 | 28 | #if !id386 29 | 30 | /* 31 | ================ 32 | R_Surf8Patch 33 | ================ 34 | */ 35 | void R_Surf8Patch () 36 | { 37 | // we only patch code on Intel 38 | } 39 | 40 | 41 | /* 42 | ================ 43 | R_Surf16Patch 44 | ================ 45 | */ 46 | void R_Surf16Patch () 47 | { 48 | // we only patch code on Intel 49 | } 50 | 51 | 52 | /* 53 | ================ 54 | R_SurfacePatch 55 | ================ 56 | */ 57 | void R_SurfacePatch (void) 58 | { 59 | // we only patch code on Intel 60 | } 61 | 62 | 63 | #endif // !id386 64 | 65 | -------------------------------------------------------------------------------- /pr_comp.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | // this file is shared by quake and qcc 22 | 23 | typedef int func_t; 24 | typedef int string_t; 25 | 26 | typedef enum {ev_void, ev_string, ev_float, ev_vector, ev_entity, ev_field, ev_function, ev_pointer} etype_t; 27 | 28 | 29 | #define OFS_NULL 0 30 | #define OFS_RETURN 1 31 | #define OFS_PARM0 4 // leave 3 ofs for each parm to hold vectors 32 | #define OFS_PARM1 7 33 | #define OFS_PARM2 10 34 | #define OFS_PARM3 13 35 | #define OFS_PARM4 16 36 | #define OFS_PARM5 19 37 | #define OFS_PARM6 22 38 | #define OFS_PARM7 25 39 | #define RESERVED_OFS 28 40 | 41 | 42 | enum { 43 | OP_DONE, 44 | OP_MUL_F, 45 | OP_MUL_V, 46 | OP_MUL_FV, 47 | OP_MUL_VF, 48 | OP_DIV_F, 49 | OP_ADD_F, 50 | OP_ADD_V, 51 | OP_SUB_F, 52 | OP_SUB_V, 53 | 54 | OP_EQ_F, 55 | OP_EQ_V, 56 | OP_EQ_S, 57 | OP_EQ_E, 58 | OP_EQ_FNC, 59 | 60 | OP_NE_F, 61 | OP_NE_V, 62 | OP_NE_S, 63 | OP_NE_E, 64 | OP_NE_FNC, 65 | 66 | OP_LE, 67 | OP_GE, 68 | OP_LT, 69 | OP_GT, 70 | 71 | OP_LOAD_F, 72 | OP_LOAD_V, 73 | OP_LOAD_S, 74 | OP_LOAD_ENT, 75 | OP_LOAD_FLD, 76 | OP_LOAD_FNC, 77 | 78 | OP_ADDRESS, 79 | 80 | OP_STORE_F, 81 | OP_STORE_V, 82 | OP_STORE_S, 83 | OP_STORE_ENT, 84 | OP_STORE_FLD, 85 | OP_STORE_FNC, 86 | 87 | OP_STOREP_F, 88 | OP_STOREP_V, 89 | OP_STOREP_S, 90 | OP_STOREP_ENT, 91 | OP_STOREP_FLD, 92 | OP_STOREP_FNC, 93 | 94 | OP_RETURN, 95 | OP_NOT_F, 96 | OP_NOT_V, 97 | OP_NOT_S, 98 | OP_NOT_ENT, 99 | OP_NOT_FNC, 100 | OP_IF, 101 | OP_IFNOT, 102 | OP_CALL0, 103 | OP_CALL1, 104 | OP_CALL2, 105 | OP_CALL3, 106 | OP_CALL4, 107 | OP_CALL5, 108 | OP_CALL6, 109 | OP_CALL7, 110 | OP_CALL8, 111 | OP_STATE, 112 | OP_GOTO, 113 | OP_AND, 114 | OP_OR, 115 | 116 | OP_BITAND, 117 | OP_BITOR 118 | }; 119 | 120 | 121 | typedef struct statement_s 122 | { 123 | unsigned short op; 124 | short a,b,c; 125 | } dstatement_t; 126 | 127 | typedef struct 128 | { 129 | unsigned short type; // if DEF_SAVEGLOBGAL bit is set 130 | // the variable needs to be saved in savegames 131 | unsigned short ofs; 132 | int s_name; 133 | } ddef_t; 134 | #define DEF_SAVEGLOBAL (1<<15) 135 | 136 | #define MAX_PARMS 8 137 | 138 | typedef struct 139 | { 140 | int first_statement; // negative numbers are builtins 141 | int parm_start; 142 | int locals; // total ints of parms + locals 143 | 144 | int profile; // runtime 145 | 146 | int s_name; 147 | int s_file; // source file defined in 148 | 149 | int numparms; 150 | byte parm_size[MAX_PARMS]; 151 | } dfunction_t; 152 | 153 | 154 | #define PROG_VERSION 6 155 | typedef struct 156 | { 157 | int version; 158 | int crc; // check of header file 159 | 160 | int ofs_statements; 161 | int numstatements; // statement 0 is an error 162 | 163 | int ofs_globaldefs; 164 | int numglobaldefs; 165 | 166 | int ofs_fielddefs; 167 | int numfielddefs; 168 | 169 | int ofs_functions; 170 | int numfunctions; // function 0 is an empty 171 | 172 | int ofs_strings; 173 | int numstrings; // first string is a null string 174 | 175 | int ofs_globals; 176 | int numglobals; 177 | 178 | int entityfields; 179 | } dprograms_t; 180 | 181 | -------------------------------------------------------------------------------- /progdefs.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | #ifdef QUAKE2 21 | #include "progdefs.q2" 22 | #else 23 | #include "progdefs.q1" 24 | #endif 25 | -------------------------------------------------------------------------------- /progdefs.q1: -------------------------------------------------------------------------------- 1 | 2 | /* file generated by qcc, do not modify */ 3 | 4 | typedef struct 5 | { int pad[28]; 6 | int self; 7 | int other; 8 | int world; 9 | float time; 10 | float frametime; 11 | float force_retouch; 12 | string_t mapname; 13 | float deathmatch; 14 | float coop; 15 | float teamplay; 16 | float serverflags; 17 | float total_secrets; 18 | float total_monsters; 19 | float found_secrets; 20 | float killed_monsters; 21 | float parm1; 22 | float parm2; 23 | float parm3; 24 | float parm4; 25 | float parm5; 26 | float parm6; 27 | float parm7; 28 | float parm8; 29 | float parm9; 30 | float parm10; 31 | float parm11; 32 | float parm12; 33 | float parm13; 34 | float parm14; 35 | float parm15; 36 | float parm16; 37 | vec3_t v_forward; 38 | vec3_t v_up; 39 | vec3_t v_right; 40 | float trace_allsolid; 41 | float trace_startsolid; 42 | float trace_fraction; 43 | vec3_t trace_endpos; 44 | vec3_t trace_plane_normal; 45 | float trace_plane_dist; 46 | int trace_ent; 47 | float trace_inopen; 48 | float trace_inwater; 49 | int msg_entity; 50 | func_t main; 51 | func_t StartFrame; 52 | func_t PlayerPreThink; 53 | func_t PlayerPostThink; 54 | func_t ClientKill; 55 | func_t ClientConnect; 56 | func_t PutClientInServer; 57 | func_t ClientDisconnect; 58 | func_t SetNewParms; 59 | func_t SetChangeParms; 60 | } globalvars_t; 61 | 62 | typedef struct 63 | { 64 | float modelindex; 65 | vec3_t absmin; 66 | vec3_t absmax; 67 | float ltime; 68 | float movetype; 69 | float solid; 70 | vec3_t origin; 71 | vec3_t oldorigin; 72 | vec3_t velocity; 73 | vec3_t angles; 74 | vec3_t avelocity; 75 | vec3_t punchangle; 76 | string_t classname; 77 | string_t model; 78 | float frame; 79 | float skin; 80 | float effects; 81 | vec3_t mins; 82 | vec3_t maxs; 83 | vec3_t size; 84 | func_t touch; 85 | func_t use; 86 | func_t think; 87 | func_t blocked; 88 | float nextthink; 89 | int groundentity; 90 | float health; 91 | float frags; 92 | float weapon; 93 | string_t weaponmodel; 94 | float weaponframe; 95 | float currentammo; 96 | float ammo_shells; 97 | float ammo_nails; 98 | float ammo_rockets; 99 | float ammo_cells; 100 | float items; 101 | float takedamage; 102 | int chain; 103 | float deadflag; 104 | vec3_t view_ofs; 105 | float button0; 106 | float button1; 107 | float button2; 108 | float impulse; 109 | float fixangle; 110 | vec3_t v_angle; 111 | float idealpitch; 112 | string_t netname; 113 | int enemy; 114 | float flags; 115 | float colormap; 116 | float team; 117 | float max_health; 118 | float teleport_time; 119 | float armortype; 120 | float armorvalue; 121 | float waterlevel; 122 | float watertype; 123 | float ideal_yaw; 124 | float yaw_speed; 125 | int aiment; 126 | int goalentity; 127 | float spawnflags; 128 | string_t target; 129 | string_t targetname; 130 | float dmg_take; 131 | float dmg_save; 132 | int dmg_inflictor; 133 | int owner; 134 | vec3_t movedir; 135 | string_t message; 136 | float sounds; 137 | string_t noise; 138 | string_t noise1; 139 | string_t noise2; 140 | string_t noise3; 141 | } entvars_t; 142 | 143 | #define PROGHEADER_CRC 5927 144 | -------------------------------------------------------------------------------- /progdefs.q2: -------------------------------------------------------------------------------- 1 | 2 | /* file generated by qcc, do not modify */ 3 | 4 | typedef struct 5 | { int pad[28]; 6 | int self; 7 | int other; 8 | int world; 9 | float time; 10 | float frametime; 11 | float force_retouch; 12 | string_t mapname; 13 | string_t startspot; 14 | float deathmatch; 15 | float coop; 16 | float teamplay; 17 | float serverflags; 18 | float total_secrets; 19 | float total_monsters; 20 | float found_secrets; 21 | float killed_monsters; 22 | float parm1; 23 | float parm2; 24 | float parm3; 25 | float parm4; 26 | float parm5; 27 | float parm6; 28 | float parm7; 29 | float parm8; 30 | float parm9; 31 | float parm10; 32 | float parm11; 33 | float parm12; 34 | float parm13; 35 | float parm14; 36 | float parm15; 37 | float parm16; 38 | vec3_t v_forward; 39 | vec3_t v_up; 40 | vec3_t v_right; 41 | float trace_allsolid; 42 | float trace_startsolid; 43 | float trace_fraction; 44 | vec3_t trace_endpos; 45 | vec3_t trace_plane_normal; 46 | float trace_plane_dist; 47 | int trace_ent; 48 | float trace_inopen; 49 | float trace_inwater; 50 | int msg_entity; 51 | string_t null; 52 | func_t main; 53 | func_t StartFrame; 54 | func_t PlayerPreThink; 55 | func_t PlayerPostThink; 56 | func_t ClientKill; 57 | func_t ClientConnect; 58 | func_t PutClientInServer; 59 | func_t ClientDisconnect; 60 | func_t SetNewParms; 61 | func_t SetChangeParms; 62 | } globalvars_t; 63 | 64 | typedef struct 65 | { 66 | float modelindex; 67 | vec3_t absmin; 68 | vec3_t absmax; 69 | float ltime; 70 | float movetype; 71 | float solid; 72 | vec3_t origin; 73 | vec3_t oldorigin; 74 | vec3_t velocity; 75 | vec3_t angles; 76 | vec3_t avelocity; 77 | vec3_t basevelocity; 78 | vec3_t punchangle; 79 | string_t classname; 80 | string_t model; 81 | float frame; 82 | float skin; 83 | float effects; 84 | float drawPercent; 85 | float gravity; 86 | float mass; 87 | float light_level; 88 | vec3_t mins; 89 | vec3_t maxs; 90 | vec3_t size; 91 | func_t touch; 92 | func_t use; 93 | func_t think; 94 | func_t blocked; 95 | float nextthink; 96 | int groundentity; 97 | float health; 98 | float frags; 99 | float weapon; 100 | string_t weaponmodel; 101 | float weaponframe; 102 | float currentammo; 103 | float ammo_shells; 104 | float ammo_nails; 105 | float ammo_rockets; 106 | float ammo_cells; 107 | float items; 108 | float items2; 109 | float takedamage; 110 | int chain; 111 | float deadflag; 112 | vec3_t view_ofs; 113 | float button0; 114 | float button1; 115 | float button2; 116 | float impulse; 117 | float fixangle; 118 | vec3_t v_angle; 119 | float idealpitch; 120 | float pitch_speed; 121 | string_t netname; 122 | int enemy; 123 | float flags; 124 | float colormap; 125 | float team; 126 | float max_health; 127 | float teleport_time; 128 | float armortype; 129 | float armorvalue; 130 | float waterlevel; 131 | float watertype; 132 | float ideal_yaw; 133 | float yaw_speed; 134 | int aiment; 135 | int goalentity; 136 | float spawnflags; 137 | string_t target; 138 | string_t targetname; 139 | float dmg_take; 140 | float dmg_save; 141 | int dmg_inflictor; 142 | int owner; 143 | vec3_t movedir; 144 | string_t message; 145 | float sounds; 146 | string_t noise; 147 | string_t noise1; 148 | string_t noise2; 149 | string_t noise3; 150 | float dmg; 151 | float dmgtime; 152 | float air_finished; 153 | float pain_finished; 154 | float radsuit_finished; 155 | float speed; 156 | } entvars_t; 157 | 158 | #define PROGHEADER_CRC 31586 159 | -------------------------------------------------------------------------------- /q.bat: -------------------------------------------------------------------------------- 1 | dos\quake -basedir /quake -game test_gjc %1 %2 %3 %4 %5 %6 %7 %8 %9 2 | -------------------------------------------------------------------------------- /qa.bat: -------------------------------------------------------------------------------- 1 | dos\quake -nocdaudio -basedir /quake -game test_am %1 %2 %3 %4 %5 %6 %7 %8 %9 2 | -------------------------------------------------------------------------------- /qb.bat: -------------------------------------------------------------------------------- 1 | dos\quake /quake/test_gjc;/quake/id1 %1 %2 %3 %4 %5 %6 %7 %8 %9 2 | -------------------------------------------------------------------------------- /qe3.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/qe3.ico -------------------------------------------------------------------------------- /qt.bat: -------------------------------------------------------------------------------- 1 | dos\quake /quake/test_am;/quake/test_jc;/quake/id1 %1 %2 %3 %4 %5 %6 %7 %8 %9 2 | -------------------------------------------------------------------------------- /quake-data.spec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Generate quake-data.spec 3 | # $1 is version 4 | # $2 is release 5 | # $3 is install dir (assumed to be in /var/tmp) 6 | cat < 16 | URL: http://www.idsoftware.com/ 17 | Source: quake-data-%{version}.tar.gz 18 | BuildArchitectures: noarch 19 | Group: Games 20 | Copyright: Restricted 21 | Icon: quake.gif 22 | BuildRoot: /var/tmp/%{name}-%{version} 23 | Summary: Quake for Linux 24 | 25 | %description 26 | "Quake is the biggest, baddest, and bloodiest 3-D action game ever 27 | conceived" - PC GAMER 28 | 29 | "The most important PC game ever" - PC ZONE 30 | 31 | ""Quake": Bloody Amazing" - USA TODAY 32 | 33 | "The Vanguard of a terrifying new level of immersive interactivity" - 34 | COMPUTER GAMING WORLD 35 | 36 | From the creators of DOOM and DOOM II comes the most intense, technologically 37 | advanced 3-D experience ever captured on CD ROM. Features free and fluid 38 | motion, ambient sound and lighting, and unmatched multiplayer capabilities 39 | (play with up to 15 others). 40 | 41 | This package contians the Quake data files needed to play the game. 42 | 43 | %install 44 | 45 | %files 46 | %attr(644,root,root) $3/comexp.txt 47 | %attr(644,root,root) $3/help.txt 48 | %attr(644,root,root) $3/licinfo.txt 49 | %attr(644,root,root) $3/manual.txt 50 | %attr(644,root,root) $3/readme.txt 51 | %attr(644,root,root) $3/rlicnse.txt 52 | %attr(644,root,root) $3/techinfo.txt 53 | %attr(644,root,root) $3/id1/pak0.pak 54 | %attr(644,root,root) $3/id1/pak1.pak 55 | 56 | %post 57 | /sbin/ldconfig 58 | 59 | EOF 60 | 61 | -------------------------------------------------------------------------------- /quake-hipnotic.spec.sh: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/quake-hipnotic.spec.sh -------------------------------------------------------------------------------- /quake-shareware.spec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Generate quake-shareware.spec 3 | # $1 is version 4 | # $2 is release 5 | # $3 is install dir (assumed to be in /var/tmp) 6 | cat < 16 | URL: http://www.idsoftware.com/ 17 | Source: quake-%{version}.tar.gz 18 | Group: Games 19 | Copyright: Restricted 20 | Icon: quake.gif 21 | BuildRoot: /var/tmp/%{name}-%{version} 22 | Summary: Quake for Linux 23 | 24 | %description 25 | "Quake is the biggest, baddest, and bloodiest 3-D action game ever 26 | conceived" - PC GAMER 27 | 28 | "The most important PC game ever" - PC ZONE 29 | 30 | ""Quake": Bloody Amazing" - USA TODAY 31 | 32 | "The Vanguard of a terrifying new level of immersive interactivity" - 33 | COMPUTER GAMING WORLD 34 | 35 | From the creators of DOOM and DOOM II comes the most intense, technologically 36 | advanced 3-D experience ever captured on CD ROM. Features free and fluid 37 | motion, ambient sound and lighting, and unmatched multiplayer capabilities 38 | (play with up to 15 others). 39 | 40 | Included in this archive are several different versions of Quake. 41 | 42 | - SQuake for SVGALib Console Graphics 43 | - GLQuake for 3DFX and other glX based hardware OpenGL 44 | - Quake.X11 for running Quake under X11 45 | 46 | %install 47 | 48 | %files 49 | %attr(644,root,root) $3/README 50 | %attr(4755,root,root) $3/squake 51 | %attr(4755,root,root) $3/glquake 52 | %attr(4755,root,root) $3/glquake.glx 53 | %attr(4755,root,root) $3/glquake.3dfxgl 54 | %attr(755,root,root) $3/quake.x11 55 | %attr(644,root,root) $3/help.txt 56 | %attr(644,root,root) $3/licinfo.txt 57 | %attr(644,root,root) $3/manual.txt 58 | %attr(644,root,root) $3/readme.txt 59 | %attr(644,root,root) $3/slicnse.txt 60 | %attr(644,root,root) $3/techinfo.txt 61 | %attr(644,root,root) $3/id1/pak0.pak 62 | %attr(755,root,root) /usr/lib/lib3dfxgl.so 63 | %attr(755,root,root) /usr/lib/libMesaGL.so.2.6 64 | 65 | %post 66 | /sbin/ldconfig 67 | 68 | EOF 69 | 70 | -------------------------------------------------------------------------------- /quake.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/quake.gif -------------------------------------------------------------------------------- /quake.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/quake.ico -------------------------------------------------------------------------------- /quake.spec.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # Generate quake.spec 3 | # $1 is version 4 | # $2 is release 5 | # $3 is install dir (assumed to be in /var/tmp) 6 | cat < 16 | URL: http://www.idsoftware.com/ 17 | Source: quake-%{version}.tar.gz 18 | Group: Games 19 | Copyright: Restricted 20 | Icon: quake.gif 21 | BuildRoot: /var/tmp/%{name}-%{version} 22 | Summary: Quake for Linux 23 | 24 | %description 25 | "Quake is the biggest, baddest, and bloodiest 3-D action game ever 26 | conceived" - PC GAMER 27 | 28 | "The most important PC game ever" - PC ZONE 29 | 30 | ""Quake": Bloody Amazing" - USA TODAY 31 | 32 | "The Vanguard of a terrifying new level of immersive interactivity" - 33 | COMPUTER GAMING WORLD 34 | 35 | From the creators of DOOM and DOOM II comes the most intense, technologically 36 | advanced 3-D experience ever captured on CD ROM. Features free and fluid 37 | motion, ambient sound and lighting, and unmatched multiplayer capabilities 38 | (play with up to 15 others). 39 | 40 | Included in this archive are several different versions of Quake. 41 | 42 | - SQuake for SVGALib Console Graphics 43 | - GLQuake for 3DFX and other glX based hardware OpenGL 44 | - Quake.X11 for running Quake under X11 45 | 46 | %install 47 | 48 | %files 49 | %attr(644,root,root) $3/README 50 | %attr(4755,root,root) $3/squake 51 | %attr(4755,root,root) $3/glquake 52 | %attr(4755,root,root) $3/glquake.glx 53 | %attr(4755,root,root) $3/glquake.3dfxgl 54 | %attr(755,root,root) $3/quake.x11 55 | %attr(755,root,root) /usr/lib/lib3dfxgl.so 56 | %attr(755,root,root) /usr/lib/libMesaGL.so.2.6 57 | 58 | %post 59 | /sbin/ldconfig 60 | EOF 61 | 62 | -------------------------------------------------------------------------------- /r_vars.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // r_vars.c: global refresh variables 21 | 22 | #include "quakedef.h" 23 | 24 | #if !id386 25 | 26 | // all global and static refresh variables are collected in a contiguous block 27 | // to avoid cache conflicts. 28 | 29 | //------------------------------------------------------- 30 | // global refresh variables 31 | //------------------------------------------------------- 32 | 33 | // FIXME: make into one big structure, like cl or sv 34 | // FIXME: do separately for refresh engine and driver 35 | 36 | int r_bmodelactive; 37 | 38 | #endif // !id386 39 | 40 | -------------------------------------------------------------------------------- /r_varsa.S: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // r_varsa.s 22 | // 23 | 24 | #include "asm_i386.h" 25 | #include "quakeasm.h" 26 | #include "asm_draw.h" 27 | #include "d_ifacea.h" 28 | 29 | #if id386 30 | 31 | .data 32 | 33 | //------------------------------------------------------- 34 | // ASM-only variables 35 | //------------------------------------------------------- 36 | .globl float_1, float_particle_z_clip, float_point5 37 | .globl float_minus_1, float_0 38 | float_0: .single 0.0 39 | float_1: .single 1.0 40 | float_minus_1: .single -1.0 41 | float_particle_z_clip: .single PARTICLE_Z_CLIP 42 | float_point5: .single 0.5 43 | 44 | .globl fp_16, fp_64k, fp_1m, fp_64kx64k 45 | .globl fp_1m_minus_1 46 | .globl fp_8 47 | fp_1m: .single 1048576.0 48 | fp_1m_minus_1: .single 1048575.0 49 | fp_64k: .single 65536.0 50 | fp_8: .single 8.0 51 | fp_16: .single 16.0 52 | fp_64kx64k: .long 0x4f000000 // (float)0x8000*0x10000 53 | 54 | 55 | .globl FloatZero, Float2ToThe31nd, FloatMinus2ToThe31nd 56 | FloatZero: .long 0 57 | Float2ToThe31nd: .long 0x4f000000 58 | FloatMinus2ToThe31nd: .long 0xcf000000 59 | 60 | .globl C(r_bmodelactive) 61 | C(r_bmodelactive): .long 0 62 | 63 | #endif // id386 64 | 65 | -------------------------------------------------------------------------------- /resource.h: -------------------------------------------------------------------------------- 1 | //{{NO_DEPENDENCIES}} 2 | // Microsoft Developer Studio generated include file. 3 | // Used by winquake.rc 4 | // 5 | #define IDS_STRING1 1 6 | #define IDI_ICON2 1 7 | #define IDD_DIALOG1 108 8 | #define IDD_PROGRESS 109 9 | #define IDC_PROGRESS 1000 10 | 11 | // Next default values for new objects 12 | // 13 | #ifdef APSTUDIO_INVOKED 14 | #ifndef APSTUDIO_READONLY_SYMBOLS 15 | #define _APS_NEXT_RESOURCE_VALUE 111 16 | #define _APS_NEXT_COMMAND_VALUE 40001 17 | #define _APS_NEXT_CONTROL_VALUE 1004 18 | #define _APS_NEXT_SYMED_VALUE 101 19 | #endif 20 | #endif 21 | -------------------------------------------------------------------------------- /sbar.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | // the status bar is only redrawn if something has changed, but if anything 22 | // does, the entire thing will be redrawn for the next vid.numpages frames. 23 | 24 | #define SBAR_HEIGHT 24 25 | 26 | extern int sb_lines; // scan lines to draw 27 | 28 | void Sbar_Init (void); 29 | 30 | void Sbar_Changed (void); 31 | // call whenever any of the client stats represented on the sbar changes 32 | 33 | void Sbar_Draw (void); 34 | // called every frame by screen 35 | 36 | void Sbar_IntermissionOverlay (void); 37 | // called each frame after the level has been completed 38 | 39 | void Sbar_FinaleOverlay (void); 40 | -------------------------------------------------------------------------------- /scitech/INCLUDE/MGLDOS.H: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | * 3 | * MegaGraph Graphics Library 4 | * 5 | * Copyright (C) 1996 SciTech Software. 6 | * All rights reserved. 7 | * 8 | * Filename: $Workfile: mgldos.h $ 9 | * Version: $Revision: 1.9 $ 10 | * 11 | * Language: ANSI C 12 | * Environment: IBM PC (MS DOS) 13 | * 14 | * Description: Header file for the MGLDOS binding for the MSDOS environment. 15 | * 16 | * $Date: 30 Jan 1997 17:31:58 $ $Author: KendallB $ 17 | * 18 | ****************************************************************************/ 19 | 20 | #ifndef __MGLDOS_H 21 | #define __MGLDOS_H 22 | 23 | #ifndef MGLDOS 24 | #define MGLDOS 25 | #endif 26 | 27 | /*---------------------- Macros and type definitions ----------------------*/ 28 | 29 | typedef void *MGL_HWND; 30 | 31 | /*------------------------- Function Prototypes ---------------------------*/ 32 | 33 | #ifdef __cplusplus 34 | extern "C" { /* Use "C" linkage when in C++ mode */ 35 | #endif 36 | 37 | /* Initialise the MGL for fullscreen output */ 38 | 39 | bool MGLAPI MGL_init(m_int *driver,m_int *mode,const char *mglpath); 40 | 41 | /* Change the active display mode. You must destroy all display device 42 | * contexts before calling this function, and re-create them again with 43 | * the new display mode. Does not affect any event handling hooks. 44 | */ 45 | 46 | bool MGLAPI MGL_changeDisplayMode(m_int mode); 47 | 48 | /* Disable/enable event handling (call before calling MGL_init */ 49 | 50 | void MGLAPI MGL_useEvents(bool use); 51 | 52 | /* Device context management */ 53 | 54 | MGLDC * MGLAPI MGL_createDisplayDC(m_int numBuffers); 55 | MGLDC * MGLAPI MGL_createScrollingDC(m_int virtualX,m_int virtualY,m_int numBuffers); 56 | MGLDC * MGLAPI MGL_createOffscreenDC(void); 57 | MGLDC * MGLAPI MGL_createLinearOffscreenDC(void); 58 | MGLDC * MGLAPI MGL_createMemoryDC(m_int xSize,m_int ySize,m_int bitsPerPixel,pixel_format_t *pf); 59 | bool MGLAPI MGL_destroyDC(MGLDC *dc); 60 | 61 | /* Generic helper functions */ 62 | 63 | ulong MGLAPI MGL_getTicks(void); 64 | ulong MGLAPI MGL_getTickResolution(void); 65 | void MGLAPI MGL_delay(m_int millseconds); 66 | void MGLAPI MGL_beep(m_int freq,m_int milliseconds); 67 | void MGLAPI MGL_suspend(void); 68 | void MGLAPI MGL_resume(void); 69 | 70 | /* Fullscreen specific routines */ 71 | 72 | void MGLAPI MGL_setPaletteSnowLevel(MGLDC *dc,m_int level); 73 | m_int MGLAPI MGL_getPaletteSnowLevel(MGLDC *dc); 74 | 75 | /* Determine if a specific scancode'ed key is held down (PC specific) */ 76 | 77 | bool MGLAPI EVT_isKeyDown(uchar scanCode); 78 | 79 | #ifdef __cplusplus 80 | } /* End of "C" linkage for C++ */ 81 | #endif 82 | 83 | #endif /* __MGLDOS_H */ 84 | -------------------------------------------------------------------------------- /scitech/LIB/WIN32/VC/MGLLT.LIB: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/scitech/LIB/WIN32/VC/MGLLT.LIB -------------------------------------------------------------------------------- /screen.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // screen.h 21 | 22 | void SCR_Init (void); 23 | 24 | void SCR_UpdateScreen (void); 25 | 26 | 27 | void SCR_SizeUp (void); 28 | void SCR_SizeDown (void); 29 | void SCR_BringDownConsole (void); 30 | void SCR_CenterPrint (char *str); 31 | 32 | void SCR_BeginLoadingPlaque (void); 33 | void SCR_EndLoadingPlaque (void); 34 | 35 | int SCR_ModalMessage (char *text); 36 | 37 | extern float scr_con_current; 38 | extern float scr_conlines; // lines of console to display 39 | 40 | extern int scr_fullupdate; // set to 0 to force full redraw 41 | extern int sb_lines; 42 | 43 | extern int clearnotify; // set to 0 whenever notify text is drawn 44 | extern qboolean scr_disabled_for_loading; 45 | extern qboolean scr_skipupdate; 46 | 47 | extern cvar_t scr_viewsize; 48 | 49 | extern cvar_t scr_viewsize; 50 | 51 | // only the refresh window will be updated unless these variables are flagged 52 | extern int scr_copytop; 53 | extern int scr_copyeverything; 54 | 55 | extern qboolean block_drawing; 56 | 57 | void SCR_UpdateWholeScreen (void); 58 | -------------------------------------------------------------------------------- /snd_next.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | 21 | #include "quakedef.h" 22 | 23 | extern int desired_speed; 24 | extern int desired_bits; 25 | 26 | qboolean SNDDMA_Init(void) 27 | { 28 | int size; 29 | 30 | size = 16384 + sizeof(dma_t); 31 | shm = malloc (size); 32 | memset((void*)shm, 0, size); 33 | 34 | shm->buffer = (char*)shm + sizeof(dma_t); 35 | shm->channels = 2; 36 | shm->speed = desired_speed; 37 | shm->samplebits = desired_bits; 38 | shm->samples = 16384 / (desired_bits / 8); 39 | shm->submission_chunk = 1; 40 | 41 | return true; 42 | } 43 | 44 | // return the current sample position (in mono samples read) 45 | // inside the recirculating dma buffer 46 | int SNDDMA_GetDMAPos(void) 47 | { 48 | shm->samplepos = (int)(realtime*shm->speed*shm->channels) & (shm->samples-1); 49 | 50 | return shm->samplepos; 51 | } 52 | 53 | void SNDDMA_Shutdown(void) 54 | { 55 | } 56 | -------------------------------------------------------------------------------- /snd_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // snd_null.c -- include this instead of all the other snd_* files to have 21 | // no sound code whatsoever 22 | 23 | #include "quakedef.h" 24 | 25 | cvar_t bgmvolume = {"bgmvolume", "1", true}; 26 | cvar_t volume = {"volume", "0.7", true}; 27 | 28 | 29 | void S_Init (void) 30 | { 31 | } 32 | 33 | void S_AmbientOff (void) 34 | { 35 | } 36 | 37 | void S_AmbientOn (void) 38 | { 39 | } 40 | 41 | void S_Shutdown (void) 42 | { 43 | } 44 | 45 | void S_TouchSound (char *sample) 46 | { 47 | } 48 | 49 | void S_ClearBuffer (void) 50 | { 51 | } 52 | 53 | void S_StaticSound (sfx_t *sfx, vec3_t origin, float vol, float attenuation) 54 | { 55 | } 56 | 57 | void S_StartSound (int entnum, int entchannel, sfx_t *sfx, vec3_t origin, float fvol, float attenuation) 58 | { 59 | } 60 | 61 | void S_StopSound (int entnum, int entchannel) 62 | { 63 | } 64 | 65 | sfx_t *S_PrecacheSound (char *sample) 66 | { 67 | return NULL; 68 | } 69 | 70 | void S_ClearPrecache (void) 71 | { 72 | } 73 | 74 | void S_Update (vec3_t origin, vec3_t v_forward, vec3_t v_right, vec3_t v_up) 75 | { 76 | } 77 | 78 | void S_StopAllSounds (qboolean clear) 79 | { 80 | } 81 | 82 | void S_BeginPrecaching (void) 83 | { 84 | } 85 | 86 | void S_EndPrecaching (void) 87 | { 88 | } 89 | 90 | void S_ExtraUpdate (void) 91 | { 92 | } 93 | 94 | void S_LocalSound (char *s) 95 | { 96 | } 97 | 98 | -------------------------------------------------------------------------------- /snd_sdl.c: -------------------------------------------------------------------------------- 1 | 2 | #include 3 | #include "SDL_audio.h" 4 | #include "SDL_byteorder.h" 5 | #include "quakedef.h" 6 | 7 | static dma_t the_shm; 8 | static int snd_inited; 9 | 10 | extern int desired_speed; 11 | extern int desired_bits; 12 | 13 | static void paint_audio(void *unused, Uint8 *stream, int len) 14 | { 15 | if ( shm ) { 16 | shm->buffer = stream; 17 | shm->samplepos += len/(shm->samplebits/8)/2; 18 | // Check for samplepos overflow? 19 | S_PaintChannels (shm->samplepos); 20 | } 21 | } 22 | 23 | qboolean SNDDMA_Init(void) 24 | { 25 | SDL_AudioSpec desired, obtained; 26 | 27 | snd_inited = 0; 28 | 29 | /* Set up the desired format */ 30 | desired.freq = desired_speed; 31 | switch (desired_bits) { 32 | case 8: 33 | desired.format = AUDIO_U8; 34 | break; 35 | case 16: 36 | if ( SDL_BYTEORDER == SDL_BIG_ENDIAN ) 37 | desired.format = AUDIO_S16MSB; 38 | else 39 | desired.format = AUDIO_S16LSB; 40 | break; 41 | default: 42 | Con_Printf("Unknown number of audio bits: %d\n", 43 | desired_bits); 44 | return 0; 45 | } 46 | desired.channels = 2; 47 | desired.samples = 512; 48 | desired.callback = paint_audio; 49 | 50 | /* Open the audio device */ 51 | if ( SDL_OpenAudio(&desired, &obtained) < 0 ) { 52 | Con_Printf("Couldn't open SDL audio: %s\n", SDL_GetError()); 53 | return 0; 54 | } 55 | 56 | /* Make sure we can support the audio format */ 57 | switch (obtained.format) { 58 | case AUDIO_U8: 59 | /* Supported */ 60 | break; 61 | case AUDIO_S16LSB: 62 | case AUDIO_S16MSB: 63 | if ( ((obtained.format == AUDIO_S16LSB) && 64 | (SDL_BYTEORDER == SDL_LIL_ENDIAN)) || 65 | ((obtained.format == AUDIO_S16MSB) && 66 | (SDL_BYTEORDER == SDL_BIG_ENDIAN)) ) { 67 | /* Supported */ 68 | break; 69 | } 70 | /* Unsupported, fall through */; 71 | default: 72 | /* Not supported -- force SDL to do our bidding */ 73 | SDL_CloseAudio(); 74 | if ( SDL_OpenAudio(&desired, NULL) < 0 ) { 75 | Con_Printf("Couldn't open SDL audio: %s\n", 76 | SDL_GetError()); 77 | return 0; 78 | } 79 | memcpy(&obtained, &desired, sizeof(desired)); 80 | break; 81 | } 82 | SDL_PauseAudio(0); 83 | 84 | /* Fill the audio DMA information block */ 85 | shm = &the_shm; 86 | shm->splitbuffer = 0; 87 | shm->samplebits = (obtained.format & 0xFF); 88 | shm->speed = obtained.freq; 89 | shm->channels = obtained.channels; 90 | shm->samples = obtained.samples*shm->channels; 91 | shm->samplepos = 0; 92 | shm->submission_chunk = 1; 93 | shm->buffer = NULL; 94 | 95 | snd_inited = 1; 96 | return 1; 97 | } 98 | 99 | int SNDDMA_GetDMAPos(void) 100 | { 101 | return shm->samplepos; 102 | } 103 | 104 | void SNDDMA_Shutdown(void) 105 | { 106 | if (snd_inited) 107 | { 108 | SDL_CloseAudio(); 109 | snd_inited = 0; 110 | } 111 | } 112 | 113 | -------------------------------------------------------------------------------- /spritegn.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // spritegn.h: header file for sprite generation program 22 | // 23 | 24 | // ********************************************************** 25 | // * This file must be identical in the spritegen directory * 26 | // * and in the Quake directory, because it's used to * 27 | // * pass data from one to the other via .spr files. * 28 | // ********************************************************** 29 | 30 | //------------------------------------------------------- 31 | // This program generates .spr sprite package files. 32 | // The format of the files is as follows: 33 | // 34 | // dsprite_t file header structure 35 | // 36 | // 37 | // dspriteframe_t frame header structure 38 | // sprite bitmap 39 | // 40 | // dspriteframe_t frame header structure 41 | // sprite bitmap 42 | // 43 | //------------------------------------------------------- 44 | 45 | #ifdef INCLUDELIBS 46 | 47 | #include 48 | #include 49 | #include 50 | #include 51 | 52 | #include "cmdlib.h" 53 | #include "scriplib.h" 54 | #include "dictlib.h" 55 | #include "trilib.h" 56 | #include "lbmlib.h" 57 | #include "mathlib.h" 58 | 59 | #endif 60 | 61 | #define SPRITE_VERSION 1 62 | 63 | // must match definition in modelgen.h 64 | #ifndef SYNCTYPE_T 65 | #define SYNCTYPE_T 66 | typedef enum {ST_SYNC=0, ST_RAND } synctype_t; 67 | #endif 68 | 69 | // TODO: shorten these? 70 | typedef struct { 71 | int ident; 72 | int version; 73 | int type; 74 | float boundingradius; 75 | int width; 76 | int height; 77 | int numframes; 78 | float beamlength; 79 | synctype_t synctype; 80 | } dsprite_t; 81 | 82 | #define SPR_VP_PARALLEL_UPRIGHT 0 83 | #define SPR_FACING_UPRIGHT 1 84 | #define SPR_VP_PARALLEL 2 85 | #define SPR_ORIENTED 3 86 | #define SPR_VP_PARALLEL_ORIENTED 4 87 | 88 | typedef struct { 89 | int origin[2]; 90 | int width; 91 | int height; 92 | } dspriteframe_t; 93 | 94 | typedef struct { 95 | int numframes; 96 | } dspritegroup_t; 97 | 98 | typedef struct { 99 | float interval; 100 | } dspriteinterval_t; 101 | 102 | typedef enum { SPR_SINGLE=0, SPR_GROUP } spriteframetype_t; 103 | 104 | typedef struct { 105 | spriteframetype_t type; 106 | } dspriteframetype_t; 107 | 108 | #define IDSPRITEHEADER (('P'<<24)+('S'<<16)+('D'<<8)+'I') 109 | // little-endian "IDSP" 110 | 111 | -------------------------------------------------------------------------------- /sys.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // sys.h -- non-portable functions 21 | 22 | // 23 | // file IO 24 | // 25 | 26 | // returns the file size 27 | // return -1 if file is not present 28 | // the file should be in BINARY mode for stupid OSs that care 29 | int Sys_FileOpenRead (char *path, int *hndl); 30 | 31 | int Sys_FileOpenWrite (char *path); 32 | void Sys_FileClose (int handle); 33 | void Sys_FileSeek (int handle, int position); 34 | int Sys_FileRead (int handle, void *dest, int count); 35 | int Sys_FileWrite (int handle, void *data, int count); 36 | int Sys_FileTime (char *path); 37 | void Sys_mkdir (char *path); 38 | 39 | // 40 | // memory protection 41 | // 42 | void Sys_MakeCodeWriteable (unsigned long startaddr, unsigned long length); 43 | 44 | // 45 | // system IO 46 | // 47 | void Sys_DebugLog(char *file, char *fmt, ...); 48 | 49 | void Sys_Error (char *error, ...); 50 | // an error will cause the entire program to exit 51 | 52 | void Sys_Printf (char *fmt, ...); 53 | // send text to the console 54 | 55 | void Sys_Quit (void); 56 | 57 | double Sys_FloatTime (void); 58 | 59 | char *Sys_ConsoleInput (void); 60 | 61 | void Sys_Sleep (void); 62 | // called to yield for a little bit so as 63 | // not to hog cpu when paused or debugging 64 | 65 | void Sys_SendKeyEvents (void); 66 | // Perform Key_Event () callbacks until the input que is empty 67 | 68 | void Sys_LowFPPrecision (void); 69 | void Sys_HighFPPrecision (void); 70 | void Sys_SetFPCW (void); 71 | 72 | -------------------------------------------------------------------------------- /sys_dosa.S: -------------------------------------------------------------------------------- 1 | // 2 | // sys_dosa.s 3 | // x86 assembly-language DOS-dependent routines. 4 | 5 | #include "asm_i386.h" 6 | #include "quakeasm.h" 7 | 8 | 9 | #if id386 10 | 11 | .data 12 | 13 | .align 4 14 | fpenv: 15 | .long 0, 0, 0, 0, 0, 0, 0, 0 16 | 17 | .text 18 | 19 | .globl C(MaskExceptions) 20 | C(MaskExceptions): 21 | fnstenv fpenv 22 | orl $0x3F,fpenv 23 | fldenv fpenv 24 | 25 | ret 26 | 27 | #if 0 28 | .globl C(unmaskexceptions) 29 | C(unmaskexceptions): 30 | fnstenv fpenv 31 | andl $0xFFFFFFE0,fpenv 32 | fldenv fpenv 33 | 34 | ret 35 | #endif 36 | 37 | .data 38 | 39 | .align 4 40 | .globl ceil_cw, single_cw, full_cw, cw, pushed_cw 41 | ceil_cw: .long 0 42 | single_cw: .long 0 43 | full_cw: .long 0 44 | cw: .long 0 45 | pushed_cw: .long 0 46 | 47 | .text 48 | 49 | .globl C(Sys_LowFPPrecision) 50 | C(Sys_LowFPPrecision): 51 | fldcw single_cw 52 | 53 | ret 54 | 55 | .globl C(Sys_HighFPPrecision) 56 | C(Sys_HighFPPrecision): 57 | fldcw full_cw 58 | 59 | ret 60 | 61 | .globl C(Sys_PushFPCW_SetHigh) 62 | C(Sys_PushFPCW_SetHigh): 63 | fnstcw pushed_cw 64 | fldcw full_cw 65 | 66 | ret 67 | 68 | .globl C(Sys_PopFPCW) 69 | C(Sys_PopFPCW): 70 | fldcw pushed_cw 71 | 72 | ret 73 | 74 | .globl C(Sys_SetFPCW) 75 | C(Sys_SetFPCW): 76 | fnstcw cw 77 | movl cw,%eax 78 | #if id386 79 | andb $0xF0,%ah 80 | orb $0x03,%ah // round mode, 64-bit precision 81 | #endif 82 | movl %eax,full_cw 83 | 84 | #if id386 85 | andb $0xF0,%ah 86 | orb $0x0C,%ah // chop mode, single precision 87 | #endif 88 | movl %eax,single_cw 89 | 90 | #if id386 91 | andb $0xF0,%ah 92 | orb $0x08,%ah // ceil mode, single precision 93 | #endif 94 | movl %eax,ceil_cw 95 | 96 | ret 97 | 98 | #endif 99 | -------------------------------------------------------------------------------- /sys_wina.S: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // sys_wina.s 22 | // x86 assembly-language Win-dependent routines. 23 | 24 | #define GLQUAKE 1 // don't include unneeded defs 25 | #include "asm_i386.h" 26 | #include "quakeasm.h" 27 | 28 | // LATER should be id386-dependent, and have an equivalent C path 29 | 30 | .data 31 | 32 | .align 4 33 | fpenv: 34 | .long 0, 0, 0, 0, 0, 0, 0, 0 35 | 36 | .text 37 | 38 | .globl C(MaskExceptions) 39 | C(MaskExceptions): 40 | fnstenv fpenv 41 | orl $0x3F,fpenv 42 | fldenv fpenv 43 | 44 | ret 45 | 46 | #if 0 47 | .globl C(unmaskexceptions) 48 | C(unmaskexceptions): 49 | fnstenv fpenv 50 | andl $0xFFFFFFE0,fpenv 51 | fldenv fpenv 52 | 53 | ret 54 | #endif 55 | 56 | .data 57 | 58 | .align 4 59 | .globl ceil_cw, single_cw, full_cw, cw, pushed_cw 60 | ceil_cw: .long 0 61 | single_cw: .long 0 62 | full_cw: .long 0 63 | cw: .long 0 64 | pushed_cw: .long 0 65 | 66 | .text 67 | 68 | .globl C(Sys_LowFPPrecision) 69 | C(Sys_LowFPPrecision): 70 | fldcw single_cw 71 | 72 | ret 73 | 74 | .globl C(Sys_HighFPPrecision) 75 | C(Sys_HighFPPrecision): 76 | fldcw full_cw 77 | 78 | ret 79 | 80 | .globl C(Sys_PushFPCW_SetHigh) 81 | C(Sys_PushFPCW_SetHigh): 82 | fnstcw pushed_cw 83 | fldcw full_cw 84 | 85 | ret 86 | 87 | .globl C(Sys_PopFPCW) 88 | C(Sys_PopFPCW): 89 | fldcw pushed_cw 90 | 91 | ret 92 | 93 | .globl C(Sys_SetFPCW) 94 | C(Sys_SetFPCW): 95 | fnstcw cw 96 | movl cw,%eax 97 | #if id386 98 | andb $0xF0,%ah 99 | orb $0x03,%ah // round mode, 64-bit precision 100 | #endif 101 | movl %eax,full_cw 102 | 103 | #if id386 104 | andb $0xF0,%ah 105 | orb $0x0C,%ah // chop mode, single precision 106 | #endif 107 | movl %eax,single_cw 108 | 109 | #if id386 110 | andb $0xF0,%ah 111 | orb $0x08,%ah // ceil mode, single precision 112 | #endif 113 | movl %eax,ceil_cw 114 | 115 | ret 116 | 117 | -------------------------------------------------------------------------------- /vid.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // vid.h -- video driver defs 21 | 22 | #define VID_CBITS 6 23 | #define VID_GRADES (1 << VID_CBITS) 24 | 25 | // a pixel can be one, two, or four bytes 26 | typedef byte pixel_t; 27 | 28 | typedef struct vrect_s 29 | { 30 | int x,y,width,height; 31 | struct vrect_s *pnext; 32 | } vrect_t; 33 | 34 | typedef struct 35 | { 36 | pixel_t *buffer; // invisible buffer 37 | pixel_t *colormap; // 256 * VID_GRADES size 38 | unsigned short *colormap16; // 256 * VID_GRADES size 39 | int fullbright; // index of first fullbright color 40 | unsigned rowbytes; // may be > width if displayed in a window 41 | unsigned width; 42 | unsigned height; 43 | float aspect; // width / height -- < 0 is taller than wide 44 | int numpages; 45 | int recalc_refdef; // if true, recalc vid-based stuff 46 | pixel_t *conbuffer; 47 | int conrowbytes; 48 | unsigned conwidth; 49 | unsigned conheight; 50 | int maxwarpwidth; 51 | int maxwarpheight; 52 | pixel_t *direct; // direct drawing to framebuffer, if not 53 | // NULL 54 | } viddef_t; 55 | 56 | extern viddef_t vid; // global video state 57 | extern unsigned short d_8to16table[256]; 58 | extern unsigned d_8to24table[256]; 59 | extern void (*vid_menudrawfn)(void); 60 | extern void (*vid_menukeyfn)(int key); 61 | 62 | void VID_SetPalette (unsigned char *palette); 63 | // called at startup and after any gamma correction 64 | 65 | void VID_ShiftPalette (unsigned char *palette); 66 | // called for bonus and pain flashes, and for underwater color changes 67 | 68 | void VID_Init (unsigned char *palette); 69 | // Called at startup to set up translation tables, takes 256 8 bit RGB values 70 | // the palette data will go away after the call, so it must be copied off if 71 | // the video driver will need it again 72 | 73 | void VID_Shutdown (void); 74 | // Called at shutdown 75 | 76 | void VID_Update (vrect_t *rects); 77 | // flushes the given rectangles from the view buffer to the screen 78 | 79 | int VID_SetMode (int modenum, unsigned char *palette); 80 | // sets the mode; only used by the Quake engine for resetting to mode 0 (the 81 | // base mode) on memory allocation failures 82 | 83 | void VID_HandlePause (qboolean pause); 84 | // called only on Win32, when pause happens, so the mouse can be released 85 | 86 | -------------------------------------------------------------------------------- /vid_dos.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // vid_dos.h: header file for DOS-specific video stuff 21 | 22 | typedef struct vmode_s { 23 | struct vmode_s *pnext; 24 | char *name; 25 | char *header; 26 | unsigned width; 27 | unsigned height; 28 | float aspect; 29 | unsigned rowbytes; 30 | int planar; 31 | int numpages; 32 | void *pextradata; 33 | int (*setmode)(viddef_t *vid, struct vmode_s *pcurrentmode); 34 | void (*swapbuffers)(viddef_t *vid, struct vmode_s *pcurrentmode, 35 | vrect_t *rects); 36 | void (*setpalette)(viddef_t *vid, struct vmode_s *pcurrentmode, 37 | unsigned char *palette); 38 | void (*begindirectrect)(viddef_t *vid, struct vmode_s *pcurrentmode, 39 | int x, int y, byte *pbitmap, int width, 40 | int height); 41 | void (*enddirectrect)(viddef_t *vid, struct vmode_s *pcurrentmode, 42 | int x, int y, int width, int height); 43 | } vmode_t; 44 | 45 | // vid_wait settings 46 | #define VID_WAIT_NONE 0 47 | #define VID_WAIT_VSYNC 1 48 | #define VID_WAIT_DISPLAY_ENABLE 2 49 | 50 | extern int numvidmodes; 51 | extern vmode_t *pvidmodes; 52 | 53 | extern int VGA_width, VGA_height, VGA_rowbytes, VGA_bufferrowbytes; 54 | extern byte *VGA_pagebase; 55 | extern vmode_t *VGA_pcurmode; 56 | 57 | extern cvar_t vid_wait; 58 | extern cvar_t vid_nopageflip; 59 | extern cvar_t _vid_wait_override; 60 | 61 | extern unsigned char colormap256[32][256]; 62 | 63 | extern void *vid_surfcache; 64 | extern int vid_surfcachesize; 65 | 66 | void VGA_Init (void); 67 | void VID_InitVESA (void); 68 | void VID_InitExtra (void); 69 | void VGA_WaitVsync (void); 70 | void VGA_ClearVideoMem (int planar); 71 | void VGA_SetPalette(viddef_t *vid, vmode_t *pcurrentmode, unsigned char *pal); 72 | void VGA_SwapBuffersCopy (viddef_t *vid, vmode_t *pcurrentmode, 73 | vrect_t *rects); 74 | qboolean VGA_FreeAndAllocVidbuffer (viddef_t *vid, int allocnewbuffer); 75 | qboolean VGA_CheckAdequateMem (int width, int height, int rowbytes, 76 | int allocnewbuffer); 77 | void VGA_BeginDirectRect (viddef_t *vid, struct vmode_s *pcurrentmode, int x, 78 | int y, byte *pbitmap, int width, int height); 79 | void VGA_EndDirectRect (viddef_t *vid, struct vmode_s *pcurrentmode, int x, 80 | int y, int width, int height); 81 | void VGA_UpdateLinearScreen (void *srcptr, void *destptr, int width, 82 | int height, int srcrowbytes, int destrowbytes); 83 | 84 | -------------------------------------------------------------------------------- /vid_null.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // vid_null.c -- null video driver to aid porting efforts 21 | 22 | #include "quakedef.h" 23 | #include "d_local.h" 24 | 25 | viddef_t vid; // global video state 26 | 27 | #define BASEWIDTH 320 28 | #define BASEHEIGHT 200 29 | 30 | byte vid_buffer[BASEWIDTH*BASEHEIGHT]; 31 | short zbuffer[BASEWIDTH*BASEHEIGHT]; 32 | byte surfcache[256*1024]; 33 | 34 | unsigned short d_8to16table[256]; 35 | unsigned d_8to24table[256]; 36 | 37 | void VID_SetPalette (unsigned char *palette) 38 | { 39 | } 40 | 41 | void VID_ShiftPalette (unsigned char *palette) 42 | { 43 | } 44 | 45 | void VID_Init (unsigned char *palette) 46 | { 47 | vid.maxwarpwidth = vid.width = vid.conwidth = BASEWIDTH; 48 | vid.maxwarpheight = vid.height = vid.conheight = BASEHEIGHT; 49 | vid.aspect = 1.0; 50 | vid.numpages = 1; 51 | vid.colormap = host_colormap; 52 | vid.fullbright = 256 - LittleLong (*((int *)vid.colormap + 2048)); 53 | vid.buffer = vid.conbuffer = vid_buffer; 54 | vid.rowbytes = vid.conrowbytes = BASEWIDTH; 55 | 56 | d_pzbuffer = zbuffer; 57 | D_InitCaches (surfcache, sizeof(surfcache)); 58 | } 59 | 60 | void VID_Shutdown (void) 61 | { 62 | } 63 | 64 | void VID_Update (vrect_t *rects) 65 | { 66 | } 67 | 68 | /* 69 | ================ 70 | D_BeginDirectRect 71 | ================ 72 | */ 73 | void D_BeginDirectRect (int x, int y, byte *pbitmap, int width, int height) 74 | { 75 | } 76 | 77 | 78 | /* 79 | ================ 80 | D_EndDirectRect 81 | ================ 82 | */ 83 | void D_EndDirectRect (int x, int y, int width, int height) 84 | { 85 | } 86 | 87 | 88 | -------------------------------------------------------------------------------- /view.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // view.h 21 | 22 | extern cvar_t v_gamma; 23 | 24 | extern byte gammatable[256]; // palette is sent through this 25 | extern byte ramps[3][256]; 26 | extern float v_blend[4]; 27 | 28 | extern cvar_t lcd_x; 29 | 30 | 31 | void V_Init (void); 32 | void V_RenderView (void); 33 | float V_CalcRoll (vec3_t angles, vec3_t velocity); 34 | void V_UpdatePalette (void); 35 | 36 | -------------------------------------------------------------------------------- /vregset.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // vregset.c: video register-setting interpreter 22 | // 23 | 24 | #include 25 | #include 26 | 27 | #include "quakedef.h" 28 | #include "vregset.h" 29 | 30 | //#define outportb loutportb 31 | 32 | void loutportb (int port, int val) 33 | { 34 | printf ("port, val: %x %x\n", port, val); 35 | getch (); 36 | } 37 | 38 | /* 39 | ================ 40 | VideoRegisterSet 41 | ================ 42 | */ 43 | void VideoRegisterSet (int *pregset) 44 | { 45 | int port, temp0, temp1, temp2; 46 | 47 | for ( ;; ) 48 | { 49 | switch (*pregset++) 50 | { 51 | case VRS_END: 52 | return; 53 | 54 | case VRS_BYTE_OUT: 55 | port = *pregset++; 56 | outportb (port, *pregset++); 57 | break; 58 | 59 | case VRS_BYTE_RMW: 60 | port = *pregset++; 61 | temp0 = *pregset++; 62 | temp1 = *pregset++; 63 | temp2 = inportb (port); 64 | temp2 &= temp0; 65 | temp2 |= temp1; 66 | outportb (port, temp2); 67 | break; 68 | 69 | case VRS_WORD_OUT: 70 | port = *pregset++; 71 | outportb (port, *pregset & 0xFF); 72 | outportb (port+1, *pregset >> 8); 73 | pregset++; 74 | break; 75 | 76 | default: 77 | Sys_Error ("VideoRegisterSet: Invalid command\n"); 78 | } 79 | } 80 | } 81 | 82 | -------------------------------------------------------------------------------- /vregset.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // vregset.h: header file for video register-setting interpreter 22 | // 23 | 24 | // 25 | // registers & subregisters 26 | // 27 | #define MISC_OUTPUT 0x3C2 28 | 29 | #define SC_INDEX 0x3C4 30 | #define SC_DATA 0x3C5 31 | #define SYNC_RESET 0 32 | #define MAP_MASK 2 33 | #define MEMORY_MODE 4 34 | 35 | #define GC_INDEX 0x3CE 36 | #define GC_DATA 0x3CF 37 | #define READ_MAP 4 38 | #define GRAPHICS_MODE 5 39 | #define MISCELLANOUS 6 40 | 41 | #define CRTC_INDEX 0x3D4 42 | #define CRTC_DATA 0x3D5 43 | #define MAX_SCAN_LINE 9 44 | #define UNDERLINE 0x14 45 | #define MODE_CONTROL 0x17 46 | 47 | // 48 | // register-set commands 49 | // 50 | #define VRS_END 0 51 | #define VRS_BYTE_OUT 1 52 | #define VRS_BYTE_RMW 2 53 | #define VRS_WORD_OUT 3 54 | 55 | void VideoRegisterSet (int *pregset); 56 | 57 | -------------------------------------------------------------------------------- /wad.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // wad.h 21 | 22 | //=============== 23 | // TYPES 24 | //=============== 25 | 26 | #define CMP_NONE 0 27 | #define CMP_LZSS 1 28 | 29 | #define TYP_NONE 0 30 | #define TYP_LABEL 1 31 | 32 | #define TYP_LUMPY 64 // 64 + grab command number 33 | #define TYP_PALETTE 64 34 | #define TYP_QTEX 65 35 | #define TYP_QPIC 66 36 | #define TYP_SOUND 67 37 | #define TYP_MIPTEX 68 38 | 39 | typedef struct 40 | { 41 | int width, height; 42 | byte data[4]; // variably sized 43 | } qpic_t; 44 | 45 | 46 | 47 | typedef struct 48 | { 49 | char identification[4]; // should be WAD2 or 2DAW 50 | int numlumps; 51 | int infotableofs; 52 | } wadinfo_t; 53 | 54 | typedef struct 55 | { 56 | int filepos; 57 | int disksize; 58 | int size; // uncompressed 59 | char type; 60 | char compression; 61 | char pad1, pad2; 62 | char name[16]; // must be null terminated 63 | } lumpinfo_t; 64 | 65 | extern int wad_numlumps; 66 | extern lumpinfo_t *wad_lumps; 67 | extern byte *wad_base; 68 | 69 | void W_LoadWadFile (char *filename); 70 | void W_CleanupName (char *in, char *out); 71 | lumpinfo_t *W_GetLumpinfo (char *name); 72 | void *W_GetLumpName (char *name); 73 | void *W_GetLumpNum (int num); 74 | 75 | void SwapPic (qpic_t *pic); 76 | -------------------------------------------------------------------------------- /winquake.aps: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/winquake.aps -------------------------------------------------------------------------------- /winquake.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // winquake.h: Win32-specific Quake header file 21 | 22 | #pragma warning( disable : 4229 ) // mgraph gets this 23 | 24 | #include 25 | #define WM_MOUSEWHEEL 0x020A 26 | 27 | #ifndef SERVERONLY 28 | #include 29 | #include 30 | #ifndef GLQUAKE 31 | #include 32 | #endif 33 | #endif 34 | 35 | extern HINSTANCE global_hInstance; 36 | extern int global_nCmdShow; 37 | 38 | #ifndef SERVERONLY 39 | 40 | extern LPDIRECTDRAW lpDD; 41 | extern qboolean DDActive; 42 | extern LPDIRECTDRAWSURFACE lpPrimary; 43 | extern LPDIRECTDRAWSURFACE lpFrontBuffer; 44 | extern LPDIRECTDRAWSURFACE lpBackBuffer; 45 | extern LPDIRECTDRAWPALETTE lpDDPal; 46 | extern LPDIRECTSOUND pDS; 47 | extern LPDIRECTSOUNDBUFFER pDSBuf; 48 | 49 | extern DWORD gSndBufSize; 50 | //#define SNDBUFSIZE 65536 51 | 52 | void VID_LockBuffer (void); 53 | void VID_UnlockBuffer (void); 54 | 55 | #endif 56 | 57 | typedef enum {MS_WINDOWED, MS_FULLSCREEN, MS_FULLDIB, MS_UNINIT} modestate_t; 58 | 59 | extern modestate_t modestate; 60 | 61 | extern HWND mainwindow; 62 | extern qboolean ActiveApp, Minimized; 63 | 64 | extern qboolean WinNT; 65 | 66 | int VID_ForceUnlockedAndReturnState (void); 67 | void VID_ForceLockState (int lk); 68 | 69 | void IN_ShowMouse (void); 70 | void IN_DeactivateMouse (void); 71 | void IN_HideMouse (void); 72 | void IN_ActivateMouse (void); 73 | void IN_RestoreOriginalMouseState (void); 74 | void IN_SetQuakeMouseState (void); 75 | void IN_MouseEvent (int mstate); 76 | 77 | extern qboolean winsock_lib_initialized; 78 | 79 | extern cvar_t _windowed_mouse; 80 | 81 | extern int window_center_x, window_center_y; 82 | extern RECT window_rect; 83 | 84 | extern qboolean mouseinitialized; 85 | extern HWND hwnd_dialog; 86 | 87 | extern HANDLE hinput, houtput; 88 | 89 | void IN_UpdateClipCursor (void); 90 | void CenterWindow(HWND hWndCenter, int width, int height, BOOL lefttopjustify); 91 | 92 | void S_BlockSound (void); 93 | void S_UnblockSound (void); 94 | 95 | void VID_SetDefaultMode (void); 96 | 97 | int (PASCAL FAR *pWSAStartup)(WORD wVersionRequired, LPWSADATA lpWSAData); 98 | int (PASCAL FAR *pWSACleanup)(void); 99 | int (PASCAL FAR *pWSAGetLastError)(void); 100 | SOCKET (PASCAL FAR *psocket)(int af, int type, int protocol); 101 | int (PASCAL FAR *pioctlsocket)(SOCKET s, long cmd, u_long FAR *argp); 102 | int (PASCAL FAR *psetsockopt)(SOCKET s, int level, int optname, 103 | const char FAR * optval, int optlen); 104 | int (PASCAL FAR *precvfrom)(SOCKET s, char FAR * buf, int len, int flags, 105 | struct sockaddr FAR *from, int FAR * fromlen); 106 | int (PASCAL FAR *psendto)(SOCKET s, const char FAR * buf, int len, int flags, 107 | const struct sockaddr FAR *to, int tolen); 108 | int (PASCAL FAR *pclosesocket)(SOCKET s); 109 | int (PASCAL FAR *pgethostname)(char FAR * name, int namelen); 110 | struct hostent FAR * (PASCAL FAR *pgethostbyname)(const char FAR * name); 111 | struct hostent FAR * (PASCAL FAR *pgethostbyaddr)(const char FAR * addr, 112 | int len, int type); 113 | int (PASCAL FAR *pgetsockname)(SOCKET s, struct sockaddr FAR *name, 114 | int FAR * namelen); 115 | -------------------------------------------------------------------------------- /winquake.rc: -------------------------------------------------------------------------------- 1 | //Microsoft Developer Studio generated resource script. 2 | // 3 | #include "resource.h" 4 | 5 | #define APSTUDIO_READONLY_SYMBOLS 6 | ///////////////////////////////////////////////////////////////////////////// 7 | // 8 | // Generated from the TEXTINCLUDE 2 resource. 9 | // 10 | #include "afxres.h" 11 | 12 | ///////////////////////////////////////////////////////////////////////////// 13 | #undef APSTUDIO_READONLY_SYMBOLS 14 | 15 | ///////////////////////////////////////////////////////////////////////////// 16 | // English (U.S.) resources 17 | 18 | #if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU) 19 | #ifdef _WIN32 20 | LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US 21 | #pragma code_page(1252) 22 | #endif //_WIN32 23 | 24 | #ifdef APSTUDIO_INVOKED 25 | ///////////////////////////////////////////////////////////////////////////// 26 | // 27 | // TEXTINCLUDE 28 | // 29 | 30 | 1 TEXTINCLUDE DISCARDABLE 31 | BEGIN 32 | "resource.h\0" 33 | END 34 | 35 | 2 TEXTINCLUDE DISCARDABLE 36 | BEGIN 37 | "#include ""afxres.h""\r\n" 38 | "\0" 39 | END 40 | 41 | 3 TEXTINCLUDE DISCARDABLE 42 | BEGIN 43 | "\r\n" 44 | "\0" 45 | END 46 | 47 | #endif // APSTUDIO_INVOKED 48 | 49 | 50 | ///////////////////////////////////////////////////////////////////////////// 51 | // 52 | // Icon 53 | // 54 | 55 | // Icon with lowest ID value placed first to ensure application icon 56 | // remains consistent on all systems. 57 | IDI_ICON2 ICON DISCARDABLE "quake.ico" 58 | 59 | ///////////////////////////////////////////////////////////////////////////// 60 | // 61 | // Dialog 62 | // 63 | 64 | IDD_DIALOG1 DIALOGEX 0, 0, 62, 21 65 | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP 66 | EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE 67 | FONT 16, "Times New Roman", 0, 0, 0x1 68 | BEGIN 69 | CTEXT "Starting Quake...",IDC_STATIC,4,6,54,8 70 | END 71 | 72 | IDD_PROGRESS DIALOGEX 0, 0, 333, 45 73 | STYLE DS_MODALFRAME | DS_SETFOREGROUND | DS_3DLOOK | DS_CENTER | WS_POPUP | 74 | WS_VISIBLE 75 | EXSTYLE WS_EX_TOOLWINDOW | WS_EX_CLIENTEDGE 76 | FONT 8, "MS Sans Serif" 77 | BEGIN 78 | LTEXT "Creating 15 bit inverse palette. This is only done once, so just be patient for the next 30-60 seconds.", 79 | IDC_STATIC,7,19,319,10 80 | CONTROL "Progress1",IDC_PROGRESS,"msctls_progress32",0x0,7,29, 81 | 319,11 82 | LTEXT "Starting Quake...",IDC_STATIC,7,4,54,8 83 | END 84 | 85 | 86 | ///////////////////////////////////////////////////////////////////////////// 87 | // 88 | // DESIGNINFO 89 | // 90 | 91 | #ifdef APSTUDIO_INVOKED 92 | GUIDELINES DESIGNINFO DISCARDABLE 93 | BEGIN 94 | IDD_DIALOG1, DIALOG 95 | BEGIN 96 | LEFTMARGIN, 4 97 | RIGHTMARGIN, 58 98 | TOPMARGIN, 6 99 | BOTTOMMARGIN, 16 100 | HORZGUIDE, 6 101 | HORZGUIDE, 16 102 | END 103 | END 104 | #endif // APSTUDIO_INVOKED 105 | 106 | 107 | ///////////////////////////////////////////////////////////////////////////// 108 | // 109 | // String Table 110 | // 111 | 112 | STRINGTABLE DISCARDABLE 113 | BEGIN 114 | IDS_STRING1 "WinQuake" 115 | END 116 | 117 | #endif // English (U.S.) resources 118 | ///////////////////////////////////////////////////////////////////////////// 119 | 120 | 121 | 122 | #ifndef APSTUDIO_INVOKED 123 | ///////////////////////////////////////////////////////////////////////////// 124 | // 125 | // Generated from the TEXTINCLUDE 3 resource. 126 | // 127 | 128 | 129 | ///////////////////////////////////////////////////////////////////////////// 130 | #endif // not APSTUDIO_INVOKED 131 | 132 | -------------------------------------------------------------------------------- /world.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // world.h 21 | 22 | typedef struct 23 | { 24 | vec3_t normal; 25 | float dist; 26 | } plane_t; 27 | 28 | typedef struct 29 | { 30 | qboolean allsolid; // if true, plane is not valid 31 | qboolean startsolid; // if true, the initial point was in a solid area 32 | qboolean inopen, inwater; 33 | float fraction; // time completed, 1.0 = didn't hit anything 34 | vec3_t endpos; // final position 35 | plane_t plane; // surface normal at impact 36 | edict_t *ent; // entity the surface is on 37 | } trace_t; 38 | 39 | 40 | #define MOVE_NORMAL 0 41 | #define MOVE_NOMONSTERS 1 42 | #define MOVE_MISSILE 2 43 | 44 | 45 | void SV_ClearWorld (void); 46 | // called after the world model has been loaded, before linking any entities 47 | 48 | void SV_UnlinkEdict (edict_t *ent); 49 | // call before removing an entity, and before trying to move one, 50 | // so it doesn't clip against itself 51 | // flags ent->v.modified 52 | 53 | void SV_LinkEdict (edict_t *ent, qboolean touch_triggers); 54 | // Needs to be called any time an entity changes origin, mins, maxs, or solid 55 | // flags ent->v.modified 56 | // sets ent->v.absmin and ent->v.absmax 57 | // if touchtriggers, calls prog functions for the intersected triggers 58 | 59 | int SV_PointContents (vec3_t p); 60 | int SV_TruePointContents (vec3_t p); 61 | // returns the CONTENTS_* value from the world at the given point. 62 | // does not check any entities at all 63 | // the non-true version remaps the water current contents to content_water 64 | 65 | edict_t *SV_TestEntityPosition (edict_t *ent); 66 | 67 | trace_t SV_Move (vec3_t start, vec3_t mins, vec3_t maxs, vec3_t end, int type, edict_t *passedict); 68 | // mins and maxs are reletive 69 | 70 | // if the entire move stays in a solid volume, trace.allsolid will be set 71 | 72 | // if the starting point is in a solid, it will be allowed to move out 73 | // to an open area 74 | 75 | // nomonsters is used for line of sight or edge testing, where mosnters 76 | // shouldn't be considered solid objects 77 | 78 | // passedict is explicitly excluded from clipping checks (normally NULL) 79 | -------------------------------------------------------------------------------- /worlda.S: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | // 21 | // worlda.s 22 | // x86 assembly-language server testing stuff 23 | // 24 | 25 | #define GLQUAKE 1 // don't include unneeded defs 26 | #include "asm_i386.h" 27 | #include "quakeasm.h" 28 | #include "d_ifacea.h" 29 | 30 | #if id386 31 | 32 | .data 33 | 34 | Ltemp: .long 0 35 | 36 | .text 37 | 38 | //---------------------------------------------------------------------- 39 | // hull-point test 40 | //---------------------------------------------------------------------- 41 | 42 | #define hull 4+8 // because only partially pushed 43 | #define num 8+4 // because only partially pushed 44 | #define p 12+12 // because only partially pushed 45 | 46 | .align 4 47 | .globl C(SV_HullPointContents) 48 | C(SV_HullPointContents): 49 | pushl %edi // preserve register variables 50 | movl num(%esp),%eax 51 | testl %eax,%eax 52 | js Lhquickout 53 | 54 | // float d; 55 | // dclipnode_t *node; 56 | // mplane_t *plane; 57 | 58 | pushl %ebx 59 | movl hull(%esp),%ebx 60 | 61 | pushl %ebp 62 | movl p(%esp),%edx 63 | 64 | movl hu_clipnodes(%ebx),%edi 65 | movl hu_planes(%ebx),%ebp 66 | 67 | subl %ebx,%ebx 68 | pushl %esi 69 | 70 | // %ebx: 0 71 | // %eax: num 72 | // %edx: p 73 | // %edi: hull->clipnodes 74 | // %ebp: hull->planes 75 | 76 | // while (num >= 0) 77 | // { 78 | 79 | Lhloop: 80 | 81 | // node = hull->clipnodes + num; 82 | // plane = hull->planes + node->planenum; 83 | // !!! if the size of dclipnode_t changes, the scaling of %eax needs to be 84 | // changed !!! 85 | movl nd_planenum(%edi,%eax,8),%ecx 86 | movl nd_children(%edi,%eax,8),%eax 87 | movl %eax,%esi 88 | rorl $16,%eax 89 | leal (%ecx,%ecx,4),%ecx 90 | 91 | // if (plane->type < 3) 92 | // d = p[plane->type] - plane->dist; 93 | movb pl_type(%ebp,%ecx,4),%bl 94 | cmpb $3,%bl 95 | jb Lnodot 96 | 97 | // else 98 | // d = DotProduct (plane->normal, p) - plane->dist; 99 | flds pl_normal(%ebp,%ecx,4) 100 | fmuls 0(%edx) 101 | flds pl_normal+4(%ebp,%ecx,4) 102 | fmuls 4(%edx) 103 | flds pl_normal+8(%ebp,%ecx,4) 104 | fmuls 8(%edx) 105 | fxch %st(1) 106 | faddp %st(0),%st(2) 107 | faddp %st(0),%st(1) 108 | fsubs pl_dist(%ebp,%ecx,4) 109 | jmp Lsub 110 | 111 | Lnodot: 112 | flds pl_dist(%ebp,%ecx,4) 113 | fsubrs (%edx,%ebx,4) 114 | 115 | Lsub: 116 | sarl $16,%eax 117 | sarl $16,%esi 118 | 119 | // if (d < 0) 120 | // num = node->children[1]; 121 | // else 122 | // num = node->children[0]; 123 | fstps Ltemp 124 | movl Ltemp,%ecx 125 | sarl $31,%ecx 126 | andl %ecx,%esi 127 | xorl $0xFFFFFFFF,%ecx 128 | andl %ecx,%eax 129 | orl %esi,%eax 130 | jns Lhloop 131 | 132 | // return num; 133 | Lhdone: 134 | popl %esi 135 | popl %ebp 136 | popl %ebx // restore register variables 137 | 138 | Lhquickout: 139 | popl %edi 140 | 141 | ret 142 | 143 | #endif // id386 144 | 145 | -------------------------------------------------------------------------------- /wq.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | if x%1==xfast goto fast 3 | if x%1==xsafe goto safe 4 | if x%1==xverysafe goto verysafe 5 | if x%1==xfastvid goto fastvid 6 | if x%1==xfastsnd goto fastsnd 7 | if x%1==xmax goto max 8 | 9 | echo ------------------------------------------------------------------- 10 | echo Options for running WinQuake: 11 | echo wq max: all features on, but doesn't work on all systems 12 | echo wq fast: maximum speed, but doesn't work on all systems 13 | echo wq fastvid: maximum video speed, but safer, probably slower sound 14 | echo wq fastsnd: maximum sound speed, but safer, probably slower video 15 | echo wq safe: very likely to run, but may be slower 16 | echo wq verysafe: almost sure to run, but probably slower, and no sound 17 | echo ------------------------------------------------------------------- 18 | goto done 19 | 20 | :max 21 | winquake -dinput %2 %3 %4 %5 %6 %7 %8 %9 22 | goto done 23 | 24 | :fast 25 | winquake %2 %3 %4 %5 %6 %7 %8 %9 26 | goto done 27 | 28 | :fastvid 29 | winquake -wavonly %2 %3 %4 %5 %6 %7 %8 %9 30 | goto done 31 | 32 | :fastsnd 33 | winquake -nodirectdraw -nowindirect %2 %3 %4 %5 %6 %7 %8 %9 34 | goto done 35 | 36 | :safe 37 | winquake -nodirectdraw -nowindirect -wavonly %2 %3 %4 %5 %6 %7 %8 %9 38 | goto done 39 | 40 | :verysafe 41 | winquake -dibonly -nosound -nojoy %2 %3 %4 %5 %6 %7 %8 %9 42 | :done 43 | -------------------------------------------------------------------------------- /wqreadme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/ahefner/sdlquake/c2b564d740974dcb629ebf29a3b9c5ca719669e2/wqreadme.txt -------------------------------------------------------------------------------- /zone.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (C) 1996-1997 Id Software, Inc. 3 | 4 | This program is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU General Public License 6 | as published by the Free Software Foundation; either version 2 7 | of the License, or (at your option) any later version. 8 | 9 | This program is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | 13 | See the GNU General Public License for more details. 14 | 15 | You should have received a copy of the GNU General Public License 16 | along with this program; if not, write to the Free Software 17 | Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 18 | 19 | */ 20 | /* 21 | memory allocation 22 | 23 | 24 | H_??? The hunk manages the entire memory block given to quake. It must be 25 | contiguous. Memory can be allocated from either the low or high end in a 26 | stack fashion. The only way memory is released is by resetting one of the 27 | pointers. 28 | 29 | Hunk allocations should be given a name, so the Hunk_Print () function 30 | can display usage. 31 | 32 | Hunk allocations are guaranteed to be 16 byte aligned. 33 | 34 | The video buffers are allocated high to avoid leaving a hole underneath 35 | server allocations when changing to a higher video mode. 36 | 37 | 38 | Z_??? Zone memory functions used for small, dynamic allocations like text 39 | strings from command input. There is only about 48K for it, allocated at 40 | the very bottom of the hunk. 41 | 42 | Cache_??? Cache memory is for objects that can be dynamically loaded and 43 | can usefully stay persistant between levels. The size of the cache 44 | fluctuates from level to level. 45 | 46 | To allocate a cachable object 47 | 48 | 49 | Temp_??? Temp memory is used for file loading and surface caching. The size 50 | of the cache memory is adjusted so that there is a minimum of 512k remaining 51 | for temp memory. 52 | 53 | 54 | ------ Top of Memory ------- 55 | 56 | high hunk allocations 57 | 58 | <--- high hunk reset point held by vid 59 | 60 | video buffer 61 | 62 | z buffer 63 | 64 | surface cache 65 | 66 | <--- high hunk used 67 | 68 | cachable memory 69 | 70 | <--- low hunk used 71 | 72 | client and server low hunk allocations 73 | 74 | <-- low hunk reset point held by host 75 | 76 | startup hunk allocations 77 | 78 | Zone block 79 | 80 | ----- Bottom of Memory ----- 81 | 82 | 83 | 84 | */ 85 | 86 | void Memory_Init (void *buf, int size); 87 | 88 | void Z_Free (void *ptr); 89 | void *Z_Malloc (int size); // returns 0 filled memory 90 | void *Z_TagMalloc (int size, int tag); 91 | 92 | void Z_DumpHeap (void); 93 | void Z_CheckHeap (void); 94 | int Z_FreeMemory (void); 95 | 96 | void *Hunk_Alloc (int size); // returns 0 filled memory 97 | void *Hunk_AllocName (int size, char *name); 98 | 99 | void *Hunk_HighAllocName (int size, char *name); 100 | 101 | int Hunk_LowMark (void); 102 | void Hunk_FreeToLowMark (int mark); 103 | 104 | int Hunk_HighMark (void); 105 | void Hunk_FreeToHighMark (int mark); 106 | 107 | void *Hunk_TempAlloc (int size); 108 | 109 | void Hunk_Check (void); 110 | 111 | typedef struct cache_user_s 112 | { 113 | void *data; 114 | } cache_user_t; 115 | 116 | void Cache_Flush (void); 117 | 118 | void *Cache_Check (cache_user_t *c); 119 | // returns the cached data, and moves to the head of the LRU list 120 | // if present, otherwise returns NULL 121 | 122 | void Cache_Free (cache_user_t *c); 123 | 124 | void *Cache_Alloc (cache_user_t *c, int size, char *name); 125 | // Returns NULL if all purgable data was tossed and there still 126 | // wasn't enough room. 127 | 128 | void Cache_Report (void); 129 | 130 | 131 | 132 | --------------------------------------------------------------------------------