apply Turo Lamminen's djgpp patch. Thanks for the work, Turo.

Evertying still compiles in linux, but if anything broke, I don't particulary
care at this point :)
This commit is contained in:
Bill Currie 2000-08-18 04:30:22 +00:00
parent 483686193a
commit c492f8145f
31 changed files with 374 additions and 94 deletions

View File

@ -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

View File

@ -133,3 +133,5 @@ Driver modules:
Joseph Carter <knghtbrd@debian.org>
Dan Olson <theoddone@quakefiles.com>
DJGPP support:
Turo Lamminen <turo.lamminen@pp.inet.fi>

View File

@ -1,3 +1,5 @@
SHELL = @SHELL@
srcdir = @srcdir@
top_builddir = .

View File

@ -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@

1
bootstrap.bat Normal file
View File

@ -0,0 +1 @@
sh ./bootstrap

View File

@ -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

View File

@ -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;

View File

@ -31,6 +31,13 @@
#include <quakedef.h>
#include <dosisms.h>
#include <client.h>
#include <keys.h>
#include <console.h>
#include <input.h>
#include <screen.h>
#include <mathlib.h>
#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;

View File

@ -32,7 +32,6 @@
#include <string.h>
#include <stdio.h>
#ifndef WIN32
#include <dlfcn.h>
#include <sys/param.h>
#else
#include <input.h>
@ -45,6 +44,10 @@
#include <plugin.h>
#include <cvar.h>
#ifdef HAVE_DLFCN_H
#include <dlfcn.h>
#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

View File

@ -32,7 +32,7 @@
#include <r_local.h>
#include <d_local.h>
#include <mathlib.h>
#include <bothdefs.h>
int iskyspeed = 8;
int iskyspeed2 = 2;
@ -155,7 +155,6 @@ void R_MakeSky (void)
}
#endif
pnewsky += 128 / sizeof (unsigned);
}

View File

@ -28,8 +28,14 @@
$Id$
*/
#include <quakedef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <dosisms.h>
#include <qtypes.h>
#include <console.h>
#include <sound.h>
int BLASTER_GetDMAPos(void);

View File

@ -34,8 +34,13 @@
// Author(s): Jayeson Lee-Steere
//=============================================================================
#include <quakedef.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <dosisms.h>
#include <qtypes.h>
#include <sound.h>
#include <console.h>
//=============================================================================
// 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<NUM_FIELD_BUFFERS)
{
fseek(f,field_buffers[i].offset,SEEK_SET);
Qseek(f,field_buffers[i].offset,SEEK_SET);
stripped_fgets(ts,INI_STRING_SIZE*2,f);
get_field_string(s,ts);
}
@ -428,12 +436,12 @@ void ini_fgets(QFile *f, const char *section, const char *field, char *s)
// else search through section for field.
{
// Make sure we do not start at eof or this will cause problems.
if (feof(f))
fseek(f,section_buffers[current_section].offset,SEEK_SET);
start_pos=ftell(f);
if (Qeof(f))
Qseek(f,section_buffers[current_section].offset,SEEK_SET);
start_pos=Qtell(f);
while (1)
{
string_start_pos=ftell(f);
string_start_pos=Qtell(f);
stripped_fgets(ts,INI_STRING_SIZE*2,f);
// If it is a field, add it to the buffer
if (is_field(ts,"*"))
@ -445,9 +453,9 @@ void ini_fgets(QFile *f, const char *section, const char *field, char *s)
break;
}
// If we reach the end of the section, start over
if (feof(f) || is_section(ts,"*"))
fseek(f,section_buffers[current_section].offset,SEEK_SET);
if (ftell(f)==start_pos)
if (Qeof(f) || is_section(ts,"*"))
Qseek(f,section_buffers[current_section].offset,SEEK_SET);
if (Qtell(f)==start_pos)
return;
}
}

View File

@ -82,6 +82,7 @@ char trans_table[256] = {
Sys_Printf
================
*/
#ifndef DJGPP
void Sys_Printf (char *fmt, ...)
{
va_list argptr;
@ -108,6 +109,7 @@ void Sys_Printf (char *fmt, ...)
fflush(stdout);
}
#endif
/*
================
@ -159,8 +161,9 @@ int Sys_FileTime (char *path)
return ret;
}
#ifdef DJGPP
#ifdef _WIN32
#elif defined(_WIN32)
double Sys_DoubleTime (void)
{
static DWORD starttime;

View File

@ -29,9 +29,6 @@
$Id$
*/
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
@ -44,6 +41,19 @@
#include <dosisms.h>
#include <vid_dos.h>
#include <wad.h>
#include <menu.h>
#include <keys.h>
#include <cmd.h>
#include <console.h>
#include <sys.h>
#include <draw.h>
#include <sound.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#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 ();

83
common/vid_dos.h Normal file
View File

@ -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);

View File

@ -38,6 +38,8 @@
#include <dosisms.h>
#include <vid_dos.h>
#include <dpmi.h>
#include <sys.h>
#include <console.h>
#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

View File

@ -37,6 +37,7 @@
#include <dosisms.h>
#include <vid_dos.h>
#include <dpmi.h>
#include <console.h>
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

56
common/vregset.h Normal file
View File

@ -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);

View File

@ -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"

1
djconfig.bat Normal file
View File

@ -0,0 +1 @@
sh ./djconfig.sh %1 %2 %3 %4 %5 %6 %7 %8 %9

3
djconfig.sh Normal file
View File

@ -0,0 +1,3 @@
#!/bin/sh
export CFLAGS="-O3 -funroll-loops -march=pentiumpro -mpentiumpro -malign-functions=4 -malign-loops=4"
./configure $*

View File

@ -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)

View File

@ -19,9 +19,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <sys/segments.h>
#include <go32.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/nearptr.h>
#include <dos.h>
#include <string.h>
@ -30,6 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <bios.h>
#include "dosisms.h"
#include <quakedef.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
_go32_dpmi_registers hmm;

View File

@ -20,6 +20,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include <go32.h>
#include "mpdosock.h"
#include <common_quakedef.h>
//#include "types.h"
typedef unsigned char BYTE;

View File

@ -27,6 +27,11 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
#include "dosisms.h"
#include <sys.h>
#include <console.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
// this section is general Unix stuff that we need

View File

@ -22,6 +22,14 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <dos.h>
#include <dpmi.h>
#include <string.h>
#include <console.h>
#include <sys.h>
#include <keys.h>
#include <input.h>
#include <cmd.h>
#include <screen.h>
#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)

View File

@ -28,6 +28,12 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "dosisms.h"
#include "net_ipx.h"
#include <console.h>
#include <sys.h>
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
#define EIO 5 /* I/O error */
#define AF_NETWARE 64

View File

@ -24,6 +24,9 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
#include "mpdosock.h"
#include <console.h>
#include <sys.h>
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++)

View File

@ -25,6 +25,8 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "dosisms.h"
#include "crc.h"
#include <server.h>
#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);

View File

@ -25,9 +25,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include <sys/time.h>
#include <sys/types.h>
#include <dir.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <fcntl.h>
#include <stdarg.h>
#include <stdio.h>
@ -40,6 +37,18 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
#include "dosisms.h"
#include <keys.h>
#include <sys.h>
#include <console.h>
#include <client.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <crt0.h>
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);
*/
}

View File

@ -26,6 +26,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#include "quakedef.h"
#include "vregset.h"
#include <sys.h>
//#define outportb loutportb