From 028be9cb2fd8d81cefedd90660c5826913fdceb3 Mon Sep 17 00:00:00 2001 From: Bradley Bell Date: Fri, 19 Oct 2001 09:01:56 +0000 Subject: [PATCH] Moved arch/sdl_* to arch/sdl --- arch/Makefile.am | 30 +----------- arch/dos/Makefile.am | 27 +++++++++++ arch/{dos_dpmi.c => dos/dpmi.c} | 9 ++-- arch/{dos_findfile.c => dos/findfile.c} | 7 ++- arch/{dos_init.c => dos/init.c} | 9 ++-- arch/{dos_ipx.c => dos/ipx.c} | 11 +++-- arch/{dos_modex.asm => dos/modex.asm} | 7 ++- arch/{dos_timer.asm => dos/timer.asm} | 9 ++-- arch/{dos_tweak.inc => dos/tweak.inc} | 9 ++-- arch/{dos_vesa.c => dos/vesa.c} | 9 ++-- arch/{dos_vgaregs.inc => dos/vgaregs.inc} | 9 ++-- arch/linux/Makefile.am | 6 +-- arch/{linux_init.c => linux/init.c} | 7 ++- arch/sdl_init.c | 43 ----------------- arch/sdl_timer.c | 24 ---------- arch/win32/Makefile.am | 4 +- arch/win32/mingw_init.c | 56 +++++++++++++++++++++++ configure.in | 8 +++- main/Makefile.am | 8 ++-- 19 files changed, 158 insertions(+), 134 deletions(-) create mode 100644 arch/dos/Makefile.am rename arch/{dos_dpmi.c => dos/dpmi.c} (98%) rename arch/{dos_findfile.c => dos/findfile.c} (93%) rename arch/{dos_init.c => dos/init.c} (98%) rename arch/{dos_ipx.c => dos/ipx.c} (99%) rename arch/{dos_modex.asm => dos/modex.asm} (99%) rename arch/{dos_timer.asm => dos/timer.asm} (98%) rename arch/{dos_tweak.inc => dos/tweak.inc} (97%) rename arch/{dos_vesa.c => dos/vesa.c} (94%) rename arch/{dos_vgaregs.inc => dos/vgaregs.inc} (93%) rename arch/{linux_init.c => linux/init.c} (86%) delete mode 100644 arch/sdl_init.c delete mode 100644 arch/sdl_timer.c create mode 100644 arch/win32/mingw_init.c diff --git a/arch/Makefile.am b/arch/Makefile.am index 7bd1384c..cadd5ac5 100644 --- a/arch/Makefile.am +++ b/arch/Makefile.am @@ -1,32 +1,6 @@ SUBDIRS = @D2X_ARCH_SUBDIRS@ -DIST_SUBDIRS = win32 linux -EXTRA_SUBDIRS = dos include - -noinst_LIBRARIES = libarch.a -INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/main -I$(top_srcdir)/arch/include - -if ENV_DJGPP -libarch_a_SOURCES = dos_init.c dos_vesa.c dos_findfile.c dos_dpmi.c dos_ipx.c -else -libarch_a_SOURCES = linux_init.c sdl_init.c sdl_timer.c -endif - -EXTRA_libarch_a_SOURCES = \ - dos_init.c dos_vesa.c dos_findfile.c dos_dpmi.c dos_ipx.c \ - linux_init.c \ - sdl_init.c sdl_timer.c - -SUFFIXES = .asm -%.o: %.asm - $(NASM) $(NASMFLAGS) $< -o $@ - -if ENV_DJGPP -libarch_a_LIBADD += dos_timer.o dos_modex.o -endif - -EXTRA_DIST = \ -dos_tweak.inc dos_vgaregs.inc \ -dos_modex.asm dos_timer.asm +DIST_SUBDIRS = dos linux sdl win32 +EXTRA_SUBDIRS = include dist-hook: list='$(EXTRA_SUBDIRS)'; for subdir in $$list; do \ diff --git a/arch/dos/Makefile.am b/arch/dos/Makefile.am new file mode 100644 index 00000000..f3d98f16 --- /dev/null +++ b/arch/dos/Makefile.am @@ -0,0 +1,27 @@ +EXTRA_SUBDIRS = allg_snd bak comm include mm_snd + +noinst_LIBRARIES = libarch_dos.a + +INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/main -I$(srcdir)/include + +libarch_dos_a_SOURCES = dpmi.c findfile.c init.c ipx.c vesa.c + +SUFFIXES = .asm +%.o: %.asm + $(NASM) $(NASMFLAGS) $< -o $@ + +if ENV_DJGPP +libarch_dos_a_LIBADD += timer.o modex.o +endif + +EXTRA_DIST = \ +tweak.inc vgaregs.inc \ +modex.asm timer.asm \ +digiallg.c digimm.c disk.c midiallg.c mono.c serial.c \ +ipx.h mono.h + +dist-hook: + list='$(EXTRA_SUBDIRS)'; for subdir in $$list; do \ + ( cd $(srcdir) && tar --exclude=CVS -cf - $$subdir ) \ + | ( cd $(distdir) && tar xf - ) \ + done diff --git a/arch/dos_dpmi.c b/arch/dos/dpmi.c similarity index 98% rename from arch/dos_dpmi.c rename to arch/dos/dpmi.c index 42dbd510..ac595069 100644 --- a/arch/dos_dpmi.c +++ b/arch/dos/dpmi.c @@ -12,14 +12,17 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* - * $Source: /cvs/cvsroot/d2x/arch/dos_dpmi.c,v $ - * $Revision: 1.2 $ + * $Source: /cvs/cvsroot/d2x/arch/dos/dpmi.c,v $ + * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-01-29 13:35:08 $ + * $Date: 2001-10-19 09:01:56 $ * * Dos DPMI * * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/29 13:35:08 bradleyb + * Fixed build system, minor fixes + * */ #ifdef HAVE_CONFIG_H diff --git a/arch/dos_findfile.c b/arch/dos/findfile.c similarity index 93% rename from arch/dos_findfile.c rename to arch/dos/findfile.c index 452923b7..1fa18da0 100644 --- a/arch/dos_findfile.c +++ b/arch/dos/findfile.c @@ -12,14 +12,17 @@ COPYRIGHT 1993-1999 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* - * $Source: /cvs/cvsroot/d2x/arch/dos_findfile.c,v $ + * $Source: /cvs/cvsroot/d2x/arch/dos/findfile.c,v $ * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-01-31 14:04:44 $ + * $Date: 2001-10-19 09:01:56 $ * * Dos findfile functions * * $Log: not supported by cvs2svn $ + * Revision 1.3 2001/01/31 14:04:44 bradleyb + * Fix compiler warnings + * * Revision 1.2 2001/01/29 13:35:08 bradleyb * Fixed build system, minor fixes * diff --git a/arch/dos_init.c b/arch/dos/init.c similarity index 98% rename from arch/dos_init.c rename to arch/dos/init.c index f1283704..0fef6c9d 100644 --- a/arch/dos_init.c +++ b/arch/dos/init.c @@ -1,12 +1,15 @@ /* - * $Source: /cvs/cvsroot/d2x/arch/dos_init.c,v $ - * $Revision: 1.3 $ + * $Source: /cvs/cvsroot/d2x/arch/dos/init.c,v $ + * $Revision: 1.4 $ * $Author: bradleyb $ - * $Date: 2001-01-29 13:35:08 $ + * $Date: 2001-10-19 09:01:56 $ * * Dos initialization * * $Log: not supported by cvs2svn $ + * Revision 1.3 2001/01/29 13:35:08 bradleyb + * Fixed build system, minor fixes + * */ #ifdef HAVE_CONFIG_H diff --git a/arch/dos_ipx.c b/arch/dos/ipx.c similarity index 99% rename from arch/dos_ipx.c rename to arch/dos/ipx.c index d7e66320..9c223820 100644 --- a/arch/dos_ipx.c +++ b/arch/dos/ipx.c @@ -12,14 +12,17 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. */ /* - * $Source: /cvs/cvsroot/d2x/arch/dos_ipx.c,v $ - * $Revision: 1.2 $ + * $Source: /cvs/cvsroot/d2x/arch/dos/ipx.c,v $ + * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-01-29 13:35:08 $ + * $Date: 2001-10-19 09:01:56 $ * * Routines for IPX communications. * * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/29 13:35:08 bradleyb + * Fixed build system, minor fixes + * * Revision 1.1.1.1 2001/01/19 03:30:15 bradleyb * Import of d2x-0.0.8 * @@ -174,7 +177,7 @@ COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. #endif #ifdef RCS -static char rcsid[] = "$Id: dos_ipx.c,v 1.2 2001-01-29 13:35:08 bradleyb Exp $"; +static char rcsid[] = "$Id: ipx.c,v 1.3 2001-10-19 09:01:56 bradleyb Exp $"; #endif #ifdef __GNUC__ diff --git a/arch/dos_modex.asm b/arch/dos/modex.asm similarity index 99% rename from arch/dos_modex.asm rename to arch/dos/modex.asm index 45442d3f..956a9bf3 100644 --- a/arch/dos_modex.asm +++ b/arch/dos/modex.asm @@ -9,14 +9,17 @@ ;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. ; -; $Source: /cvs/cvsroot/d2x/arch/dos_modex.asm,v $ +; $Source: /cvs/cvsroot/d2x/arch/dos/modex.asm,v $ ; $Revision: 1.3 $ ; $Author: bradleyb $ -; $Date: 2001-01-31 14:04:44 $ +; $Date: 2001-10-19 09:01:56 $ ; ; Routines to access ModeX VGA memory ; ; $Log: not supported by cvs2svn $ +; Revision 1.3 2001/01/31 14:04:44 bradleyb +; Fix compiler warnings +; ; Revision 1.2 2001/01/29 13:35:08 bradleyb ; Fixed build system, minor fixes ; diff --git a/arch/dos_timer.asm b/arch/dos/timer.asm similarity index 98% rename from arch/dos_timer.asm rename to arch/dos/timer.asm index ca355965..2a6b76ba 100644 --- a/arch/dos_timer.asm +++ b/arch/dos/timer.asm @@ -1,12 +1,15 @@ ; -; $Source: /cvs/cvsroot/d2x/arch/dos_timer.asm,v $ -; $Revision: 1.2 $ +; $Source: /cvs/cvsroot/d2x/arch/dos/timer.asm,v $ +; $Revision: 1.3 $ ; $Author: bradleyb $ -; $Date: 2001-01-29 13:35:08 $ +; $Date: 2001-10-19 09:01:56 $ ; ; DOS timer routines ; ; $Log: not supported by cvs2svn $ +; Revision 1.2 2001/01/29 13:35:08 bradleyb +; Fixed build system, minor fixes +; ; diff --git a/arch/dos_tweak.inc b/arch/dos/tweak.inc similarity index 97% rename from arch/dos_tweak.inc rename to arch/dos/tweak.inc index 17e3895d..78048fbb 100644 --- a/arch/dos_tweak.inc +++ b/arch/dos/tweak.inc @@ -9,14 +9,17 @@ ;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. ; -; $Source: /cvs/cvsroot/d2x/arch/dos_tweak.inc,v $ -; $Revision: 1.2 $ +; $Source: /cvs/cvsroot/d2x/arch/dos/tweak.inc,v $ +; $Revision: 1.3 $ ; $Author: bradleyb $ -; $Date: 2001-01-29 13:35:08 $ +; $Date: 2001-10-19 09:01:56 $ ; ; Parameters used by modex.asm to set various modex resolutions. ; ; $Log: not supported by cvs2svn $ +; Revision 1.2 2001/01/29 13:35:08 bradleyb +; Fixed build system, minor fixes +; ; Revision 1.1.1.1 2001/01/19 03:30:15 bradleyb ; Import of d2x-0.0.8 ; diff --git a/arch/dos_vesa.c b/arch/dos/vesa.c similarity index 94% rename from arch/dos_vesa.c rename to arch/dos/vesa.c index c3f0ddb2..81c8310b 100644 --- a/arch/dos_vesa.c +++ b/arch/dos/vesa.c @@ -1,12 +1,15 @@ /* - * $Source: /cvs/cvsroot/d2x/arch/dos_vesa.c,v $ - * $Revision: 1.2 $ + * $Source: /cvs/cvsroot/d2x/arch/dos/vesa.c,v $ + * $Revision: 1.3 $ * $Author: bradleyb $ - * $Date: 2001-01-29 13:35:08 $ + * $Date: 2001-10-19 09:01:56 $ * * Dos VESA * * $Log: not supported by cvs2svn $ + * Revision 1.2 2001/01/29 13:35:08 bradleyb + * Fixed build system, minor fixes + * */ #ifdef HAVE_CONFIG_H diff --git a/arch/dos_vgaregs.inc b/arch/dos/vgaregs.inc similarity index 93% rename from arch/dos_vgaregs.inc rename to arch/dos/vgaregs.inc index d78c5ce2..ca7f4a26 100644 --- a/arch/dos_vgaregs.inc +++ b/arch/dos/vgaregs.inc @@ -9,14 +9,17 @@ ;AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE. ;COPYRIGHT 1993-1998 PARALLAX SOFTWARE CORPORATION. ALL RIGHTS RESERVED. ; -; $Source: /cvs/cvsroot/d2x/arch/dos_vgaregs.inc,v $ -; $Revision: 1.2 $ +; $Source: /cvs/cvsroot/d2x/arch/dos/vgaregs.inc,v $ +; $Revision: 1.3 $ ; $Author: bradleyb $ -; $Date: 2001-01-29 13:35:08 $ +; $Date: 2001-10-19 09:01:56 $ ; ; Readable descriptions of VGA ports. ; ; $Log: not supported by cvs2svn $ +; Revision 1.2 2001/01/29 13:35:08 bradleyb +; Fixed build system, minor fixes +; ; Revision 1.1.1.1 2001/01/19 03:30:15 bradleyb ; Import of d2x-0.0.8 ; diff --git a/arch/linux/Makefile.am b/arch/linux/Makefile.am index c8a44fc9..ec10b042 100644 --- a/arch/linux/Makefile.am +++ b/arch/linux/Makefile.am @@ -2,12 +2,12 @@ EXTRA_SUBDIRS = include noinst_LIBRARIES = libarch_linux.a -INCLUDES = -I$(top_srcdir)/includes -I$(top_srcdir)/main -I$(srcdir)/include +INCLUDES = -I$(top_srcdir)/arch/include -I$(top_srcdir)/includes -I$(top_srcdir)/main -I$(srcdir)/include if USE_NETWORK -libarch_linux_a_SOURCES = findfile.c ipx_bsd.c ipx_kali.c ipx_lin.c linuxnet.c ukali.c +libarch_linux_a_SOURCES = findfile.c init.c ipx_bsd.c ipx_kali.c ipx_lin.c linuxnet.c ukali.c else -libarch_linux_a_SOURCES = findfile.c +libarch_linux_a_SOURCES = findfile.c init.c endif EXTRA_libarch_linux_a_SOURCES = \ diff --git a/arch/linux_init.c b/arch/linux/init.c similarity index 86% rename from arch/linux_init.c rename to arch/linux/init.c index 332815bb..7e13fb66 100644 --- a/arch/linux_init.c +++ b/arch/linux/init.c @@ -1,12 +1,15 @@ /* - * $Source: /cvs/cvsroot/d2x/arch/linux_init.c,v $ + * $Source: /cvs/cvsroot/d2x/arch/linux/init.c,v $ * $Revision: 1.4 $ * $Author: bradleyb $ - * $Date: 2001-01-29 13:35:08 $ + * $Date: 2001-10-19 09:01:56 $ * * linux init.c - added Matt Mueller 9/6/98 * * $Log: not supported by cvs2svn $ + * Revision 1.4 2001/01/29 13:35:08 bradleyb + * Fixed build system, minor fixes + * */ #ifdef HAVE_CONFIG_H diff --git a/arch/sdl_init.c b/arch/sdl_init.c deleted file mode 100644 index e8f6b0ff..00000000 --- a/arch/sdl_init.c +++ /dev/null @@ -1,43 +0,0 @@ -/* - * $Source: /cvs/cvsroot/d2x/arch/sdl_init.c,v $ - * $Revision: 1.4 $ - * $Author: bradleyb $ - * $Date: 2001-01-29 13:35:09 $ - * - * SDL architecture support - * - * $Log: not supported by cvs2svn $ - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include -#include -#include "text.h" -#include "event.h" -#include "error.h" -#include "args.h" -#include "digi.h" - -extern void d_mouse_init(); - -void sdl_close() -{ - SDL_Quit(); -} - -void arch_sdl_init() -{ - // Initialise the library -//edited on 01/03/99 by Matt Mueller - if we use SDL_INIT_EVERYTHING, cdrom is initialized even if -nocdaudio is used -#ifdef SDL_INPUT - if (!FindArg("-nomouse")) - d_mouse_init(); -#endif - if (!FindArg("-nosound")) - digi_init(); - atexit(sdl_close); -} diff --git a/arch/sdl_timer.c b/arch/sdl_timer.c deleted file mode 100644 index e11f3401..00000000 --- a/arch/sdl_timer.c +++ /dev/null @@ -1,24 +0,0 @@ -/* - * $Source: /cvs/cvsroot/d2x/arch/sdl_timer.c,v $ - * $Revision: 1.2 $ - * $Author: bradleyb $ - * $Date: 2001-01-29 13:35:09 $ - * - * SDL library timer functions - * - * $Log: not supported by cvs2svn $ - */ - -#ifdef HAVE_CONFIG_H -#include -#endif - -#include -#include "maths.h" - -fix timer_get_fixed_seconds(void) { - fix x; - unsigned long tv_now = SDL_GetTicks(); - x=i2f(tv_now/1000) | fixdiv(i2f(tv_now % 1000),i2f(1000)); - return x; -} diff --git a/arch/win32/Makefile.am b/arch/win32/Makefile.am index 0579747a..17628a98 100644 --- a/arch/win32/Makefile.am +++ b/arch/win32/Makefile.am @@ -5,9 +5,9 @@ noinst_LIBRARIES = libarch_win32.a INCLUDES = -I$(top_srcdir)/includes -I$(srcdir)/include if USE_NETWORK -libarch_win32_a_SOURCES = findfile.c winnet.c ipx_win.c +libarch_win32_a_SOURCES = findfile.c mingw_init.c winnet.c ipx_win.c else -libarch_win32_a_SOURCES = findfile.c +libarch_win32_a_SOURCES = findfile.c mingw_init.c endif EXTRA_DIST = \ diff --git a/arch/win32/mingw_init.c b/arch/win32/mingw_init.c new file mode 100644 index 00000000..5d66e16d --- /dev/null +++ b/arch/win32/mingw_init.c @@ -0,0 +1,56 @@ +/* + * $Source: /cvs/cvsroot/d2x/arch/win32/mingw_init.c,v $ + * $Revision: 1.1 $ + * $Author: bradleyb $ + * $Date: 2001-10-19 09:01:56 $ + * + * mingw_init.c - Basically same as linux init.c + * + * $Log: not supported by cvs2svn $ + * + */ + +#ifdef HAVE_CONFIG_H +#include +#endif + +#include +#include +#include "pstypes.h" +#include "console.h" +#include "text.h" +#include "event.h" +#include "error.h" +#include "joy.h" +#include "args.h" + +extern void arch_sdl_init(); +extern void key_init(); +extern int com_init(); +extern void timer_init(); + +void arch_init_start() +{ + +} + +void arch_init() +{ + // Initialise the library + arch_sdl_init(); + if (!FindArg( "-nojoystick" )) { + con_printf(CON_VERBOSE, "\n%s", TXT_VERBOSE_6); + joy_init(); + } + //added 06/09/99 Matt Mueller - fix nonetwork compile +#ifdef NETWORK + //end addition -MM +//added on 10/19/98 by Victor Rachels to add serial support (from DPH) + if(!(FindArg("-noserial"))) + com_init(); +//end this section addition - Victor + //added 06/09/99 Matt Mueller - fix nonetwork compile +#endif + //end addition -MM + key_init(); +} diff --git a/configure.in b/configure.in index a290b67b..41641067 100644 --- a/configure.in +++ b/configure.in @@ -67,14 +67,16 @@ if test "$host_os" = "msdosdjgpp"; then CFLAGS="-I \$(top_srcdir)/arch/dos/include $CFLAGS" AC_PATH_PROG(NASM, nasm, no) TARGETS=d2x + D2X_ARCH_SUBDIRS=dos else CFLAGS="-pipe $CFLAGS" + D2X_ARCH_SUBDIRS=sdl if test x$MINGW32 = xyes; then - D2X_ARCH_SUBDIRS=win32 + D2X_ARCH_SUBDIRS="win32 ${D2X_ARCH_SUBDIRS}" else - D2X_ARCH_SUBDIRS=linux + D2X_ARCH_SUBDIRS="linux ${D2X_ARCH_SUBDIRS}" fi dnl Check for SDL @@ -227,7 +229,9 @@ Makefile 2d/Makefile 3d/Makefile arch/Makefile +arch/dos/Makefile arch/linux/Makefile +arch/sdl/Makefile arch/win32/Makefile cfile/Makefile iff/Makefile diff --git a/main/Makefile.am b/main/Makefile.am index f802a68d..6597a1d5 100644 --- a/main/Makefile.am +++ b/main/Makefile.am @@ -11,16 +11,16 @@ EXTRA_PROGRAMS = d2x d2x-sdl d2x-ogl d2x-svga d2x-ggi LDFLAGS = -export-dynamic if ENV_DJGPP -ARCH_LIBS = +ARCH_LIBS = ../arch/dos/libarch_dos.a else if MINGW32 -ARCH_LIBS = ../arch/win32/libarch_win32.a +ARCH_LIBS = ../arch/win32/libarch_win32.a ../arch/sdl/libarch_sdl.a else -ARCH_LIBS = ../arch/linux/libarch_linux.a +ARCH_LIBS = ../arch/linux/libarch_linux.a ../arch/sdl/libarch_sdl.a endif endif -d2x_LDADD = ${ARCH_LIBS} ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../video/libvideo.a ../arch/libarch.a ../sound/libsound.a ../input/libinput.a +d2x_LDADD = ${ARCH_LIBS} ../3d/lib3d.a ../2d/lib2d.a ../mem/libmem.a ../cfile/libcfile.a ../iff/libiff.a ../texmap/libtexmap.a ../misc/libmisc.a ../maths/libmaths.a ../video/libvideo.a ../sound/libsound.a ../input/libinput.a if MINGW32 if USE_NETWORK -- 2.39.2