From 7de3445a22509f83ae9166bee1894e9b2395c333 Mon Sep 17 00:00:00 2001 From: theoddone33 <> Date: Thu, 23 May 2002 17:09:35 +0000 Subject: [PATCH] This should fix OpenBSD for good. Thanks Wilbern Cobb and Thorsten Glaser. --- zsnes/linux/AUTHORS | 2 ++ zsnes/src/configure.in | 8 ++++---- zsnes/src/gui/gui.asm | 2 +- zsnes/src/linux/gl_draw.c | 3 +-- zsnes/src/linux/sdlintrf.asm | 1 - zsnes/src/macros.mac | 2 +- zsnes/src/ui.asm | 12 +----------- zsnes/src/zip/zpng.h | 4 ++++ zsnes/srcinfo.txt | 2 +- 9 files changed, 15 insertions(+), 21 deletions(-) diff --git a/zsnes/linux/AUTHORS b/zsnes/linux/AUTHORS index dabd2a95..b24566ff 100644 --- a/zsnes/linux/AUTHORS +++ b/zsnes/linux/AUTHORS @@ -8,4 +8,6 @@ Coding: Aaron Lehmann Patrick "Diablo-D3" McFarland Miscellanious Contributions: + Wilbern Cobb - initial OpenBSD work + Thorsten "mirabile" Glaser - more OpenBSD integration Mitchell "The Khan Artist" Mebane - manpage diff --git a/zsnes/src/configure.in b/zsnes/src/configure.in index 2fb399c4..439fa9e1 100644 --- a/zsnes/src/configure.in +++ b/zsnes/src/configure.in @@ -25,7 +25,7 @@ AC_CANONICAL_SYSTEM case "$target" in *-*-linux*) CFLAGS="$CFLAGS -D__LINUX__" - NFLAGS="$NFLAGS -D__LINUX__ -f elf" + NFLAGS="$NFLAGS -D__LINUX__ -f elf -DELF" ;; *-*-*openbsd*) CFLAGS="$CFLAGS -D__LINUX__ -D__FreeBSD__" @@ -33,7 +33,7 @@ case "$target" in ;; *-*-*bsd*) CFLAGS="$CFLAGS -D__LINUX__ -D__FreeBSD__" - NFLAGS="$NFLAGS -D__LINUX__ -D__FreeBSD__ -f elf" + NFLAGS="$NFLAGS -D__LINUX__ -D__FreeBSD__ -DELF -f elf" ;; *-*-cygwin* | *-*-*ming*) CFLAGS="$CFLAGS -D__LINUX__" @@ -78,7 +78,7 @@ else AC_MSG_ERROR(zlib is required) fi -AC_ARG_WITH(opengl,[ --without-opengl Build without OpenGL support ],with_opengl=no) +AC_ARG_WITH(opengl,[ --without-opengl Build without OpenGL support ],with_opengl=$withval) AC_MSG_CHECKING(for OpenGL support) if test x$with_opengl != xno; then with_opengl=no @@ -100,7 +100,7 @@ else AC_MSG_RESULT(disabled by user) fi -AC_ARG_ENABLE(png, [ --without-png Build without PNG screenshot support ],with_png=no) +AC_ARG_WITH(png, [ --without-png Build without PNG screenshot support ],with_png=$withval) AC_MSG_CHECKING(for libPNG support) if test x$with_png != xno; then with_png=no diff --git a/zsnes/src/gui/gui.asm b/zsnes/src/gui/gui.asm index 6f4f0dab..135bf1ec 100644 --- a/zsnes/src/gui/gui.asm +++ b/zsnes/src/gui/gui.asm @@ -5180,7 +5180,7 @@ NEWSYM GUIFontData db 01000000b db 00100000b db 00010000b - db 00001000b; \ + db 00001000b; \ (Screw you nassm) db 10101000b db 01110000b db 11111000b diff --git a/zsnes/src/linux/gl_draw.c b/zsnes/src/linux/gl_draw.c index 433d388b..dada9d78 100644 --- a/zsnes/src/linux/gl_draw.c +++ b/zsnes/src/linux/gl_draw.c @@ -276,8 +276,7 @@ void gl_drawwin() AddEndBytes = 0; NumBytesPerLine = 1024; WinVidMemStart = (void *) glvidbuffer; - __asm__ __volatile__("call copy640x480x16bwin" - ::: "memory", "eax", "ebx", "ecx", "edx", "esi", "edi"); + copy640x480x16bwin(); /* Display 4 256x256 quads for the 512x448 buffer */ glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, glfilters); diff --git a/zsnes/src/linux/sdlintrf.asm b/zsnes/src/linux/sdlintrf.asm index d5d06949..f96ac9d7 100644 --- a/zsnes/src/linux/sdlintrf.asm +++ b/zsnes/src/linux/sdlintrf.asm @@ -116,7 +116,6 @@ EXTSYM StopServer EXTSYM Disconnect EXTSYM UDPDisableMode,UDPEnableMode,UDPClearVars,UDPWait1Sec EXTSYM WinErrorA2,WinErrorB2,WinErrorC2 -EXTSYM ZsnesPage EXTSYM GetLocalTime EXTSYM V8Mode,GrayscaleMode EXTSYM PrevWinMode,PrevFSMode diff --git a/zsnes/src/macros.mac b/zsnes/src/macros.mac index 9baacd06..9b7c2ef4 100644 --- a/zsnes/src/macros.mac +++ b/zsnes/src/macros.mac @@ -22,7 +22,7 @@ section .text %define ZVERSION '1.337' -%ifdef __LINUX__ +%ifdef ELF %imacro newsym 1 GLOBAL %1 %1: diff --git a/zsnes/src/ui.asm b/zsnes/src/ui.asm index 3cb93f62..90459830 100644 --- a/zsnes/src/ui.asm +++ b/zsnes/src/ui.asm @@ -148,17 +148,7 @@ NEWSYM vibradetect NEWSYM welcome - db 'ZSNES v',ZVERSION,' (c) 1997-2002, ZSNES Team (zsKnight & _Demo_)',13,10 -%ifdef __LINUX__ - db 'Compiled under NASM and GCC. (*nix)',13,10,13,10 -%else -%ifdef __WIN32__ - db 'Compiled under NASM and MSVC++. (Windows)',13,10,13,10 -%else - db 'Compiled under NASM and DJGPP. (DOS w/ DPMI)',13,10,13,10 -%endif -%endif -;%endif + db 'ZSNES v',ZVERSION,' (c) 1997-2002, ZSNES Team (zsKnight & _Demo_)',13,10,13,10 db 'Be sure to check http://www.zsnes.com/ for the latest version.',13,10 db 'Please report crashes to zsnes-devel@lists.sourceforge.net.',13,10,13,10 db ' Main Coders : zsKnight, _Demo_, and pagefault',13,10 diff --git a/zsnes/src/zip/zpng.h b/zsnes/src/zip/zpng.h index 8ce37b83..a2320475 100644 --- a/zsnes/src/zip/zpng.h +++ b/zsnes/src/zip/zpng.h @@ -1,7 +1,11 @@ #ifndef __ZPNG__ #define __ZPNG__ +#ifdef NO_PNG +#undef __PNG__ +#else #define __PNG__ +#endif #ifdef __PNG__ #ifndef bool diff --git a/zsnes/srcinfo.txt b/zsnes/srcinfo.txt index d1b228f4..b3739921 100644 --- a/zsnes/srcinfo.txt +++ b/zsnes/srcinfo.txt @@ -29,7 +29,7 @@ sw_draw.h ; zfilew.c ; zipxw.c ; zloaderw.c ; -zsnes.5 ; man page for zsnes +zsnes.1 ; man page for zsnes ztcp.c ; TCP/IP (Netplay) ; ----------------------------------------------------------------