diff --git a/AUTHORS b/AUTHORS index 6fb5456..65c6ea4 100644 --- a/AUTHORS +++ b/AUTHORS @@ -270,3 +270,7 @@ N: Matthias Buecher (Maddes) E: maddes@bigfoot.com H: Quake Info Pool - http://www.bigfoot.com/~maddes (Redirection) D: Fixing bugs of original Quake + +N: Turo Lamminen +E: turo.lamminen@pp.inet.fi +D: DJGPP patches diff --git a/CREDITS b/CREDITS index efbec45..a727409 100644 --- a/CREDITS +++ b/CREDITS @@ -133,3 +133,5 @@ Driver modules: Joseph Carter Dan Olson +DJGPP support: + Turo Lamminen diff --git a/Makefile.in b/Makefile.in index 1d50913..7bfcbe7 100644 --- a/Makefile.in +++ b/Makefile.in @@ -1,3 +1,5 @@ +SHELL = @SHELL@ + srcdir = @srcdir@ top_builddir = . diff --git a/Rules.mk.in b/Rules.mk.in index 7325ec1..f6ce6fd 100644 --- a/Rules.mk.in +++ b/Rules.mk.in @@ -32,6 +32,7 @@ HAS_OGL = @HAS_OGL@ HAS_XIL = @HAS_XIL@ HAS_X11 = @HAS_X11@ HAS_SDL = @HAS_SDL@ +HAS_VGA = @HAS_VGA@ HAVE_WSOCK = @HAVE_WSOCK@ HAVE_UDP = @HAVE_UDP@ diff --git a/bootstrap.bat b/bootstrap.bat new file mode 100644 index 0000000..75c5582 --- /dev/null +++ b/bootstrap.bat @@ -0,0 +1 @@ +sh ./bootstrap diff --git a/common/Makefile.in b/common/Makefile.in index c977a1e..7f2f3a8 100644 --- a/common/Makefile.in +++ b/common/Makefile.in @@ -32,6 +32,8 @@ # Quake general stuff # +SHELL = @SHELL@ + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -90,6 +92,9 @@ endif ifeq ($(SOUND_STYLE),Windows) SOUND_SRC += snd_dma.c snd_win.c endif +ifeq ($(SOUND_STYLE),DJGPP) +SOUND_SRC += snd_dma.c snd_dos.c snd_gus.c +endif ifeq ($(SOUND_STYLE),NULL) SOUND_SRC += snd_null.c endif diff --git a/common/common_quakedef.h b/common/common_quakedef.h index 577f723..7975188 100644 --- a/common/common_quakedef.h +++ b/common/common_quakedef.h @@ -72,6 +72,13 @@ # define vsnprintf _vsnprintf #endif +#if ! (defined(HAVE_SNPRINTF) || defined(HAVE__SNPRINTF)) +#define snprintf(s,l,f, a...) sprintf(s,f,##a) +#endif +#if ! (defined(HAVE_VSNPRINTF) || defined(HAVE__VSNPRINTF)) +#define vsnprintf(s,l,f,a) vsprintf(s,f,a) +#endif + #ifndef HAVE_SOCKLEN_T # ifdef HAVE_SIZE typedef size_t socklen_t; diff --git a/common/in_dos.c b/common/in_dos.c index e615e9d..b710a98 100644 --- a/common/in_dos.c +++ b/common/in_dos.c @@ -31,6 +31,13 @@ #include #include +#include +#include +#include +#include +#include +#include + #define AUX_FLAG_FREELOOK 0x00000001 typedef struct @@ -165,14 +172,14 @@ void IN_StartupMouse (void) IN_Init =========== */ -void IN_Init (void) +int IN_Init (void) { int i; - m_filter = Cvar_Get ("m_filter","1"); - in_joystick = Cvar_Get ("in_joystick","1"); - joy_numbuttons = Cvar_Get ("joy_numbuttons","4",CVAR_ARCHIVE); - aux_look = Cvar_Get ("auxlook","1",CVAR_ARCHIVE); + m_filter = Cvar_Get ("m_filter","1",0,"None"); + in_joystick = Cvar_Get ("in_joystick","1",0,"None"); + joy_numbuttons = Cvar_Get ("joy_numbuttons","4",CVAR_ARCHIVE,"None"); + aux_look = Cvar_Get ("auxlook","1",CVAR_ARCHIVE,"None"); Cmd_AddCommand ("toggle_auxlook", Toggle_AuxLook_f); Cmd_AddCommand ("force_centerview", Force_CenterView_f); @@ -185,6 +192,7 @@ void IN_Init (void) extern_control = real2ptr(Q_atoi (com_argv[i+1])); IN_StartupExternal (); } + return 0; } /* @@ -458,7 +466,7 @@ qboolean WaitJoyButton (void) do { key_count = -1; - Sys_SendKeyEvents (); + IN_SendKeyEvents (); key_count = 0; if (key_lastpress == K_ESCAPE) { @@ -478,7 +486,7 @@ qboolean WaitJoyButton (void) do { key_count = -1; - Sys_SendKeyEvents (); + IN_SendKeyEvents (); key_count = 0; if (key_lastpress == K_ESCAPE) { @@ -572,7 +580,7 @@ void IN_StartupExternal (void) extern_control->numButtons = 32; Con_Printf("%s Initialized\n", extern_control->deviceName); - Con_Printf(" %u axes %u buttons\n", extern_control->numAxes, extern_control->numButtons); + Con_Printf(" %lu axes %lu buttons\n", extern_control->numAxes, extern_control->numButtons); extern_avail = true; extern_buttons = extern_control->numButtons; diff --git a/common/plugin.c b/common/plugin.c index dbf6dca..8ed691e 100644 --- a/common/plugin.c +++ b/common/plugin.c @@ -32,7 +32,6 @@ #include #include #ifndef WIN32 -#include #include #else #include @@ -45,6 +44,10 @@ #include #include +#ifdef HAVE_DLFCN_H +#include +#endif + #ifndef LIBDIR #define LIBDIR #endif @@ -58,7 +61,35 @@ void Plugin_Init () fs_drvpath = Cvar_Get ("fs_drvpath",".:" LIBDIR "/quakeforge",0,"None"); } -#ifndef WIN32 +#ifdef DJGPP + +#elif defined(WIN32) + +input_pi Winput; +int IN_Init(); +void IN_Move(usercmd_t *); +void IN_Commands(); +void Sys_SendKeyEvents(); +void IN_Shutdown (void); + +int plugin_load(char *filename) +{ + IN = &Winput; + Winput.description = "Windows Input"; + Winput.Init = IN_Init; + Winput.Move = IN_Move; + Winput.Commands = IN_Frame; + Winput.SendKeyEvents = IN_SendKeyEvents; + Winput.Shutdown = IN_Shutdown; + return 1; +} + +void plugin_unload(void *handle) +{ + +} + +#else void *_plugin_load(const char *filename) { @@ -122,30 +153,4 @@ void plugin_unload(void *handle) dlclose(handle); } - -#else - -input_pi Winput; -int IN_Init(); -void IN_Move(usercmd_t *); -void IN_Commands(); -void Sys_SendKeyEvents(); -void IN_Shutdown (void); - -int plugin_load(char *filename) -{ - IN = &Winput; - Winput.description = "Windows Input"; - Winput.Init = IN_Init; - Winput.Move = IN_Move; - Winput.Commands = IN_Frame; - Winput.SendKeyEvents = IN_SendKeyEvents; - Winput.Shutdown = IN_Shutdown; - return 1; -} - -void plugin_unload(void *handle) -{ - -} #endif diff --git a/common/r_sky.c b/common/r_sky.c index f7734fe..9e6f9f1 100644 --- a/common/r_sky.c +++ b/common/r_sky.c @@ -32,7 +32,7 @@ #include #include #include - +#include int iskyspeed = 8; int iskyspeed2 = 2; @@ -155,7 +155,6 @@ void R_MakeSky (void) } #endif - pnewsky += 128 / sizeof (unsigned); } diff --git a/common/snd_dos.c b/common/snd_dos.c index daff4b4..b3a14b8 100644 --- a/common/snd_dos.c +++ b/common/snd_dos.c @@ -28,8 +28,14 @@ $Id$ */ -#include +#include +#include +#include + #include +#include +#include +#include int BLASTER_GetDMAPos(void); diff --git a/common/snd_gus.c b/common/snd_gus.c index 5ebba0e..fc170cd 100644 --- a/common/snd_gus.c +++ b/common/snd_gus.c @@ -34,8 +34,13 @@ // Author(s): Jayeson Lee-Steere //============================================================================= -#include +#include +#include +#include #include +#include +#include +#include //============================================================================= // Author(s): Jayeson Lee-Steere @@ -331,7 +336,7 @@ static char *stripped_fgets(char *s, int n, QFile *f) { int i=0; - if (fgets(s,n,f)==NULL) + if (Qgets(f, s, n)==NULL) return(NULL); while (s[i]!=';' && s[i]!=13 && s[i]!=10 && s[i]!=0) @@ -347,7 +352,7 @@ static char *stripped_fgets(char *s, int n, QFile *f) // Opens an .INI file. Works like fopen QFile *ini_fopen(const char *filename, const char *modes) { - return(fopen(filename,modes)); + return(Qopen(filename,modes)); } // Closes a .INI file. Works like fclose @@ -355,7 +360,8 @@ int ini_fclose(QFile *f) { if (f==current_file) reset_buffer(NULL); - return(fclose(f)); + Qclose(f); + return 0; } // Puts "field" from "section" from .ini file "f" into "s". @@ -384,29 +390,31 @@ void ini_fgets(QFile *f, const char *section, const char *field, char *s) if (i!=current_section) { current_section=i; - fseek(f,section_buffers[i].offset,SEEK_SET); + Qseek(f,section_buffers[i].offset,SEEK_SET); } } // else look through .ini file for it. else { // Make sure we are not at eof or this will cause trouble. - if (feof(f)) - rewind(f); - start_pos=ftell(f); + if (Qeof(f)) + /*rewind(f);*/ + Qseek(f, 0, SEEK_SET); + start_pos=Qtell(f); while (1) { stripped_fgets(ts,INI_STRING_SIZE*2,f); // If it is a section, add it to the section buffer if (is_section(ts,"*")) - current_section=add_section(ts,ftell(f)); + current_section=add_section(ts,Qtell(f)); // If it is the section we are looking for, break. if (is_section(ts,section)) break; // If we reach the end of the file, rewind to the start. - if (feof(f)) - rewind(f); - if (ftell(f)==start_pos) + if (Qeof(f)) + /*rewind(f);*/ + Qseek(f, 0, SEEK_SET); + if (Qtell(f)==start_pos) return; } } @@ -420,7 +428,7 @@ void ini_fgets(QFile *f, const char *section, const char *field, char *s) // If field is in buffer, seek to it and read it if (i -#endif #include #include #include @@ -44,6 +41,19 @@ #include #include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + int vid_modenum; vmode_t *pcurrentmode = NULL; int vid_testingmode, vid_realmode; @@ -100,7 +110,7 @@ VID_Init void VID_Init (unsigned char *palette) { vid_mode = Cvar_Get ("vid_mode","0",0,"None"); - vid_wait = Cvar_Get ("vid_mode","0",0,"None"); + vid_wait = Cvar_Get ("vid_wait","0",0,"None"); vid_nopageflip = Cvar_Get ("vid_nopageflip","0",CVAR_ARCHIVE,"None"); _vid_wait_override = Cvar_Get ("_vid_wait_override","0",CVAR_ARCHIVE, "None"); @@ -281,7 +291,7 @@ int VID_SetMode (int modenum, unsigned char *palette) (*pcurrentmode->setpalette) (&vid, pcurrentmode, palette); vid_modenum = modenum; - vid_mode-> = (float)vid_modenum; + vid_mode -> value= (float)vid_modenum; nomodecheck = true; Con_Printf ("%s\n", VID_ModeInfo (vid_modenum, NULL)); @@ -589,7 +599,7 @@ void VID_MenuDraw (void) char temp[100]; p = Draw_CachePic("gfx/vidmodes.lmp"); - M_Draw((320-p->width)/2,4,p); + M_DrawPic((320-p->width)/2,4,p); vid_wmodes = 0; nummodes = VID_NumModes (); diff --git a/common/vid_dos.h b/common/vid_dos.h new file mode 100644 index 0000000..4740e59 --- /dev/null +++ b/common/vid_dos.h @@ -0,0 +1,83 @@ +/* +Copyright (C) 1996-1997 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +// vid_dos.h: header file for DOS-specific video stuff + +typedef struct vmode_s { + struct vmode_s *pnext; + char *name; + char *header; + unsigned width; + unsigned height; + float aspect; + unsigned rowbytes; + int planar; + int numpages; + void *pextradata; + int (*setmode)(viddef_t *vid, struct vmode_s *pcurrentmode); + void (*swapbuffers)(viddef_t *vid, struct vmode_s *pcurrentmode, + vrect_t *rects); + void (*setpalette)(viddef_t *vid, struct vmode_s *pcurrentmode, + unsigned char *palette); + void (*begindirectrect)(viddef_t *vid, struct vmode_s *pcurrentmode, + int x, int y, byte *pbitmap, int width, + int height); + void (*enddirectrect)(viddef_t *vid, struct vmode_s *pcurrentmode, + int x, int y, int width, int height); +} vmode_t; + +// vid_wait settings +#define VID_WAIT_NONE 0 +#define VID_WAIT_VSYNC 1 +#define VID_WAIT_DISPLAY_ENABLE 2 + +extern int numvidmodes; +extern vmode_t *pvidmodes; + +extern int VGA_width, VGA_height, VGA_rowbytes, VGA_bufferrowbytes; +extern byte *VGA_pagebase; +extern vmode_t *VGA_pcurmode; + +extern cvar_t vid_wait; +extern cvar_t vid_nopageflip; +extern cvar_t _vid_wait_override; + +extern unsigned char colormap256[32][256]; + +extern void *vid_surfcache; +extern int vid_surfcachesize; + +void VGA_Init (void); +void VID_InitVESA (void); +void VID_InitExtra (void); +void VGA_WaitVsync (void); +void VGA_ClearVideoMem (int planar); +void VGA_SetPalette(viddef_t *vid, vmode_t *pcurrentmode, unsigned char *pal); +void VGA_SwapBuffersCopy (viddef_t *vid, vmode_t *pcurrentmode, + vrect_t *rects); +qboolean VGA_FreeAndAllocVidbuffer (viddef_t *vid, int allocnewbuffer); +qboolean VGA_CheckAdequateMem (int width, int height, int rowbytes, + int allocnewbuffer); +void VGA_BeginDirectRect (viddef_t *vid, struct vmode_s *pcurrentmode, int x, + int y, byte *pbitmap, int width, int height); +void VGA_EndDirectRect (viddef_t *vid, struct vmode_s *pcurrentmode, int x, + int y, int width, int height); +void VGA_UpdateLinearScreen (void *srcptr, void *destptr, int width, + int height, int srcrowbytes, int destrowbytes); + diff --git a/common/vid_ext.c b/common/vid_ext.c index 9456e9e..d679d55 100644 --- a/common/vid_ext.c +++ b/common/vid_ext.c @@ -38,6 +38,8 @@ #include #include #include +#include +#include #define MODE_SUPPORTED_IN_HW 0x0001 #define COLOR_MODE 0x0008 @@ -321,7 +323,7 @@ void VID_InitExtra (void) return; // not VESA 2.0 or greater Con_Printf ("VESA 2.0 compliant adapter:\n%s\n", - VID_ExtraFarToLinear (*(byte **)&pinfoblock->OemStringPtr[0])); + (char *) VID_ExtraFarToLinear (*(byte **)&pinfoblock->OemStringPtr[0])); totalvidmem = *(unsigned short *)&pinfoblock->TotalMemory[0] << 16; @@ -795,6 +797,7 @@ void VID_ExtraSwapBuffers (viddef_t *lvid, vmode_t *pcurrentmode, } } +#if 0 int VID_ExtraOptionDraw(unsigned int options_draw_cursor) { int drawn; @@ -835,3 +838,4 @@ void VID_LockBuffer ( void ) void VID_UnlockBuffer ( void ) { } +#endif diff --git a/common/vid_vga.c b/common/vid_vga.c index aaa8664..a52a28c 100644 --- a/common/vid_vga.c +++ b/common/vid_vga.c @@ -37,6 +37,7 @@ #include #include #include +#include extern regs_t regs; @@ -274,7 +275,7 @@ qboolean VGA_FreeAndAllocVidbuffer (viddef_t *lvid, int allocnewbuffer) // see if there's enough memory, allowing for the normal mode 0x13 pixel, // z, and surface buffers if ((host_parms.memsize - tbuffersize + SURFCACHE_SIZE_AT_320X200 + - 0x10000 * 3) < minimum_memory) + 0x10000 * 3) < MINIMUM_MEMORY) { Con_Printf ("Not enough memory for video mode\n"); VGA_pcurmode = NULL; // so no further accesses to the buffer are @@ -331,7 +332,7 @@ qboolean VGA_CheckAdequateMem (int width, int height, int rowbytes, int allocnew // see if there's enough memory, allowing for the normal mode 0x13 pixel, // z, and surface buffers if ((host_parms.memsize - tbuffersize + SURFCACHE_SIZE_AT_320X200 + - 0x10000 * 3) < minimum_memory) + 0x10000 * 3) < MINIMUM_MEMORY) { return false; // not enough memory for mode } @@ -480,6 +481,7 @@ void VGA_SwapBuffers (viddef_t *lvid, vmode_t *pcurrentmode, vrect_t *rects) VGA_SwapBuffersCopy (lvid, pcurrentmode, rects); } +#if 0 int VID_ExtraOptionDraw(unsigned int options_draw_cursor) { int drawn; @@ -520,3 +522,4 @@ void VID_LockBuffer ( void ) void VID_UnlockBuffer ( void ) { } +#endif diff --git a/common/vregset.h b/common/vregset.h new file mode 100644 index 0000000..822c76c --- /dev/null +++ b/common/vregset.h @@ -0,0 +1,56 @@ +/* +Copyright (C) 1996-1997 Id Software, Inc. + +This program is free software; you can redistribute it and/or +modify it under the terms of the GNU General Public License +as published by the Free Software Foundation; either version 2 +of the License, or (at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. + +See the GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + +*/ +// +// vregset.h: header file for video register-setting interpreter +// + +// +// registers & subregisters +// +#define MISC_OUTPUT 0x3C2 + +#define SC_INDEX 0x3C4 +#define SC_DATA 0x3C5 +#define SYNC_RESET 0 +#define MAP_MASK 2 +#define MEMORY_MODE 4 + +#define GC_INDEX 0x3CE +#define GC_DATA 0x3CF +#define READ_MAP 4 +#define GRAPHICS_MODE 5 +#define MISCELLANOUS 6 + +#define CRTC_INDEX 0x3D4 +#define CRTC_DATA 0x3D5 +#define MAX_SCAN_LINE 9 +#define UNDERLINE 0x14 +#define MODE_CONTROL 0x17 + +// +// register-set commands +// +#define VRS_END 0 +#define VRS_BYTE_OUT 1 +#define VRS_BYTE_RMW 2 +#define VRS_WORD_OUT 3 + +void VideoRegisterSet (int *pregset); + diff --git a/configure.in b/configure.in index fb93171..94fac08 100644 --- a/configure.in +++ b/configure.in @@ -730,6 +730,14 @@ QF_maGiC_VALUE SOUND_LIBS="-lwinmm") fi +if test -z "$SOUND_STYLE"; then + AC_EGREP_CPP([QF_maGiC_VALUE],[ +#ifdef __DJGPP +QF_maGiC_VALUE +#endif + ], SOUND_STYLE="DJGPP") +fi + if test "x$SOUND_STYLE" = "x"; then AC_MSG_RESULT(no) SOUND_STYLE="NULL" diff --git a/djconfig.bat b/djconfig.bat new file mode 100644 index 0000000..e0503c0 --- /dev/null +++ b/djconfig.bat @@ -0,0 +1 @@ +sh ./djconfig.sh %1 %2 %3 %4 %5 %6 %7 %8 %9 diff --git a/djconfig.sh b/djconfig.sh new file mode 100644 index 0000000..e350340 --- /dev/null +++ b/djconfig.sh @@ -0,0 +1,3 @@ +#!/bin/sh +export CFLAGS="-O3 -funroll-loops -march=pentiumpro -mpentiumpro -malign-functions=4 -malign-loops=4" +./configure $* diff --git a/uquake/Makefile.in b/uquake/Makefile.in index 4c01058..7a7d089 100644 --- a/uquake/Makefile.in +++ b/uquake/Makefile.in @@ -3,6 +3,8 @@ # Quake general stuff # +SHELL = @SHELL@ + srcdir = @srcdir@ top_srcdir = @top_srcdir@ VPATH = @srcdir@ @@ -28,35 +30,35 @@ include $(top_builddir)/Rules.mk COMMON_LIB=common_lib.a ifeq ($(HAS_OGL),yes) -GLQUAKE =$(BIN_PREFIX)-glx +GLQUAKE =$(BIN_PREFIX)-glx@EXEEXT@ endif ifeq ($(HAS_TDFXGL),yes) -TDFXQUAKE= $(BIN_PREFIX)-3dfx +TDFXQUAKE= $(BIN_PREFIX)-3dfx@EXEEXT@ endif ifeq ($(HAS_X11),yes) -X11QUAKE = $(BIN_PREFIX)-x11 +X11QUAKE = $(BIN_PREFIX)-x11@EXEEXT@ endif ifeq ($(HAS_SVGA),yes) -SVGAQUAKE = $(BIN_PREFIX)-svga +SVGAQUAKE = $(BIN_PREFIX)-svga@EXEEXT@ endif ifeq ($(HAS_VGA),yes) -VGAQUAKE = $(BIN_PREFIX)-vga +VGAQUAKE = $(BIN_PREFIX)-vga@EXEEXT@ endif ifeq ($(HAS_MGL),yes) -MGLQUAKE = $(BIN_PREFIX)-mgl +MGLQUAKE = $(BIN_PREFIX)-mgl@EXEEXT@ endif ifeq ($(HAS_GGI),yes) -GGIQUAKE = $(BIN_PREFIX)-ggi +GGIQUAKE = $(BIN_PREFIX)-ggi@EXEEXT@ endif ifeq ($(HAS_SDL),yes) -SDLQUAKE = $(BIN_PREFIX)-sdl +SDLQUAKE = $(BIN_PREFIX)-sdl@EXEEXT@ endif soft_targets = $(X11QUAKE) $(SVGAQUAKE) $(GGIQUAKE) $(SDLQUAKE) $(MGLQUAKE) \ @@ -101,7 +103,7 @@ else ifeq ($(HAVE_UDP),yes) NET_SRC = net_bsd.c @NET_SOURCE@ else -NET_SRC = net_dos.c net_bw.c net_ipx.c net_mp.c net_ser.c +NET_SRC = net_dos.c net_bw.c net_ipx.c net_mp.c net_ser.c mplib.c mplpc.c endif endif UQ_NET_SRC = net_com.c mdfour.c net_dgrm.c net_loop.c net_main.c net_vcr.c $(NET_SRC) diff --git a/uquake/dos_v2.c b/uquake/dos_v2.c index 17a5da4..eb7c7ed 100644 --- a/uquake/dos_v2.c +++ b/uquake/dos_v2.c @@ -19,9 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include -#ifdef HAVE_UNISTD_H -#include -#endif #include #include #include @@ -30,6 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include "dosisms.h" +#include + +#ifdef HAVE_UNISTD_H +#include +#endif _go32_dpmi_registers hmm; diff --git a/uquake/mplpc.c b/uquake/mplpc.c index 1b3065e..75bed71 100644 --- a/uquake/mplpc.c +++ b/uquake/mplpc.c @@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #include #include "mpdosock.h" +#include //#include "types.h" typedef unsigned char BYTE; diff --git a/uquake/net_bw.c b/uquake/net_bw.c index 86423ac..2c0c636 100644 --- a/uquake/net_bw.c +++ b/uquake/net_bw.c @@ -27,6 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" #include "dosisms.h" +#include +#include +#ifdef HAVE_NETINET_IN_H +#include +#endif // this section is general Unix stuff that we need diff --git a/uquake/net_comx.c b/uquake/net_comx.c index cc5417e..d309af7 100644 --- a/uquake/net_comx.c +++ b/uquake/net_comx.c @@ -22,6 +22,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include +#include + +#include +#include +#include +#include +#include +#include #define NUM_COM_PORTS 2 @@ -44,14 +52,14 @@ typedef struct #define ENQUEUE(q,b) (q.data[q.head] = b, q.head = (q.head + 1) & QUEUEMASK) #define DEQUEUE(q,b) (b = q.data[q.tail], q.tail = (q.tail + 1) & QUEUEMASK) -extern cvar_t *config_com_port; +/*extern cvar_t *config_com_port; extern cvar_t *config_com_irq; extern cvar_t *config_com_baud; extern cvar_t *config_com_modem; extern cvar_t *config_modem_dialtype; extern cvar_t *config_modem_clear; extern cvar_t *config_modem_init; -extern cvar_t *config_modem_hangup; +extern cvar_t *config_modem_hangup;*/ extern int m_return_state; extern int m_state; @@ -353,10 +361,10 @@ void TTY_SetComPortConfig (int portNumber, int port, int irq, int baud, qboolean else temp = 0.0; - Cvar_SetValue (config_com_port, (float)port); +/* Cvar_SetValue (config_com_port, (float)port); Cvar_SetValue (config_com_irq, (float)irq); Cvar_SetValue (config_com_baud, (float)baud); - Cvar_SetValue (config_com_modem, temp); + Cvar_SetValue (config_com_modem, temp);*/ } void TTY_GetModemConfig (int portNumber, char *dialType, char *clear, char *init, char *hangup) @@ -382,10 +390,10 @@ void TTY_SetModemConfig (int portNumber, char *dialType, char *clear, char *init p->modemInitialized = false; - Cvar_Set (config_modem_dialtype, dialType); +/* Cvar_Set (config_modem_dialtype, dialType); Cvar_Set (config_modem_clear, clear); Cvar_Set (config_modem_init, init); - Cvar_Set (config_modem_hangup, hangup); + Cvar_Set (config_modem_hangup, hangup);*/ } @@ -793,7 +801,7 @@ int TTY_Connect(int handle, char *host) break; } - Sys_SendKeyEvents (); + IN_SendKeyEvents (); if (key_count == 0) { if (key_lastpress != K_ESCAPE) diff --git a/uquake/net_ipx.c b/uquake/net_ipx.c index b37017a..36ea07e 100644 --- a/uquake/net_ipx.c +++ b/uquake/net_ipx.c @@ -28,6 +28,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "dosisms.h" #include "net_ipx.h" +#include +#include +#ifdef HAVE_NETINET_IN_H +#include +#endif + #define EIO 5 /* I/O error */ #define AF_NETWARE 64 diff --git a/uquake/net_mp.c b/uquake/net_mp.c index 0836fe9..4e24334 100644 --- a/uquake/net_mp.c +++ b/uquake/net_mp.c @@ -24,6 +24,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" #include "mpdosock.h" +#include +#include + short flat_selector; int WSAGetLastError(void); @@ -78,7 +81,7 @@ int MPATH_Init (void) myAddr = *(int *)local->h_addr_list[0]; // if the quake hostname isn't set, set it to the machine name - if (Q_strcmp(hostname.string, "UNNAMED") == 0) + if (Q_strcmp(hostname -> string, "UNNAMED") == 0) { // see if it's a text IP address (well, close enough) for (p = buff; *p; p++) diff --git a/uquake/net_ser.c b/uquake/net_ser.c index 5bcaff6..d8c6254 100644 --- a/uquake/net_ser.c +++ b/uquake/net_ser.c @@ -25,6 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "dosisms.h" #include "crc.h" +#include + #include "net_comx.c" // serial protocol @@ -910,7 +912,7 @@ static qsocket_t *_Serial_CheckNewConnections (SerialLine *p) SZ_Clear(&net_message); MSG_WriteByte(&net_message, CCREP_SERVER_INFO); - MSG_WriteString(&net_message, hostname.string); + MSG_WriteString(&net_message, hostname -> string); MSG_WriteString(&net_message, sv.name); MSG_WriteByte(&net_message, net_activeconnections); MSG_WriteByte(&net_message, svs.maxclients); diff --git a/uquake/sys_dos.c b/uquake/sys_dos.c index a15c69f..8b13119 100644 --- a/uquake/sys_dos.c +++ b/uquake/sys_dos.c @@ -25,9 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include #include #include -#ifdef HAVE_UNISTD_H -#include -#endif #include #include #include @@ -40,6 +37,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" #include "dosisms.h" +#include +#include +#include +#include + +#ifdef HAVE_UNISTD_H +#include +#endif + +#include +int _crt0_startup_flags = _CRT0_FLAG_UNIX_SBRK; + #define MINIMUM_WIN_MEMORY 0x800000 #define MINIMUM_WIN_MEMORY_LEVELPAK (MINIMUM_WIN_MEMORY + 0x100000) @@ -460,7 +469,7 @@ void Sys_Shutdown(void) #define SC_RSHIFT 0x36 #define SC_LSHIFT 0x2a -void Sys_SendKeyEvents (void) +void IN_SendKeyEvents (void) { int k, next; int outkey; @@ -926,4 +935,26 @@ int main (int c, char **v) } } +void Sys_DebugLog(char *file, char *fmt, ...) +{ + va_list argptr; + static char data[1024]; + QFile *stream; + unsigned char *p; + //int fd; + va_start(argptr, fmt); + vsnprintf(data, sizeof(data), fmt, argptr); + va_end(argptr); +// fd = open(file, O_WRONLY | O_BINARY | O_CREAT | O_APPEND, 0666); + stream = Qopen(file, "a"); + for (p = (unsigned char *) data; *p; p++) { + Qputc(stream, trans_table[*p]); + } + Qclose(stream); + /* + fd = open(file, O_WRONLY | O_CREAT | O_APPEND, 0666); + write(fd, data, strlen(data)); + close(fd); + */ +} diff --git a/uquake/vregset.c b/uquake/vregset.c index f77d8ac..5a65eca 100644 --- a/uquake/vregset.c +++ b/uquake/vregset.c @@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #include "quakedef.h" #include "vregset.h" +#include //#define outportb loutportb