On Wed, Sep 19, 2007 at 07:43:05PM -0700, Mike Swanson wrote: > Hi, > > I've noticed ZSNES hasn't been updated in years, but I don't really know how > to update it myself (I've tried, but it always fails at compiling at various > ports; knowing emulator authors, it's probably filled with Windows and/or > Linux-specific code anyway). I'm CCing this to both the official maintainer > and the mailing list because I don't know if he's even still around anymore. > Usual improvements are expected, increased compatibility, more features, etc
Here you go. Sound is quite choppy on my notebook, but it's only a 700Mhz PIII. I've enabled support for libao as an alternative to SDL for sound. Check out zsnes --help for supported sound drivers (see -ad flag) and try which one works best for you. This patch would also make me the maintainer in case the original maintainer (Cc'd) times out. I currently also maintain the zsnes port for FreeBSD. > (and a *real* NTSC emulation mode that's to die for). You mean the new NTSC video filter? Looks nice indeed (just like good old TV), but seems to eat lots of CPU :-/ Please test (only works on i386). Index: emulators/zsnes/Makefile =================================================================== RCS file: /cvs/ports/emulators/zsnes/Makefile,v retrieving revision 1.15 diff -u -r1.15 Makefile --- emulators/zsnes/Makefile 16 Sep 2007 00:45:14 -0000 1.15 +++ emulators/zsnes/Makefile 20 Sep 2007 16:57:38 -0000 @@ -3,15 +3,16 @@ ONLY_FOR_ARCHS= i386 COMMENT= Super Nintendo emulator for x86 -VERSION= 1.42 +VERSION= 1.51 DISTNAME= zsnes_${VERSION:S/./_/} PKGNAME= zsnes-${VERSION} CATEGORIES= emulators games HOMEPAGE= http://www.zsnes.com/ -MAINTAINER= Jonathan Schleifer <[EMAIL PROTECTED]> +MAINTAINER= Stefan Sperling <[EMAIL PROTECTED]> MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=zsnes/} +EXTRACT_SUFX= .tar.bz2 DISTFILES= zsnes${VERSION:S/.//}src${EXTRACT_SUFX} # GPL @@ -22,39 +23,42 @@ WANTLIB= GL X11 Xext c m pthread stdc++ usbhid z -BUILD_DEPENDS= ::devel/nasm \ - :automake-1.4.*:devel/automake/1.4 +BUILD_DEPENDS= ::devel/nasm + LIB_DEPENDS= SDL:sdl-*-!no_x11:devel/sdl \ - png.>=2::graphics/png + png.>=2::graphics/png \ + ao.>=3::audio/libao USE_X11= Yes +USE_GMAKE= Yes -AUTOCONF_VERSION= 2.59 +AUTCONF_VERSION= 2.61 CONFIGURE_STYLE= autoconf CONFIGURE_ARGS= --with-sdl-prefix=${LOCALBASE} \ --with-png \ --with-opengl \ - --target=${MACHINE}-unknown-openbsd${OPSYS_VER} + --target=${MACHINE}-unknown-openbsd${OPSYS_VER} \ + --enable-libao \ + --enable-release \ + --disable-debugger CONFIGURE_ENV+= LDFLAGS="-lm" \ + force_arch=${MACHINE} \ CFLAGS="${CFLAGS:N-O*} -I${X11BASE}/include -I${LOCALBASE}/include/libpng" -ALL_TARGET= +ALL_TARGET= WRKSRC= ${WRKDIST}/src - NO_REGRESS= Yes - -post-extract: - rm -fr ${WRKSRC}/obj +DOCSDIR= ${PREFIX}/share/doc/zsnes post-patch: - cd ${WRKSRC} && AUTOMAKE_VERSION=1.4 ${LOCALBASE}/bin/aclocal + cd ${WRKSRC} && AUTOMAKE_VERSION=1.9 ${LOCALBASE}/bin/aclocal -DOCSDIR= ${PREFIX}/share/doc/zsnes +post-extract: + rm -fr ${WRKSRC}/obj post-install: + rmdir ${PREFIX}/man/man3f ${PREFIX}/man/cat3f ${INSTALL_DATA_DIR} ${DOCSDIR} - ${INSTALL_DATA} ${WRKDIST}/docs/Linux/*.* ${DOCSDIR} - ${INSTALL_DATA_DIR} ${DOCSDIR}/images - ${INSTALL_DATA} ${WRKDIST}/docs/Linux/images/* ${DOCSDIR}/images + ${INSTALL_DATA} ${WRKDIST}/docs/readme.txt/*txt ${DOCSDIR} .include <bsd.port.mk> Index: emulators/zsnes/distinfo =================================================================== RCS file: /cvs/ports/emulators/zsnes/distinfo,v retrieving revision 1.6 diff -u -r1.6 distinfo --- emulators/zsnes/distinfo 5 Apr 2007 15:38:09 -0000 1.6 +++ emulators/zsnes/distinfo 20 Sep 2007 16:57:38 -0000 @@ -1,5 +1,5 @@ -MD5 (zsnes142src.tar.gz) = 4/zBMGHhaRlOwxwnrOG25w== -RMD160 (zsnes142src.tar.gz) = 15TGnodiZXFeFBwm7LbtGAL/wn0= -SHA1 (zsnes142src.tar.gz) = 04yowbQWjtxbtYFfUEtSZUEAvEs= -SHA256 (zsnes142src.tar.gz) = 8G7xTbjT/a6dfBJEKlLlNaX+7hyxjHi1GnTtKC7YdL4= -SIZE (zsnes142src.tar.gz) = 1102840 +MD5 (zsnes151src.tar.bz2) = MoBxd1+I98O5/blBduXkFw== +RMD160 (zsnes151src.tar.bz2) = M3QHv35VFrzXvzEMexfW0SqUh1A= +SHA1 (zsnes151src.tar.bz2) = A981SQhwyZUNcBB0fQVGyFJcA2I= +SHA256 (zsnes151src.tar.bz2) = 6wE/gk9amBSnFM8Nquo+poocdP10HlsJefy3lkI2qGY= +SIZE (zsnes151src.tar.bz2) = 1071712 Index: emulators/zsnes/patches/patch-src_Makefile_in =================================================================== RCS file: emulators/zsnes/patches/patch-src_Makefile_in diff -N emulators/zsnes/patches/patch-src_Makefile_in --- emulators/zsnes/patches/patch-src_Makefile_in 21 Oct 2005 18:07:10 -0000 1.4 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,20 +0,0 @@ -$OpenBSD: patch-src_Makefile_in,v 1.4 2005/10/21 18:07:10 naddy Exp $ ---- src/Makefile.in.orig Mon Oct 3 23:10:46 2005 -+++ src/Makefile.in Mon Oct 3 23:10:51 2005 -@@ -76,13 +76,13 @@ OBJS=${CHIPSOBJ} ${CPUOBJ} ${WINOBJ} ${W - - .SUFFIXES: .cpp .c .asm - --%.o: %.cpp -+.cpp.o: - @CXX@ @CFLAGS@ -o $@ -c $< - --%.o: %.c -+.c.o: - @CC@ @CFLAGS@ -o $@ -c $< - --%.o: %.asm -+.asm.o: - @NASMPATH@ @NFLAGS@ -o $@ $< - - ALL: @ZSNESEXE@ Index: emulators/zsnes/patches/patch-src_cfgload_c =================================================================== RCS file: emulators/zsnes/patches/patch-src_cfgload_c diff -N emulators/zsnes/patches/patch-src_cfgload_c --- emulators/zsnes/patches/patch-src_cfgload_c 21 Oct 2005 18:07:10 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,21 +0,0 @@ -$OpenBSD: patch-src_cfgload_c,v 1.1 2005/10/21 18:07:10 naddy Exp $ ---- src/cfgload.c.orig Tue Oct 4 00:12:19 2005 -+++ src/cfgload.c Tue Oct 4 00:13:22 2005 -@@ -68,7 +68,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg - #define ASCIIChar2Bool(x) (((x)-'0') ? 1 : 0) - - extern char CMDLineStr[256]; --extern char LoadDir[128]; -+extern char LoadDir[1024]; - extern char LoadDrive[2]; - - extern unsigned int pl2selk; -@@ -146,7 +146,7 @@ extern char zcfgdir[1024]; - char SRAMDir[1024]; - - char LoadDriveB[2]; --char LoadDirB[128]; -+char LoadDirB[1024]; - - //extern "C"{ - unsigned char cfgsoundon = 0; Index: emulators/zsnes/patches/patch-src_configure_in =================================================================== RCS file: /cvs/ports/emulators/zsnes/patches/patch-src_configure_in,v retrieving revision 1.7 diff -u -r1.7 patch-src_configure_in --- emulators/zsnes/patches/patch-src_configure_in 21 Oct 2005 18:07:10 -0000 1.7 +++ emulators/zsnes/patches/patch-src_configure_in 20 Sep 2007 16:57:38 -0000 @@ -1,48 +1,12 @@ $OpenBSD: patch-src_configure_in,v 1.7 2005/10/21 18:07:10 naddy Exp $ ---- src/configure.in.orig Mon Oct 3 23:11:56 2005 -+++ src/configure.in Mon Oct 3 23:14:21 2005 -@@ -39,7 +39,7 @@ case "$target" in - ;; - *-*-*openbsd*) - CFLAGS="$CFLAGS -D__LINUX__ -D__FreeBSD__" -- NFLAGS="$NFLAGS -D__LINUX__ -D__FreeBSD__ -D__OpenBSD__ -f aoutb" -+ NFLAGS="$NFLAGS -D__LINUX__ -D__FreeBSD__ -D__OpenBSD__ -DELF -f elf" - ;; - *-*-*bsd*) - CFLAGS="$CFLAGS -D__LINUX__ -D__FreeBSD__" -@@ -118,34 +118,9 @@ if test x$debug = xyes; then - else - AC_MSG_RESULT(no) - -- CFLAGS="$CFLAGS -O3 -ffast-math -fomit-frame-pointer -fexpensive-optimizations -s" -+ CFLAGS="$CFLAGS -O3 -ffast-math -fomit-frame-pointer -fexpensive-optimizations" - NFLAGS="$NFLAGS -O1" - ZSNESEXE="zsnes" --fi -- --AC_MSG_CHECKING(which processor class to optimize for) --if test x$debug != xyes; then -- case "$target" in -- i486-*-*) -- CFLAGS="$CFLAGS -march=i486" -- AC_MSG_RESULT(486) -- ;; -- i586-*-*) -- CFLAGS="$CFLAGS -march=pentium" -- AC_MSG_RESULT(586) -- ;; -- i686-*-*) -- CFLAGS="$CFLAGS -march=pentiumpro" -- dnl CFLAGS="$CFLAGS -march=pentium3 -mmmx -msse -mfpmath=sse,387" -- AC_MSG_RESULT(686) -- ;; -- *) -- AC_MSG_RESULT(386) -- AC_MSG_WARN(*** This is probably not what you want use --target) -- ;; -- esac --else -- AC_MSG_RESULT(no optimization because debug enabled) - fi - - dnl Checks for header files. +--- src/configure.in.orig Thu Sep 20 17:26:57 2007 ++++ src/configure.in Thu Sep 20 17:27:09 2007 +@@ -292,7 +292,7 @@ else + if test x$force_arch = x; then + AC_MSG_WARN([If you intend to distribute this binary, make sure you use force_arch and set to i586 (or whichever CPU Arch you intend for)]) + fi +- CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fprefetch-loop-arrays -fforce-addr $STRIP -D__RELEASE__" ++ CFLAGS="$CFLAGS -O3 -fomit-frame-pointer -fforce-addr $STRIP -D__RELEASE__" + NFLAGS="$NFLAGS -O99999999 -D__RELEASE__" + else + CFLAGS="$CFLAGS -O3 -fomit-frame-pointer $STRIP" Index: emulators/zsnes/patches/patch-src_effects_smoke_c =================================================================== RCS file: emulators/zsnes/patches/patch-src_effects_smoke_c diff -N emulators/zsnes/patches/patch-src_effects_smoke_c --- emulators/zsnes/patches/patch-src_effects_smoke_c 21 Oct 2005 18:07:10 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,15 +0,0 @@ -$OpenBSD: patch-src_effects_smoke_c,v 1.1 2005/10/21 18:07:10 naddy Exp $ ---- src/effects/smoke.c.orig Mon Oct 3 23:21:02 2005 -+++ src/effects/smoke.c Mon Oct 3 23:21:35 2005 -@@ -13,9 +13,10 @@ Should be fire, but looks more like smok - - */ - -- -+#ifndef MIN - #define MIN(x, y) \ - (((x) < (y)) ? (x) : (y)) -+#endif - - #define ABS(x) \ - (((x) >= 0) ? (x) : ( - (x))) Index: emulators/zsnes/patches/patch-src_gblhdr_h =================================================================== RCS file: emulators/zsnes/patches/patch-src_gblhdr_h diff -N emulators/zsnes/patches/patch-src_gblhdr_h --- emulators/zsnes/patches/patch-src_gblhdr_h 21 Oct 2005 18:07:10 -0000 1.3 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,14 +0,0 @@ -$OpenBSD: patch-src_gblhdr_h,v 1.3 2005/10/21 18:07:10 naddy Exp $ ---- src/gblhdr.h.orig Mon Oct 3 23:14:52 2005 -+++ src/gblhdr.h Mon Oct 3 23:15:10 2005 -@@ -72,9 +72,7 @@ Foundation, Inc., 675 Mass Ave, Cambridg - - // unistd.h stuff - -- //#if HAVE_UNISTD_H -- //Small hack for now -- #if unix -+ #if HAVE_UNISTD_H - #include <sys/types.h> - #include <unistd.h> - #endif Index: emulators/zsnes/patches/patch-src_linux_zfilew_c =================================================================== RCS file: emulators/zsnes/patches/patch-src_linux_zfilew_c diff -N emulators/zsnes/patches/patch-src_linux_zfilew_c --- emulators/zsnes/patches/patch-src_linux_zfilew_c 21 Oct 2005 18:07:10 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,38 +0,0 @@ -$OpenBSD: patch-src_linux_zfilew_c,v 1.1 2005/10/21 18:07:10 naddy Exp $ ---- src/linux/zfilew.c.orig Fri Jan 14 14:11:19 2005 -+++ src/linux/zfilew.c Tue Oct 4 00:42:40 2005 -@@ -459,7 +459,7 @@ DWORD GetDate() - } - - extern char SRAMDir[1024]; --extern char LoadDir[512]; -+extern char LoadDir[1024]; - - #ifdef __LINUX__ - -@@ -474,11 +474,12 @@ void obtaindir() - - if ((homedir = (char *)getenv("HOME")) == 0) - { -- homedir = (char *)malloc(ZCFG_DIR_LEN); -- getcwd(homedir, ZCFG_DIR_LEN); -+ getcwd(zcfgdir, ZCFG_DIR_LEN); - } -- strcpy(zcfgdir, homedir); -- free(homedir); -+ else -+ { -+ strcpy(zcfgdir, homedir); -+ } - strcat(zcfgdir, ZCFG_DIR); - tmp = opendir(zcfgdir); - if (tmp == NULL) -@@ -496,7 +497,7 @@ void obtaindir() - } - if (*LoadDir == 0) - { -- getcwd(LoadDir, 512); -+ getcwd(LoadDir, 1024); - } - } - Index: emulators/zsnes/patches/patch-src_tools_fileutil_h =================================================================== RCS file: emulators/zsnes/patches/patch-src_tools_fileutil_h diff -N emulators/zsnes/patches/patch-src_tools_fileutil_h --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ emulators/zsnes/patches/patch-src_tools_fileutil_h 20 Sep 2007 16:57:38 -0000 @@ -0,0 +1,11 @@ +$OpenBSD$ +--- src/tools/fileutil.h.orig Thu Sep 20 12:53:50 2007 ++++ src/tools/fileutil.h Thu Sep 20 12:54:45 2007 +@@ -23,6 +23,7 @@ This is part of a toolkit used to assist in ZSNES deve + #define FILEUTIL_H + + #include <string.h> ++#include <unistd.h> + #include <sys/stat.h> + + void parse_dir(const char *, void (*func)(const char *, struct stat&)); Index: emulators/zsnes/patches/patch-src_ui_asm =================================================================== RCS file: emulators/zsnes/patches/patch-src_ui_asm diff -N emulators/zsnes/patches/patch-src_ui_asm --- emulators/zsnes/patches/patch-src_ui_asm 21 Oct 2005 18:07:11 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,12 +0,0 @@ -$OpenBSD: patch-src_ui_asm,v 1.1 2005/10/21 18:07:11 naddy Exp $ ---- src/ui.asm.orig Tue Oct 4 00:11:28 2005 -+++ src/ui.asm Tue Oct 4 00:11:51 2005 -@@ -1237,7 +1237,7 @@ NEWSYM gotoroot, db '\',0 - - SECTION .bss - NEWSYM InitDir, resb 512 --NEWSYM LoadDir, resb 512 -+NEWSYM LoadDir, resb 1024 - - SECTION .text - Index: emulators/zsnes/pkg/PLIST =================================================================== RCS file: /cvs/ports/emulators/zsnes/pkg/PLIST,v retrieving revision 1.4 diff -u -r1.4 PLIST --- emulators/zsnes/pkg/PLIST 21 Oct 2005 18:07:11 -0000 1.4 +++ emulators/zsnes/pkg/PLIST 20 Sep 2007 16:57:38 -0000 @@ -1,29 +1,15 @@ [EMAIL PROTECTED] $OpenBSD: PLIST,v 1.4 2005/10/21 18:07:11 naddy Exp $ [EMAIL PROTECTED] $OpenBSD$ bin/zsnes @man man/man1/zsnes.1 share/doc/zsnes/ -share/doc/zsnes/about.htm -share/doc/zsnes/bugs.htm -share/doc/zsnes/credits.htm -share/doc/zsnes/faq.htm -share/doc/zsnes/gui.htm -share/doc/zsnes/images/ -share/doc/zsnes/images/cheat.png -share/doc/zsnes/images/config.png -share/doc/zsnes/images/corner.png -share/doc/zsnes/images/f1_menu.png -share/doc/zsnes/images/game.png -share/doc/zsnes/images/get.png -share/doc/zsnes/images/gui.png -share/doc/zsnes/images/linuxlogo.png -share/doc/zsnes/images/misc.png -share/doc/zsnes/images/netplay.png -share/doc/zsnes/images/quick.png -share/doc/zsnes/images/safer.png -share/doc/zsnes/images/valid-xhtml11.png -share/doc/zsnes/images/vcss.png -share/doc/zsnes/images/zsneslogo.png +share/doc/zsnes/about.txt +share/doc/zsnes/advanced.txt +share/doc/zsnes/faq.txt +share/doc/zsnes/games.txt +share/doc/zsnes/gui.txt +share/doc/zsnes/history.txt +share/doc/zsnes/index.txt share/doc/zsnes/license.txt -share/doc/zsnes/netplay.htm -share/doc/zsnes/readme.htm -share/doc/zsnes/style.css +share/doc/zsnes/netplay.txt +share/doc/zsnes/readme.txt +share/doc/zsnes/support.txt -- stefan http://stsp.name PGP Key: 0xF59D25F0
pgpYCjKLk82QW.pgp
Description: PGP signature