summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorben <ben@pkgsrc.org>2006-03-18 15:56:00 +0000
committerben <ben@pkgsrc.org>2006-03-18 15:56:00 +0000
commitcbe1d25cfce89117fcf6ce510935567413a9d01c (patch)
tree0a228286e0f3b743ca2768b0a987b5f9e3e89607 /emulators
parentb0ae99e8a616f97887c87e7950ff59cd2e54340e (diff)
downloadpkgsrc-cbe1d25cfce89117fcf6ce510935567413a9d01c.tar.gz
Upgrade snes9x to version 1.43. May affect PR#33084.
Builds but does not run correctly on amd64 and sparc64. Unix-specific changes include: * Removed bundled zlib in favour of detecting the system zlib. * Fixed mouse offset in resized X11 window. * Fixed compilation on AMD64. * Rewrote keyboard setup code * Unmap all joystick buttons before applying -joymapX * Loading a zip file on binaries without zip support will give an appropriate error message * Added install target with proper --prefix handling. * Added VPATH handling. * Added fallback to C-core if configure can't find nasm. * Changed the default controller setting to use just the plain SNES controller pad. Mouse, Superscope and multiplayer adapters are now turned off by default. This reflects how the Windows port has been doing it for some time. * Added a new command line option: -sdd1-pack * Fixed the x86 SuperFx assembler core. * Added possibility to enable the debugger via configure. * Moved full screen button from 'Print Screen' to 'Alt'+'Return'. * Added screenshot capability. Available by pressing 'Print Screen'. * Fixed OpenGL target. * Fixed sound on some big endian Linux systems. General changes include: - Rewrote Unfreeze, renamed it S9xUnfreezeFromStream, failing to load a freeze file no longer resets emulation (blip) - Fixed Unfreeze to restore IPPU.HDMA properly (blip) - Rewrote OBC1 code to match the real chip (Overload) - More updates the to DSP-1 code, fixes to projection (Overload, Andreas Naive) - Added movie recording+rerecording support (blip, Bisqwit) - Added -hidemenu CLI switch (funkyass) - Added internal support for emulating the new-style SNES (MKendora) - Cleaned up many quirks of the cheat search engine (MKendora, Don Vincenzo) - Fix mosaic in hires SNES modes (Tokimeki Memorial) (MKendora, zones) - Rewrote Legend's hack, added another game to it (MKendora) - Optimized the Open ROM dialog (MKendora) - Rewrote the Seta DSP map (The Dumper, MKendora) - Began string isolation for the UI, eases translation (funkyass) - added -nopatch -nocheat, and -cheat CLI items (MKendora) - fixed a UI typo (funkyass) - fixed several C core stack ops in emulation mode (MKendora) - split emulation mode ops from native mode ops (MKendora) - Seta special chip emulation enhancements (Feather, The Dumper, Overload, MKendora) - code tweaks to the ST010 (Nach, pagefault) - fix some C/asm quirks and HDMA quirks (all my fault) (MKendora) - several timing hacks to fix games (lantus) - improved checksumming for odd mirrorings (MKendora) - Snes9x uses a standard zlib instead of a packaged one (PBortas) - Exhaust Heat 2 and regional ports are playable (Feather, The Dumper, Overload, MKendora) - Game Doctor dumps that are 24 Mbit are now supported by a force option (MKendora, Nach) - SuperFx interleave format is now considered deprecated. Support will be removed in future versions (Team decision) - made SuperFx interleave detection a compile option (MKendora) - added memory maps for slotted games (MKendora) - fixed a typo in the usage messages (MKendora) - fixed the bug that had nuked optimizations (The Dumper) - restored full speed optimizations in release builds (funkyass) - Added non-speed-hack version of color subtraction. (zones) - OpenGL info message font fix (zones) - APU timer fix (zones, Nach) - Fixed mouse offset in resized X11 window. (PhaethonH) - Fixed a (presumably) long-standing bug: Mode 6's BG is depth 4, not depth 8! (anomie) - Dreamcast: Added SH4 assembler (PBortas, Marcus Comstedt, Per Hedbor) - C90 and aclocal 1.8 warning fixes (thanks Ville Skytt� (PBortas) - Added support for NSRT Team's JMA format (Nach, NSRT Team, funkyass) - Added 8-bit rendering filters (funkyass) - Added Sanity Checks for the Display Dialog (funkyass) - New Layout for the Joypad Dialog, (funkyass) - Fixed that anoying Joypad dialog bug. Now check to see if the axis exists before asking for the info form it (funkyass) - Added full POV support. (funkyass) - Fixed sram sizes for SuperFx games (Nach, MKendora) - Stopped saving sram for games with no battery (Nach, Mkendora) - stack wrapping fix in C core (MKendora) - removed some dead hacks (Oda Nobunaga and Dezaemon) (MKendora) - fixed some DMA and HDMA modes (anomie, MKendora) - improved HDMA timing (anomie) - cleaned up load and deinterleave code (MKendora) - removed old UI DLL (MKendora) - new cheat dialogs (MKendora) - Implement odd sprite sizes, sprite priority rotation. (anomie) - RTO code that hopefully works. MK's #define is "MK_DEBUG_RTO" to try to debug the RTO code. (anomie) - SDD1 decompression support for Linux. Also added a new command line option -sdd1-pack. (anomie) - Added correct VRAM read logic. #define CORRECT_VRAM_READS if you want it. (anomie) - removed the non-VAR_CYCLES path (MKendora) - changed access timing map to be address-based. (MKendora, anomie) - DSP-1 updates (Overload, Andreas Naive) - S-DD1 decompression support (Andreas Naive) - optimized S-DD1 code (anomie) - S-DD1 can use packs or decompression (MKendora) - More work on Exhaust Heat 2 (MKendora, Overload, The Dumper) - separated ROM detection from file reading (lantus) - fixed a mirroring bug in LoROMs (MKendora) - cleaned up some mapping issues (MKendora) - ST018 games now boot before locking up (Mkendora, Overload) - SA-1 state was not completely reset, crashed Marvelous (zones) - Removed sample caching. It caused problems, and was not noticably faster. (MKendora) - Fixed interlace without breaking the displays for MK (anomie) - Fixed a PPU OpenBus hack (anomie) - Moved SPC7110 and S-DD1 regs to speed up the general case of reading the $4xxx registers (MKendora) - altered Hi/Lo ROM detection to fix a few misdetects. (MKendora) - Implemented RTO flags. With MK's implementation of $213F's interlace bit, we now pass the SNES Test Cart's Electronics Test (anomie) - Fix sprite windowing bug (anomie) - cleaned up the hacks section somewhat (MKendora) - removed some interleave hacks (MKendora) - fixed a bug in KartContents (MKendora) - transparency fix for Jurassic Park (lantus) - Kludged Mark Davis until I get stable APU timing (MKendora) - Fixed an FMOD bug (MKendora) - cosmetic tweaks (Everyone) - Fixed 2 special chip bugs in the C core (zones) - Added some sanity fixes to the C core, fixes MLBPA Baseball for C core users (zones) - updated zlib source (includes 1.1.4-1 patch) (MKendora) - compiler warning fixes (PBortas) - Updated the SuperFx asm core (pagefault) - Hacked Robocop vs. Terminator using Daffy Duck hack. Stops flashing. (MKendora) - Added some defines to the asm core (MKendora) - Initialize the C SuperFx core better (PBortas) - Kludge a Japanese golf game until the APU timing is fixed (MKendora) - Oops, in the asm CPU core i was stomping on %eax too early, so register $4210 wasn't getting set properly. (anomie) - Generic accuracy fix in main SUperscope emulation (MKendora) - sprite bug fixed (gah! How'd we miss that) (anomie) - SPC saving compatibility fix (Caz and zones) - Window clipping update (anomie) - Mode 7 clipping fix (TRAC) - latching fix (anomie) - BS BIOS checksum and mapping fix (MKendora) - Working Uniracers hack (dma.cpp) (anomie) - HDMA Indirect Address fix for Romancing Saga 2 (anomie) - Better savestate hack, does it break anything? (anomie) - C4 C core fixes. Mostly Trapezoid (thanks Nach), some s/short/int16/, some indentation. (anomie) - Damn, but the indentation in ppu.cpp was screwed up. Killed some dead code too (twas commented forevermore). (anomie) - fixed a potential crash in S-DD1 logging (MKendora) - Improved accuracy of Hi/LoROM detection (~500 ROM test) (MKendora) - Hack for Moryou Senki Madara 2, don't call SelectTileRenderer from DrawOBJS if BGMode is 5 or 6. A real fix requires at least rewriting SelectTileRenderer, or inlining a special version in DrawOBJS. (anomie) - DMA traces: add additional address info to reads too. (anomie) - Killed the old Borland Joypad dialog (funkyass) - Fixed issues with Dezaemon and CT, maybe others (anomie, MKendora) - Changed the internal snapshot key from \ to VK_F12 (funkyass) Fixes issues with non-US keyboard layouts. - Fixed OAM reset to not occur during forced blank. (anomie) - Killed some dead OAM reset code that doesn't need saving. (anomie) - Fixed OAM reset timing (beginning of V-Blank rather than end) for R-TYPE 3 (J). (anomie) - Tweaked the About Dialog so its read-only and no scroll (funkyass) - cleaned up a sound skipping code issue. Same as the RTC issue (lantus) - re-fixed the invalid BRR header behavior twice (Lord Nightmare, FatlXception, Mkendora) - More BS mapping fixes. (The Dumper, MKendora) - Fixed Ranma Bun no 1 - Chonai Gekitou Hen (J) and Street Combat (U). Interlace is not supported in the non-Hi-res modes, as far as I can tell. (MKendora) - Also fixes Maka Maka (J). Frank Yang's report, and anomie's code both provided clues to this one. - Removed special casing on setting 5c77 version to one. This seems to be true for U and J units always. I need it checked out on PAL... (neviksti) - Using SNEeSe's values for 5c78 and 5A22. Note we know that the 5c78 version can also be 1 or 2, instead of 3. (TRAC, neviksti) - Added turbo buttons. Credit/blame for the design goes to slack, Nave, Gogo, and myself. (MKendora) - fixed a bug in turbo (slack, MKendora) - Tried merging the behavior of Old $4200 with new $4200 (MKendora) - Made $4200's return value match what VSMC Explorer showed on Fancia's SNES (MKendora) - Fixed a matrix multiplcation bug in ZSNES state loads (MKendora) - Fixed Dezaemon and Ys3 mode 7 (lantus) - Fixed H-DMA modes 5-7. Thanks to The Dumper for the extra motivation needed. GunForce and Genocide 2 work. (The Dumper, MKendora) - Fixed BG3 Priority. I'm stupid. anomie had fixed it, but lantus fixed it again, because I didn't use it. (anomie, lantus) - Added a Star Fox 2 hack, and an interleave skip (The Dumper, lantus, MKendora) - Cleared BS setting on load (lantus) - Fix for Mode 7 priorities. fixes F-1 Grand Prix (all 3) (anomie) - JANJYU GAKUEN 2 needs Multi-tap 5 off. (Frank Yang, MKendora) - HONKAKUHA IGO GOSEI: No multi-tap 5, allow mouse (lantus, MKendora) - Added a few missed conditional compiles (Nach) - disabled multitap 5 by default, added menu to enable (MKendora) - special thanks to anomie and lantus. One of them is responsible for a bug fix I forgot already. (anomie, lantus) - Removed several Multitap5 disable hacks. (MKendora) - Added an SPC dumping upgrade from kode54 (kode54) - cleaned up some resource leaks (MKendora) - I forgot this since 1.39mk, but SPC700 flag fixes (anomie) - Mode 7 interpolation screen flip fix (anomie) - Updated SPC7110 code a bit, for compatibility (Daniel, anomie) - Changed RTC saving. (Byte exact to old format on Win32) The submitted patch for "safety" doubled the file size, so I had to write it in explicitly little-endian. (MKendora) - Removed the old hidden cursor (MKendora) - Applied a WAI correction from anomie. (anomie) - Added a patch for Pseudo hi-res (anomie) - Hacked around Word writes to $7F:FFFF. Thanks to lantus and The Dumper for verification. (MKendora) - PPC compile fix? and debugger reversion (anomie) - Set defaults differently to improve sound quality. (MKendora) - Clear Force load settings after Init (lantus) - Made menu reset a soft reset. Fixed BL Sound Test & more (CaitSith2) - Fixed word writes to block bounds in asm core. (MKendora) - redone version of my bounds fix, only this one WORKS! (TRAC) - Thanks to TRAC for the AT&T syntax refresher! (TRAC) - Fixed screen saver disable (kode54) - Fixed OAM and sprite priority in the asm core (anomie) - Proper Interlace fix for mid-frame changes (anomie) - Fixed OpenGL to accomodate previous patch (MKendora) - Fixed ROM Info bugs (_pentium_five, MKendora) - Fixed non-stretched interlacing, but it's s.l.o.w. (anomie) - Superscope and Mouse need to be enabled by the menu. (MKendora) - Fixed HiROM sram reads in asm and C cores (anomie, MKendora) - Added Company 48 to the list. Thanks to _pentium_five_ (StatMat) - Set Super Drift Out's S-ram correctly. (Snes9xppSE Team) - Fixed NTSC timing. Helps ToP Intro greatly (kode54) - Added several entries to the company list, from uCON64 (Nach) - Lots more companies (StatMat, Nach) - Added ZSNES OBC1 code ported from asm to C (sanmaiwashi) - Implemented Justifier emulation (neviksti, MKendora) - Fixed Rudora no Hihou's clip window bug (anomie) - Fixed Flintstones sprite issue (lantus) - Fixed sram mappings for Big Sky Troopers and Taikyoku - IGO Goliath. Both map in bank F0 (MKendora) - Fixed a possible crash when switching audio settings (MKendora) - Added per-pack gfx pack configuration (MKendora) - Fixed glitches in DSP-1 games (Flintstones fix) (lantus) - Added delay to Superscope latching. Fixes X-Zone. (neviksti, MKendora, zones) - Added DSP-2 support (Overload, The Dumper, Lord Nightmare, MKendora, neviksti) - Fixed Super Bases Loaded 2 (and J/K ports) DSP-1 seems to ignore the A15 line in LoROM maps (MKendora) - Corrected $4200 again (The Dumper) - Corrected $2100, $2102, and $2102 read behavior (anomie) - Fixed Cancel on the Sound Options dialog. (MKendora) - Fixed the sound options dialog (Thanks, Quattro) (MKendora) - updated DSP-1 support to match chip better (Overload, neviksti, The Dumper) - added a few Ops to the DSP-4 routine (Nothing plays yet) (neviksti, The Dumper, Overload, MKendora) - added screenshot support (anomie, sanmaiwashi) - stubbed the ST010 chip in Exhaust Heat 2 (Overload, MKendora) - hacked around War 2410's lockup (pagefault, _Demo_, MKendora) - updated tests for type 1 ROMs (based on reset vector) (MKendora) - Emulation mode CPU fix (The Dumper) - Open Bus fixes (anomie) - Better Expansion port emulation (anomie) - More Open Bus fixes (Overload, anomie) - HDMA fixes (fix colors only in Full Throttle Racing) (anomie) - Migrated DKJM2 onto the Tales map (MKendora) - Tried to remove Dragon Knight 4 hack (LoROM sram fix) (MKendora) - Fixed ROM Mirroring for LoROMs (<= 32 Mbit) (MKendora, TRAC) - blocked wram to wram DMAs (neviksti) - fixed HiROM mirroring, too. Thanks TRAC! (MKendora, TRAC) - fixed C core RMW and Push ops to write in the correct order, fixes Michael Jordan gfx. (anomie, Overload, MKendora) - set RDIO to start as 0xFF, fixes SuperFx games. (anomie, Overload) - New connect dialog (funkyass) - better conditional compile of FMOD (funkyass) - fixed screenshot code when libpng is not used (funkyass) - added portability fixes (zones) - fixed asm Pushes (anomie) - fixed asm LoROM s-ram decode (MKendora) - migrated DEZAEMON to standard LoROM map (MKendora) - fixed the Madara 2 OpenGL bug (key found in Rudra) (MKendora) - fixed asm RMW instructions (MKendora) - fixed ADC opcode (The Dumper) - added DSP-2 Op09 (The Dumper) - updated C4 C code (anomie) - updated C4 asm code (Nach) - Keep OpenGL in ratio (kode54) - Replaced many more Borland dialogs (funkyass, MKendora, Nach) - Added CRC32 to displayed ROM Info (Nach, MKendora) - Fix cheat support (The Dumper) - improved DMA timing (MKendora, Overload, The Dumper) - Fixed Mode 7 math, removed Dezaemon, Gaia, Ys 3 hacks (TRAC, MKendora) - Mode 7 flip fix (TRAC) - Multiple safety and initialization fixes (zones) - Platform safety fixes (PBortas) - Memmap cleanups (MKendora) - More preliminary work on special chips (The Dumper, Overload, MKendora) - Added color coding (MKendora) - Another HDMA fix (anomie) - added another known hack to the hacked games list (Nach) - ToP memmap changes (MKendora) - Checksum calculation changes (MKendora) - Special cased a few games for OAM issues (MKendora) - Reverted OAM reset to 1.39 timing (MKendora) - Reworked vram wrapping (zones, Mkendora) - Fixed $4210 and Super Professional Baseball 2 (Overload, MKendora) - Fixed APU RAM init (Overload, MKendora) - More support for Exhaust Heat 2 (not playable) (The Dumper, Overload, neviksti) - removed some debris from save states (MKendora) - fixed? Doom's save state bug (MKendora) - simple overdump detection warning (MKendora)
Diffstat (limited to 'emulators')
-rw-r--r--emulators/snes9x/Makefile45
-rw-r--r--emulators/snes9x/PLIST15
-rw-r--r--emulators/snes9x/distinfo40
-rw-r--r--emulators/snes9x/patches/patch-aa135
-rw-r--r--emulators/snes9x/patches/patch-ab12
-rw-r--r--emulators/snes9x/patches/patch-ac20
-rw-r--r--emulators/snes9x/patches/patch-ad9
-rw-r--r--emulators/snes9x/patches/patch-ae6
-rw-r--r--emulators/snes9x/patches/patch-af6
-rw-r--r--emulators/snes9x/patches/patch-ag106
-rw-r--r--emulators/snes9x/patches/patch-ah4
-rw-r--r--emulators/snes9x/patches/patch-ai6
-rw-r--r--emulators/snes9x/patches/patch-aj9
-rw-r--r--emulators/snes9x/patches/patch-ak9
-rw-r--r--emulators/snes9x/patches/patch-al9
-rw-r--r--emulators/snes9x/patches/patch-am7
-rw-r--r--emulators/snes9x/patches/patch-an7
-rw-r--r--emulators/snes9x/patches/patch-ao15
-rw-r--r--emulators/snes9x/patches/patch-ap97
-rw-r--r--emulators/snes9x/patches/patch-aq193
20 files changed, 483 insertions, 267 deletions
diff --git a/emulators/snes9x/Makefile b/emulators/snes9x/Makefile
index 742cfa35ee3..234142cdcb4 100644
--- a/emulators/snes9x/Makefile
+++ b/emulators/snes9x/Makefile
@@ -1,32 +1,35 @@
-# $NetBSD: Makefile,v 1.34 2006/03/18 13:28:53 ben Exp $
+# $NetBSD: Makefile,v 1.35 2006/03/18 15:56:00 ben Exp $
-DISTNAME= s9xs139
-PKGNAME= snes9x-1.39
-PKGREVISION= 4
+SNESVER= 1.43
+DISTNAME= snes9x-${SNESVER}-src
+PKGNAME= snes9x-${SNESVER}
CATEGORIES= emulators
-MASTER_SITES= http://www.snes9x.com/zips/
-EXTRACT_SUFX= .zip
+MASTER_SITES= http://www.lysator.liu.se/snes9x/${SNESVER}/ \
+ http://files.ipherswipsite.com/snes9x/ \
+ http://vincent.grigorieff.free.fr/snes9x/
MAINTAINER= ben@NetBSD.org
HOMEPAGE= http://www.snes9x.com/
COMMENT= Super Nintendo Entertainment System (SNES) emulator
-WRKSRC= ${WRKDIR}/release
+WRKSRC= ${WRKDIR}/${DISTNAME}/snes9x
USE_TOOLS+= gmake
PTHREAD_OPTS+= require
INSTALLATION_DIRS= bin
+GNU_CONFIGURE= YES
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/snes9x ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/offsets ${PREFIX}/bin
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/snes9x
- ${INSTALL_MAN} ${WRKSRC}/CHANGES.TXT ${PREFIX}/share/doc/snes9x
- ${INSTALL_MAN} ${WRKSRC}/COPYRIGHT.TXT ${PREFIX}/share/doc/snes9x
- ${INSTALL_MAN} ${WRKSRC}/HARDWARE.TXT ${PREFIX}/share/doc/snes9x
- ${INSTALL_MAN} ${WRKSRC}/HOW2PORT.TXT ${PREFIX}/share/doc/snes9x
- ${INSTALL_MAN} ${WRKSRC}/PROBLEMS.TXT ${PREFIX}/share/doc/snes9x
- ${INSTALL_MAN} ${WRKSRC}/README.TXT ${PREFIX}/share/doc/snes9x
- ${INSTALL_MAN} ${WRKSRC}/TODO.TXT ${PREFIX}/share/doc/snes9x
+ ${INSTALL_MAN} ${WRKSRC}/doc/porting.txt ${PREFIX}/share/doc/snes9x
+ ${INSTALL_MAN} ${WRKSRC}/changes.txt ${PREFIX}/share/doc/snes9x
+ ${INSTALL_MAN} ${WRKSRC}/hardware.txt ${PREFIX}/share/doc/snes9x
+ ${INSTALL_MAN} ${WRKSRC}/problems.txt ${PREFIX}/share/doc/snes9x
+ ${TR} -d '\r' <${WRKDIR}/${DISTNAME}/readme.txt >${WRKSRC}/readme.txt
+ ${INSTALL_MAN} ${WRKSRC}/readme.txt ${PREFIX}/share/doc/snes9x
+ ${INSTALL_MAN} ${WRKDIR}/${DISTNAME}/readme.unix \
+ ${PREFIX}/share/doc/snes9x
.include "../../mk/bsd.prefs.mk"
@@ -38,25 +41,21 @@ PKG_SUPPORTED_OPTIONS= mmx
.include "../../mk/bsd.options.mk"
-MAKE_ENV+= THREAD_SOUND=1
.if ${MACHINE_ARCH} == "i386"
-MAKE_ENV+= USING_I386=1
+CONFIGURE_ARGS+= --with-assembler
+.if !empty(PKG_OPTIONS:Mmmx)
+CONFIGURE_ARGS+= --with-mmx
+.endif
.if ${OBJECT_FMT} == "a.out"
MAKE_ENV+= FILEFORMAT=aoutb
MAKE_ENV+= _ASM_UNDERBARS=1
.else
MAKE_ENV+= FILEFORMAT=elf
.endif
-MAKE_ENV+= ZSNESFX=1
-MAKE_ENV+= ZSNESC4=1
-MAKE_ENV+= ASMCPU=1
-.if !empty(PKG_OPTIONS:Mmmx)
-MAKE_ENV+= ASMKREED=1
-.endif
.endif
.if exists(${X11BASE}/lib/libXxf86dga.a)
-MAKE_ENV+= NETBSD_USE_DGA=1
+CONFIGURE_ARGS+= --with-extensions
.endif
.if exists(/usr/include/usb.h) || exists(/usr/include/usbhid.h)
diff --git a/emulators/snes9x/PLIST b/emulators/snes9x/PLIST
index ccce8d21333..00696ebcfe1 100644
--- a/emulators/snes9x/PLIST
+++ b/emulators/snes9x/PLIST
@@ -1,11 +1,10 @@
-@comment $NetBSD: PLIST,v 1.1 2001/10/31 23:53:23 zuntum Exp $
+@comment $NetBSD: PLIST,v 1.2 2006/03/18 15:56:00 ben Exp $
bin/snes9x
bin/offsets
-share/doc/snes9x/CHANGES.TXT
-share/doc/snes9x/COPYRIGHT.TXT
-share/doc/snes9x/HARDWARE.TXT
-share/doc/snes9x/HOW2PORT.TXT
-share/doc/snes9x/PROBLEMS.TXT
-share/doc/snes9x/README.TXT
-share/doc/snes9x/TODO.TXT
+share/doc/snes9x/changes.txt
+share/doc/snes9x/hardware.txt
+share/doc/snes9x/porting.txt
+share/doc/snes9x/problems.txt
+share/doc/snes9x/readme.txt
+share/doc/snes9x/readme.unix
@dirrm share/doc/snes9x
diff --git a/emulators/snes9x/distinfo b/emulators/snes9x/distinfo
index ceb0d6b1761..7e016eabd57 100644
--- a/emulators/snes9x/distinfo
+++ b/emulators/snes9x/distinfo
@@ -1,20 +1,22 @@
-$NetBSD: distinfo,v 1.11 2005/11/17 14:21:02 joerg Exp $
+$NetBSD: distinfo,v 1.12 2006/03/18 15:56:00 ben Exp $
-SHA1 (s9xs139.zip) = 15acf6d8a31dc51b26a42abf747cec1b72c2aa29
-RMD160 (s9xs139.zip) = b7ede5bda5adb4ee92428264d689624212becc5d
-Size (s9xs139.zip) = 666463 bytes
-SHA1 (patch-aa) = 29b335e4e6f2057ae22e3d9e0ed2e1483e440ef6
-SHA1 (patch-ab) = b99893934074d8693a9609d49e49953ade2b2062
-SHA1 (patch-ac) = e54f4fff397dd4ca3be28711fd23c4fbef57ed54
-SHA1 (patch-ad) = 72cc9904c74e0668cce450fcada24453aec344e4
-SHA1 (patch-ae) = cb2ed8dc3ad409ffb88cb9851b04c6c42c3b2b0e
-SHA1 (patch-af) = 302967c91a1e0b384c4990687fb11bf236202783
-SHA1 (patch-ag) = 79a6339bf1e1b7b8f1d7977df1a8096ea96abea7
-SHA1 (patch-ah) = 60bd35e51faca36fbd8d8d6354487554af17fe7a
-SHA1 (patch-ai) = 2f522a560577aff89af9efa7a6b129faa99670fd
-SHA1 (patch-aj) = 131a2a64a14ebeabb8e988b1882acbb533e893d6
-SHA1 (patch-ak) = 4154979877ac98976a6eaf364030b840e8715e30
-SHA1 (patch-al) = 7c703d57d7b0058d9ef7e598c7a03e18a9a234f8
-SHA1 (patch-am) = 0630f836f8f7d44ee5476a73de4f7934897814f2
-SHA1 (patch-an) = 2cbcd9376cdd98734a7dcd7eba63698946323474
-SHA1 (patch-ao) = 2cb334bed163ef1965fb42ab5f0fa9cd919af835
+SHA1 (snes9x-1.43-src.tar.gz) = c6883c451aeb442030862ec19a8dca25ee02d82c
+RMD160 (snes9x-1.43-src.tar.gz) = d2003f7afb208109405b41f4eec586b93518f9b2
+Size (snes9x-1.43-src.tar.gz) = 1016251 bytes
+SHA1 (patch-aa) = a21b9902095de675cbff28787a2f3cd7af3292cb
+SHA1 (patch-ab) = 7dfd2d7a92caceed82549fed3f175746871b3985
+SHA1 (patch-ac) = c1e35daa7e53536d05c1633b78c00d511ae7feb5
+SHA1 (patch-ad) = c5febcdd6b5bf0f3b4b5d8b0bc19c4716434a23e
+SHA1 (patch-ae) = c4258835925ee3a6e3606ad895ff697f379cb22f
+SHA1 (patch-af) = 19d86d23e3af2c0cef09b8eeff1303d6f100c2f8
+SHA1 (patch-ag) = 64de847f4b3f11386567c6e5caa5e253d0146a0c
+SHA1 (patch-ah) = eb5ff0fed972644f9c8599ec5eb6a3cd3ce160cb
+SHA1 (patch-ai) = 06bd00790d1a84ee31114de4205bba22b48cd547
+SHA1 (patch-aj) = f5cdf8e917f787d7e9fc657ed7197a2c28460375
+SHA1 (patch-ak) = a15a54d7b0585ce84bf9d04f200c2d1f3e1c615c
+SHA1 (patch-al) = 71043b1ec2ee66399ef7a10f6258f15b12dab980
+SHA1 (patch-am) = 31d0ccf2e6124126929d9064ef2212d2a8bb963e
+SHA1 (patch-an) = 3ae10526aa66ef235c223e891c67b4aed6fc48df
+SHA1 (patch-ao) = b5b721563aee09909b7d6143bd699ec86ccaed3b
+SHA1 (patch-ap) = 1c1b7f1b45d75688870a94dadadb6da055e99cd0
+SHA1 (patch-aq) = 6c591ec195bd06c2d0dfd6a947d0e57657fb306e
diff --git a/emulators/snes9x/patches/patch-aa b/emulators/snes9x/patches/patch-aa
index f0671a7a6f0..12cf29af984 100644
--- a/emulators/snes9x/patches/patch-aa
+++ b/emulators/snes9x/patches/patch-aa
@@ -1,57 +1,17 @@
-$NetBSD: patch-aa,v 1.11 2005/11/17 14:21:02 joerg Exp $
---- Makefile.orig Tue Sep 18 08:03:58 2001
-+++ Makefile Sun Sep 21 19:48:50 2003
-@@ -1,14 +1,14 @@
--ZSNESFX=1
--ZSNESC4=1
--ASMCPU=1
-+#ZSNESFX=1
-+#ZSNESC4=1
-+#ASMCPU=1
- #SPC700ASM=1
- NETPLAY=1
- UNZIP=1
- #GLIDE=1
- #OPENGL=1
- #GUI=1
--THREAD_SOUND=1
--ASMKREED=1
-+#THREAD_SOUND=1
-+#ASMKREED=1
-
- ifdef ZSNESFX
- FXOBJ=i386/fxemu2b.o i386/fxemu2.o i386/fxemu2c.o i386/fxtable.o i386/sfxproc.o i386/zsnes.o
-@@ -34,13 +34,20 @@
- C4NO_DEPENDS=zsnes_c4
- endif
-
-+ifdef NETBSD_USE_DGA
- LINUXDEFINES=-DUSE_DGA_EXTENSION -DUSE_VIDMODE_EXTENSION
-+DGALIBS=-lXxf86dga -lXxf86vm
-+endif
-
- ifdef SPC700ASM
- SOUNDOBJ=spctool/spc700.o spctool/dsp.o spctool.o spctool/soundmod.o spc.o
- SOUNDDEFINES=-DSPCTOOL
- else
-+ifdef USING_I386
- SOUNDOBJ=spc700.o soundux.o apu.o i386/spc.o
-+else
-+SOUNDOBJ=spc700.o soundux.o apu.o
-+endif
- SOUNDDEFINES=-DSPC700_C
- endif
-
-@@ -58,6 +65,20 @@
- KREEDOBJ=2xsai.o
- endif
+$NetBSD: patch-aa,v 1.12 2006/03/18 15:56:00 ben Exp $
+
+--- Makefile.in.orig 2006-03-18 05:54:27.000000000 -0800
++++ Makefile.in
+@@ -113,6 +113,20 @@ SPC7110OBJ=spc7110.o
+ OBC1OBJ=obc1.o
+ SETAOBJ=seta.o seta010.o seta011.o seta018.o
+ifdef USBJOY
+ifdef USBHID_H
-+USBJOYDEFINES=-DJOYSTICK_SUPPORT -DHAVE_USBHID_H
++USBJOYDEFINES=-DHAVE_USBHID_H
+EXTRALIBS+=-lusbhid
+else
-+USBJOYDEFINES=-DJOYSTICK_SUPPORT
++USBJOYDEFINES=
+EXTRALIBS+=-lusb
+endif
+endif
@@ -61,10 +21,10 @@ $NetBSD: patch-aa,v 1.11 2005/11/17 14:21:02 joerg Exp $
+endif
+
OBJECTS=$(CPUOBJ) $(SOUNDOBJ) apudebug.o $(FXOBJ) $(C4OBJ) \
- cpu.o sa1.o debug.o sdd1.o tile.o srtc.o \
- gfx.o memmap.o snaporig.o clip.o dsp1.o \
-@@ -81,9 +102,10 @@
- UNZIPDEFINES=-DUNZIP_SUPPORT
+ cpu.o sa1.o debug.o sdd1.o tile.o srtc.o gfx.o memmap.o clip.o \
+ dsp1.o ppu.o dma.o snes9x.o data.o globals.o \
+@@ -136,9 +150,10 @@ OBJECTS += jma/s9x-jma.o jma/7zlzma.o jm
+ JMADEFINES=-DJMA_SUPPORT -fexceptions
endif
+EXTRALIBS += ${LIBOSSAUDIO}
@@ -76,70 +36,21 @@ $NetBSD: patch-aa,v 1.11 2005/11/17 14:21:02 joerg Exp $
endif
ifdef GLIDE
-@@ -113,9 +135,13 @@
- CC = gcc
- NASM = nasm
-
--INCLUDES=-I/usr/X11R6/include -I/usr/local/include
-+INCLUDES=-I${X11BASE}/include
-
--OPTIMISE= -O6 -mpentium -fomit-frame-pointer -fno-exceptions -Wall -W -pedantic -pipe
-+ifdef USING_I386
-+OPTIMISE= -O6 -mpentium -fomit-frame-pointer -fno-exceptions -Wall -W -pipe
-+else
-+OPTIMISE=-fno-exceptions -Wall -W -fomit-frame-pointer
-+endif
-
- #OPTIMISE=-g -fno-exceptions
- #-DMITSHM
-@@ -124,10 +150,8 @@
- -Ii386 \
- -I. \
- -Iunzip \
---DJOYSTICK_SUPPORT \
- -DZLIB \
- -DVAR_CYCLES \
---DDEBUGGER \
- -DCPU_SHUTDOWN \
- -DSPC700_SHUTDOWN \
- -DOLD_COLOUR_BLENDING \
-@@ -142,7 +166,8 @@
- $(OPENGLDEFINES) \
- $(GUIDEFINES) \
+@@ -206,6 +221,8 @@ $(AIDODEFINES) \
$(KREEDDEFINES) \
---DNO_INLINE_SET_GET
+ $(SDD1DEFINES) \
+ $(JOYDEFINES) \
+$(USBJOYDEFINES) \
-+$(EXTRADEFINES)
-
- #-DSOUND
- #-DDEBUGGER
-@@ -154,9 +179,9 @@
- CFLAGS=$(CCFLAGS)
-
- .SUFFIXES: .o .cpp .c .cc .h .m .i .S .asm .obj
--LDLIBS = -L/usr/X11R6/lib
-+LDLIBS = -Wl,-R${X11BASE}/lib -L${X11BASE}/lib
-
--all: offsets snes9x ssnes9x
-+all: offsets snes9x
-
- #ggisnes9x
- #xf86snes9x
-@@ -182,7 +207,7 @@
- ./offsets >i386/offsets.h
-
- snes9x: $(OBJECTS) unix/x11.o $(GLIDEOBJS) $(OPENGLOBJS) $(GUIOBJS) $(KREEDOBJ)
-- $(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(GLIDEOBJS) $(OPENGLOBJS) $(KREEDOBJ) unix/x11.o $(GUIOBJS) $(LDLIBS) $(GLIDELIBS) $(OPENGLLIBS) $(GUILIBS) -lXxf86dga -lXxf86vm -lXext -lX11 $(EXTRALIBS) -lz -lm
-+ $(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(GLIDEOBJS) $(OPENGLOBJS) $(KREEDOBJ) unix/x11.o $(GUIOBJS) $(LDLIBS) $(GLIDELIBS) $(OPENGLLIBS) $(GUILIBS) $(DGALIBS) -lXext -lX11 $(EXTRALIBS) -lz -lm
++$(EXTRADEFINES) \
+ -DNO_INLINE_SET_GET @SYSDEFINES@
- ssnes9x: $(OBJECTS) unix/svga.o $(GLIDEOBJS)
- $(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(GLIDEOBJS) unix/svga.o $(LDLIBS) $(GLIDELIBS) -lvga -lvgagl -lz $(EXTRALIBS) -lm
-@@ -212,7 +237,7 @@
- $(CCC) $(INCLUDES) -c -E $(CCFLAGS) $*.S -o $@
+ #-DOLD_COLOUR_BLENDING
+@@ -302,7 +319,7 @@ s9xserver: $(SERVER_OBJECTS)
+ sh-elf-as -little $(srcdir)/$*.s -o $@
.asm.o:
-- $(NASM) -f elf $(FXDEFINES) -i. -ii386 -o $@ $*.asm
-+ $(NASM) -f ${FILEFORMAT} $(FXDEFINES) $(EXTRADEFINES) -i. -ii386 -o $@ $*.asm
+- $(NASM) -f elf $(FXDEFINES) -I$(srcdir)/ -I$(srcdir)/$(CPU)/ -o $@ $(srcdir)/$*.asm
++ $(NASM) -f ${FILEFORMAT} $(FXDEFINES) $(EXTRADEFINES) -I$(srcdir)/ -I$(srcdir)/$(CPU)/ -o $@ $(srcdir)/$*.asm
.obj.o:
cp $*.obj $*.o
diff --git a/emulators/snes9x/patches/patch-ab b/emulators/snes9x/patches/patch-ab
index 5b8654d6868..0ca9d5c2919 100644
--- a/emulators/snes9x/patches/patch-ab
+++ b/emulators/snes9x/patches/patch-ab
@@ -1,11 +1,11 @@
-$NetBSD: patch-ab,v 1.2 2001/07/17 15:31:25 wiz Exp $
+$NetBSD: patch-ab,v 1.3 2006/03/18 15:56:00 ben Exp $
---- i386/asmstruc.h.orig Wed Feb 28 22:12:23 2001
+--- i386/asmstruc.h.orig 2004-12-30 14:15:44.000000000 -0800
+++ i386/asmstruc.h
-@@ -38,7 +38,7 @@
- * Super NES and Super Nintendo Entertainment System are trademarks of
- * Nintendo Co., Limited and its subsidiary companies.
- */
+@@ -86,7 +86,7 @@
+ Super NES and Super Nintendo Entertainment System are trademarks of
+ Nintendo Co., Limited and its subsidiary companies.
+ *******************************************************************************/
-#if defined(__DJGCC) || defined(MICROSOFT_C) || defined(_WINDOWS)
+#if defined(__DJGCC) || defined(MICROSOFT_C) || defined(_WINDOWS) || defined(_ASM_UNDERBARS)
#define S9xTraceMessage _S9xTraceMessage
diff --git a/emulators/snes9x/patches/patch-ac b/emulators/snes9x/patches/patch-ac
index 9855a985614..e7781f11426 100644
--- a/emulators/snes9x/patches/patch-ac
+++ b/emulators/snes9x/patches/patch-ac
@@ -1,14 +1,18 @@
-$NetBSD: patch-ac,v 1.3 2002/07/08 01:04:10 kristerw Exp $
---- 2xsai.cpp.orig Mon Jul 8 01:58:01 2002
-+++ 2xsai.cpp Mon Jul 8 01:58:55 2002
-@@ -46,10 +46,6 @@
+$NetBSD: patch-ac,v 1.4 2006/03/18 15:56:00 ben Exp $
+
+--- 2xsai.cpp.orig 2004-12-30 14:15:47.000000000 -0800
++++ 2xsai.cpp
+@@ -95,13 +95,6 @@
#include "port.h"
#include "gfx.h"
--#if (defined (__i386__) || defined (__i486__) ||\
-- defined (__i586__) || defined (__WIN32__) || defined (__DJGPP))
--#define MMX
+-#if (defined(USE_X86_ASM) && (defined (__i386__) || defined (__i486__) || \
+- defined (__i586__) || defined (__WIN32__) || defined (__DJGPP)))
+-# ifndef MMX
+-# define MMX
+-# endif
-#endif
-
+-
extern "C"
{
+
diff --git a/emulators/snes9x/patches/patch-ad b/emulators/snes9x/patches/patch-ad
index 2ff304400f3..13af1ec02d3 100644
--- a/emulators/snes9x/patches/patch-ad
+++ b/emulators/snes9x/patches/patch-ad
@@ -1,8 +1,8 @@
-$NetBSD: patch-ad,v 1.2 2001/07/17 15:31:25 wiz Exp $
+$NetBSD: patch-ad,v 1.3 2006/03/18 15:56:00 ben Exp $
---- netplay.cpp.orig Wed Feb 28 22:12:22 2001
+--- netplay.cpp.orig 2004-12-30 14:15:45.000000000 -0800
+++ netplay.cpp
-@@ -75,8 +75,12 @@
+@@ -126,9 +126,13 @@
#ifdef USE_THREADS
#include <pthread.h>
@@ -11,7 +11,8 @@ $NetBSD: patch-ad,v 1.2 2001/07/17 15:31:25 wiz Exp $
+#else
#include <sched.h>
#include <semaphore.h>
-+#endif
#endif
++#endif
#include "snes9x.h"
+ #include "cpuexec.h"
diff --git a/emulators/snes9x/patches/patch-ae b/emulators/snes9x/patches/patch-ae
index 2bfb67427fe..cdfd467b212 100644
--- a/emulators/snes9x/patches/patch-ae
+++ b/emulators/snes9x/patches/patch-ae
@@ -1,8 +1,8 @@
-$NetBSD: patch-ae,v 1.2 2001/07/17 15:31:25 wiz Exp $
+$NetBSD: patch-ae,v 1.3 2006/03/18 15:56:00 ben Exp $
---- port.h.orig Wed Feb 28 22:12:22 2001
+--- port.h.orig 2004-12-30 14:15:47.000000000 -0800
+++ port.h
-@@ -188,6 +188,10 @@
+@@ -281,6 +281,10 @@ EXTERN_C void MixSound(void);
#define TITLE "Snes9X: Linux"
#endif
diff --git a/emulators/snes9x/patches/patch-af b/emulators/snes9x/patches/patch-af
index 72b99897b4a..1a40eab5972 100644
--- a/emulators/snes9x/patches/patch-af
+++ b/emulators/snes9x/patches/patch-af
@@ -1,8 +1,8 @@
-$NetBSD: patch-af,v 1.3 2001/07/17 15:31:25 wiz Exp $
+$NetBSD: patch-af,v 1.4 2006/03/18 15:56:00 ben Exp $
---- soundux.h.orig Wed Feb 28 22:12:23 2001
+--- soundux.h.orig 2004-12-30 14:15:47.000000000 -0800
+++ soundux.h
-@@ -79,7 +79,7 @@
+@@ -127,7 +127,7 @@ typedef struct {
int stereo;
bool8 sixteen_bit;
bool8 encoded;
diff --git a/emulators/snes9x/patches/patch-ag b/emulators/snes9x/patches/patch-ag
index ed81126d123..2daca565b66 100644
--- a/emulators/snes9x/patches/patch-ag
+++ b/emulators/snes9x/patches/patch-ag
@@ -1,17 +1,8 @@
-$NetBSD: patch-ag,v 1.6 2005/11/17 14:21:02 joerg Exp $
+$NetBSD: patch-ag,v 1.7 2006/03/18 15:56:00 ben Exp $
---- unix/unix.cpp.orig 2001-09-18 06:03:40.000000000 +0000
+--- unix/unix.cpp.orig 2004-12-30 14:15:47.000000000 -0800
+++ unix/unix.cpp
-@@ -51,7 +51,7 @@
- #include <ctype.h>
- #include <dirent.h>
-
--#if defined(__linux) || defined(__sun)
-+#if defined(__linux) || defined(__sun) || defined(__NetBSD__) || defined(__DragonFly__)
- #undef USE_THREADS
- #define USE_THREADS
- #include <unistd.h>
-@@ -62,7 +62,11 @@
+@@ -117,15 +117,25 @@
#ifdef USE_THREADS
#include <pthread.h>
@@ -23,33 +14,36 @@ $NetBSD: patch-ag,v 1.6 2005/11/17 14:21:02 joerg Exp $
pthread_t thread;
pthread_mutex_t mutex;
-@@ -72,6 +76,11 @@ pthread_mutex_t mutex;
+ #endif
+
+-#if !defined(NOSOUND) && defined(__linux)
++#if !defined(NOSOUND)
++#if defined(__linux)
#include <sys/soundcard.h>
#include <sys/mman.h>
- #endif
-+#ifdef __NetBSD__
++#elif defined(__NetBSD__)
+#include <soundcard.h>
+#elif defined(__DragonFly__)
+#include <sys/soundcard.h>
+#endif
-
- #ifdef __sun
- #ifdef __SVR4
-@@ -84,6 +93,9 @@ pthread_mutex_t mutex;
- #if defined(__sun) && defined(__GNUC__)
- typedef void (*SIG_PF)();
#endif
+
+ #if !defined(NOSOUND) && defined(__sun)
+@@ -140,6 +150,9 @@ pthread_mutex_t mutex;
+ //#if defined(__sun) && defined(__GNUC__)
+ //typedef void (*SIG_PF)();
+ //#endif
+#if defined(__NetBSD__) || defined(__DragonFly__)
+typedef void (*SIG_PF)(int);
+#endif
#include "snes9x.h"
#include "memmap.h"
-@@ -111,6 +123,56 @@ uint32 joypads [5] = {0};
+@@ -168,6 +181,56 @@ uint32 joypads [5] = {0};
int NumControllers = 5;
#ifdef JOYSTICK_SUPPORT
-+#if defined( __NetBSD__) || defined(__DragonFly__)
++#if defined(__NetBSD__) || defined(__DragonFly__)
+#ifdef HAVE_USBHID_H
+#include <usbhid.h>
+#else
@@ -99,19 +93,19 @@ $NetBSD: patch-ag,v 1.6 2005/11/17 14:21:02 joerg Exp $
+char *js_device [4] = {"/dev/uhid0", "/dev/uhid1", "/dev/uhid2", "/dev/uhid3"};
+
+#endif
- #ifdef __linux
+ #if defined(__linux)
#include <linux/joystick.h>
int js_fd [4] = {-1, -1, -1, -1};
-@@ -168,7 +230,7 @@ void *S9xProcessSound (void *);
- char *rom_filename = NULL;
- char *snapshot_filename = NULL;
+@@ -227,7 +290,7 @@ char *snapshot_filename = NULL;
+ char *SDD1_pack = NULL;
--#if defined(__linux) || defined(__sun)
-+#if defined(__linux) || defined(__sun) || defined(__NetBSD__) || defined(__DragonFly__)
+ //FIXME: I see no reason not to configureenable this for all Unixen
+-#if defined(DEBUGGER) && (defined(__linux) || defined(__sun))
++#if defined(DEBUGGER) && (defined(__linux) || defined(__sun) || defined(__NetBSD__) || defined(__DragonFly__))
static void sigbrkhandler(int)
{
- #ifdef DEBUGGER
-@@ -612,6 +674,106 @@ void S9xInitInputDevices ()
+ CPU.Flags |= DEBUG_MODE_FLAG;
+@@ -700,6 +763,106 @@ void S9xInitInputDevices ()
#ifdef JOYSTICK_SUPPORT
void InitJoysticks ()
{
@@ -218,7 +212,7 @@ $NetBSD: patch-ag,v 1.6 2005/11/17 14:21:02 joerg Exp $
#ifdef JSIOCGVERSION
int version;
unsigned char axes, buttons;
-@@ -664,6 +826,77 @@ void InitJoysticks ()
+@@ -756,6 +919,77 @@ void InitJoysticks ()
void ReadJoysticks ()
{
@@ -245,8 +239,8 @@ $NetBSD: patch-ag,v 1.6 2005/11/17 14:21:02 joerg Exp $
+ {
+ int center, trigger_point;
+
-+ center = (h->logical_maximum + h->logical_minimum) / 2;
-+ trigger_point = (h->logical_maximum - h->logical_minimum) / 4;
++ center = (h->logical_maximum + h->logical_minimum) / 2;
++ trigger_point = (h->logical_maximum - h->logical_minimum) / 4;
+
+ if (usage == HUG_X || usage == HUG_RX)
+ {
@@ -296,24 +290,24 @@ $NetBSD: patch-ag,v 1.6 2005/11/17 14:21:02 joerg Exp $
#ifdef JSIOCGVERSION
struct js_event js_ev;
int i;
-@@ -1422,7 +1655,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
+@@ -1646,7 +1880,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
}
#endif
--#if defined(__linux)
-+#if defined(__linux) || defined(__NetBSD__) || defined(__DragonFly__)
+-#if !defined(NOSOUND) && defined(__linux)
++#if !defined(NOSOUND) && (defined(__linux) || defined(__NetBSD__) || defined(__DragonFly__))
static int Rates[8] =
{
- 0, 8192, 11025, 16500, 22050, 29300, 36600, 44000
-@@ -1437,11 +1670,19 @@ bool8 S9xOpenSoundDevice (int mode, bool
- {
+ 0, 8000, 11025, 16000, 22050, 32000, 44100, 48000
+@@ -1662,12 +1896,19 @@ bool8 S9xOpenSoundDevice (int mode, bool
+ /* Linux version (OSS) */
int J, K;
+#if defined(__NetBSD__)
+ if ((so.sound_fd = open ("/dev/audio", O_WRONLY)) < 0)
+ {
-+ perror ("/dev/audio");
-+ return (FALSE);
++ perror ("/dev/audio");
++ return (FALSE);
+ }
+#else
if ((so.sound_fd = open ("/dev/dsp", O_WRONLY)) < 0)
@@ -321,11 +315,12 @@ $NetBSD: patch-ag,v 1.6 2005/11/17 14:21:02 joerg Exp $
perror ("/dev/dsp");
return (FALSE);
}
+-
+#endif
-
#ifdef MMAP_SOUND
if (ioctl (so.sound_fd, SNDCTL_DSP_GETCAPS, &J) < 0)
-@@ -1485,14 +1726,14 @@ bool8 S9xOpenSoundDevice (int mode, bool
+ {
+@@ -1711,14 +1952,14 @@ bool8 S9xOpenSoundDevice (int mode, bool
so.sixteen_bit = TRUE;
so.stereo = stereo;
@@ -342,7 +337,7 @@ $NetBSD: patch-ag,v 1.6 2005/11/17 14:21:02 joerg Exp $
{
perror ("ioctl SNDCTL_DSP_SPEED");
return (FALSE);
-@@ -1517,7 +1758,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
+@@ -1743,7 +1984,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
perror ("ioctl SNDCTL_DSP_SETFRAGMENT");
return (FALSE);
}
@@ -351,19 +346,28 @@ $NetBSD: patch-ag,v 1.6 2005/11/17 14:21:02 joerg Exp $
#ifdef MMAP_SOUND
J = PCM_ENABLE_OUTPUT;
-@@ -1541,7 +1782,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
- }
+@@ -1768,7 +2009,7 @@ bool8 S9xOpenSoundDevice (int mode, bool
#endif
--#if defined (__linux) || defined (__sun)
-+#if defined (__linux) || defined (__sun) || defined(__NetBSD__) || defined(__DragonFly__)
+
+-#if !defined(NOSOUND) && (defined (__linux) || defined (__sun))
++#if !defined(NOSOUND) && (defined (__linux) || defined (__sun) || defined(__NetBSD__) || defined(__DragonFly__))
void S9xUnixProcessSound (void)
{
}
-@@ -1640,7 +1881,7 @@ void S9xGenerateSound ()
+@@ -1810,7 +2051,7 @@ void *S9xProcessSound (void *)
+ }
+ #endif
- void *S9xProcessSound (void *)
+-#if !defined(NOSOUND) && (defined (__linux) || defined (__sun))
++#if !defined(NOSOUND) && (defined (__linux) || defined (__sun) || defined(__NetBSD__) || defined(__DragonFly__))
+ void S9xGenerateSound ()
{
+ /* Linux and Sun versions */
+@@ -1902,7 +2143,7 @@ void *S9xProcessSound (void *)
+ /* If threads in use, this is to loop indefinitely */
+ /* If not, this will be called by timer */
+
-#ifdef __linux
+#if defined(__linux) || defined(__NetBSD__) || defined(__DragonFly__)
audio_buf_info info;
diff --git a/emulators/snes9x/patches/patch-ah b/emulators/snes9x/patches/patch-ah
index 788b24bf0ca..91501893738 100644
--- a/emulators/snes9x/patches/patch-ah
+++ b/emulators/snes9x/patches/patch-ah
@@ -1,6 +1,6 @@
-$NetBSD: patch-ah,v 1.2 2001/07/17 15:31:25 wiz Exp $
+$NetBSD: patch-ah,v 1.3 2006/03/18 15:56:00 ben Exp $
---- unzip/unz.h.orig Wed Aug 25 07:52:56 1999
+--- unzip/unz.h.orig 2004-12-30 14:15:45.000000000 -0800
+++ unzip/unz.h
@@ -11,6 +11,14 @@
---------------------------------------------------------------------------*/
diff --git a/emulators/snes9x/patches/patch-ai b/emulators/snes9x/patches/patch-ai
index 4082dabbba7..ed2302eeae0 100644
--- a/emulators/snes9x/patches/patch-ai
+++ b/emulators/snes9x/patches/patch-ai
@@ -1,8 +1,8 @@
-$NetBSD: patch-ai,v 1.2 2001/07/17 15:31:25 wiz Exp $
+$NetBSD: patch-ai,v 1.3 2006/03/18 15:56:00 ben Exp $
---- unzip/unzip.h.orig Wed Aug 25 07:52:56 1999
+--- unzip/unzip.h.orig 2004-12-30 14:15:45.000000000 -0800
+++ unzip/unzip.h
-@@ -49,6 +49,15 @@
+@@ -49,6 +49,15 @@ extern "C" {
#include "zlib.h"
#endif
diff --git a/emulators/snes9x/patches/patch-aj b/emulators/snes9x/patches/patch-aj
index f89dfd79882..86be2e7be1e 100644
--- a/emulators/snes9x/patches/patch-aj
+++ b/emulators/snes9x/patches/patch-aj
@@ -1,7 +1,8 @@
-$NetBSD: patch-aj,v 1.2 2005/11/17 14:21:02 joerg Exp $
---- snes9x.cpp.orig Sat Jul 13 22:00:14 2002
-+++ snes9x.cpp Sat Jul 13 22:04:07 2002
-@@ -141,6 +141,9 @@
+$NetBSD: patch-aj,v 1.3 2006/03/18 15:56:00 ben Exp $
+
+--- snes9x.cpp.orig 2004-12-30 14:15:47.000000000 -0800
++++ snes9x.cpp
+@@ -200,6 +200,9 @@ void S9xUsage ()
-joydevX /dev/jsY Use joystick device /dev/jsY for emulation of gamepad X\n");
S9xMessage (S9X_INFO, S9X_USAGE, "\
-joymapX 0 1 2 3 4 5 6 7 Joystick buttons which should be assigned to gamepad X - A B X Y TL TR Start and Select\n");
diff --git a/emulators/snes9x/patches/patch-ak b/emulators/snes9x/patches/patch-ak
index 3f0799a1d70..5a9f5b2460d 100644
--- a/emulators/snes9x/patches/patch-ak
+++ b/emulators/snes9x/patches/patch-ak
@@ -1,7 +1,8 @@
-$NetBSD: patch-ak,v 1.1 2002/12/30 21:40:12 kristerw Exp $
---- i386/zsnesc4.asm.orig Mon Dec 30 21:21:54 2002
-+++ i386/zsnesc4.asm Mon Dec 30 21:22:42 2002
-@@ -51,7 +51,7 @@
+$NetBSD: patch-ak,v 1.2 2006/03/18 15:56:00 ben Exp $
+
+--- i386/zsnesc4.asm.orig 2004-12-30 14:15:44.000000000 -0800
++++ i386/zsnesc4.asm
+@@ -51,7 +51,7 @@ NEWSYM oamram, times 544 db 0 ; Sprit
SECTION .data
diff --git a/emulators/snes9x/patches/patch-al b/emulators/snes9x/patches/patch-al
index 32078bf91cb..d002faef5c6 100644
--- a/emulators/snes9x/patches/patch-al
+++ b/emulators/snes9x/patches/patch-al
@@ -1,7 +1,8 @@
-$NetBSD: patch-al,v 1.1 2002/12/30 21:40:12 kristerw Exp $
---- i386/zsnes.asm.orig Mon Dec 30 21:21:47 2002
-+++ i386/zsnes.asm Mon Dec 30 21:22:23 2002
-@@ -92,7 +92,7 @@
+$NetBSD: patch-al,v 1.2 2006/03/18 15:56:00 ben Exp $
+
+--- i386/ZSNES.ASM.orig 2004-12-30 14:15:44.000000000 -0800
++++ i386/ZSNES.ASM
+@@ -92,7 +92,7 @@ NEWSYM SfxAC, dd 0
SECTION .data
diff --git a/emulators/snes9x/patches/patch-am b/emulators/snes9x/patches/patch-am
index 7ae7402f488..7cbd18f377c 100644
--- a/emulators/snes9x/patches/patch-am
+++ b/emulators/snes9x/patches/patch-am
@@ -1,6 +1,7 @@
-$NetBSD: patch-am,v 1.1 2002/12/30 21:40:12 kristerw Exp $
---- i386/spc.asm.orig Mon Dec 30 21:53:48 2002
-+++ i386/spc.asm Mon Dec 30 21:54:09 2002
+$NetBSD: patch-am,v 1.2 2006/03/18 15:56:00 ben Exp $
+
+--- i386/SPC.ASM.orig 2004-12-30 14:15:44.000000000 -0800
++++ i386/SPC.ASM
@@ -18,7 +18,7 @@
;Destroys:
; EAX
diff --git a/emulators/snes9x/patches/patch-an b/emulators/snes9x/patches/patch-an
index cfc5066e099..212cb3ea6b7 100644
--- a/emulators/snes9x/patches/patch-an
+++ b/emulators/snes9x/patches/patch-an
@@ -1,6 +1,7 @@
-$NetBSD: patch-an,v 1.1 2002/12/30 21:40:12 kristerw Exp $
---- i386/c4.asm.orig Mon Dec 30 22:31:27 2002
-+++ i386/c4.asm Mon Dec 30 22:31:55 2002
+$NetBSD: patch-an,v 1.2 2006/03/18 15:56:00 ben Exp $
+
+--- i386/C4.ASM.orig 2004-12-30 14:15:44.000000000 -0800
++++ i386/C4.ASM
@@ -5,7 +5,7 @@
; enter : BL = bank number, CX = address location
; leave : AL = value read
diff --git a/emulators/snes9x/patches/patch-ao b/emulators/snes9x/patches/patch-ao
index 72c88d96537..ea25ec81bbd 100644
--- a/emulators/snes9x/patches/patch-ao
+++ b/emulators/snes9x/patches/patch-ao
@@ -1,10 +1,11 @@
-$NetBSD: patch-ao,v 1.1 2002/12/30 21:40:12 kristerw Exp $
---- i386/sa1struc.h.orig Mon Dec 30 22:30:11 2002
-+++ i386/sa1struc.h Mon Dec 30 22:30:50 2002
-@@ -38,7 +38,7 @@
- * Super NES and Super Nintendo Entertainment System are trademarks of
- * Nintendo Co., Limited and its subsidiary companies.
- */
+$NetBSD: patch-ao,v 1.2 2006/03/18 15:56:00 ben Exp $
+
+--- i386/sa1struc.h.orig 2004-12-30 14:15:44.000000000 -0800
++++ i386/sa1struc.h
+@@ -86,7 +86,7 @@
+ Super NES and Super Nintendo Entertainment System are trademarks of
+ Nintendo Co., Limited and its subsidiary companies.
+ *******************************************************************************/
-#if defined(__DJGCC) || defined(MICROSOFT_C) || defined(_WINDOWS)
+#if defined(__DJGCC) || defined(MICROSOFT_C) || defined(_WINDOWS) || defined(_ASM_UNDERBARS)
#define S9xTraceMessage _S9xTraceMessage
diff --git a/emulators/snes9x/patches/patch-ap b/emulators/snes9x/patches/patch-ap
new file mode 100644
index 00000000000..f2456bf4c27
--- /dev/null
+++ b/emulators/snes9x/patches/patch-ap
@@ -0,0 +1,97 @@
+$NetBSD: patch-ap,v 1.1 2006/03/18 15:56:00 ben Exp $
+
+--- configure.in.orig 2004-12-30 14:15:45.000000000 -0800
++++ configure.in
+@@ -309,6 +309,28 @@ AC_CACHE_VAL(snes9x_cv_linux_os, [
+ ], [], snes9x_cv_linux_os=yes, snes9x_cv_linux_os=no)])
+ AC_MSG_RESULT($snes9x_cv_linux_os)
+
++AC_MSG_CHECKING(if the OS is NetBSD)
++AC_CACHE_VAL(snes9x_cv_netbsd_os, [
++ AC_TRY_COMPILE([
++#ifdef __NetBSD__
++/* */
++#else
++#error Not NetBSD.
++#endif
++ ], [], snes9x_cv_netbsd_os=yes, snes9x_cv_netbsd_os=no)])
++AC_MSG_RESULT($snes9x_cv_netbsd_os)
++
++AC_MSG_CHECKING(if the OS is DragonFly)
++AC_CACHE_VAL(snes9x_cv_dragonfly_os, [
++ AC_TRY_COMPILE([
++#ifdef __DragonFly__
++/* */
++#else
++#error Not DragonFly.
++#endif
++ ], [], snes9x_cv_dragonfly_os=yes, snes9x_cv_dragonfly_os=no)])
++AC_MSG_RESULT($snes9x_cv_dragonfly_os)
++
+ AC_MSG_CHECKING(if the OS is HP-UX)
+ AC_CACHE_VAL(snes9x_cv_hpux_os, [
+ AC_TRY_COMPILE([
+@@ -333,7 +355,7 @@ AC_MSG_RESULT($snes9x_cv_win32_os)
+
+
+ dnl Enable assembler optimizations if CPU is x86
+-AC_ARG_WITH(assembler,[ --with(out)-assembler Use assembler cores if available (default: with)],[],[with_assembler=yes])
++AC_ARG_WITH(assembler,[ --with(out)-assembler Use assembler cores if available (default: without)],[],[with_assembler=no])
+
+ if test yes = "$with_assembler"; then
+ dnl Set assembler to !nasm on Windows
+@@ -359,7 +381,6 @@ if test $NASM != "not_found"; then
+ ZSNESFX='ZSNESFX=1'
+ ZSNESC4='ZSNESC4=1'
+ ASMCPU='ASMCPU=1'
+- ASMKREED='ASMKREED=1'
+ # SPC700ASM='SPC700ASM=1'
+ I386SPC='i386/SPC.O'
+ CPUINC='-Ii386'
+@@ -373,10 +394,18 @@ else
+ fi; fi
+ fi
+
++dnl Enable MMX optimizations if CPU is x86
++AC_ARG_WITH(mmx,[ --with(out)-mmx Use MMX if available (default: without)],[],[with_mmx=no])
++if test yes = "$with_mmx"; then
++ if test $NASM != "not_found"; then
++ ASMKREED='ASMKREED=1'
++ fi
++fi
++
+ dnl Enable joystick support on Linux
+ AC_ARG_WITH(joystick, [ --with(out)-joystick Enable joystick support if available (default: with)],[],[with_joystick=yes])
+
+-if test yes = "$snes9x_cv_linux_os" -a yes = "$with_joystick"; then
++if test \( yes = "$snes9x_cv_linux_os" -o yes = "$snes9x_cv_netbsd_os" -o yes = "$snes9x_cv_dragonfly_os" \) -a yes = "$with_joystick"; then
+ JOYDEFINES=' -DJOYSTICK_SUPPORT'
+ else
+ with_joystick="no"
+@@ -527,7 +556,7 @@ if test xyes = x$no_x ; then
+ dnl Maybe AC_MSG_ERROR?
+ AC_MSG_WARN([X is normally required to build on Unix.])
+ else
+- X_LDFLAGS="-L$x_libraries"
++ X_LDFLAGS="-L$x_libraries -Wl,-R$x_libraries"
+ X_LIBS="-lX11 -lXext"
+ LIBS="$LIBS $X_LIBS"
+ SYSLIBS="$SYSLIBS $X_LDFLAGS $X_LIBS"
+@@ -540,7 +569,7 @@ AC_ADD_XFLAGS
+
+
+ dnl See if X has the DGA and vidmode extensions.
+-AC_ARG_WITH(extensions,[ --with(out)-extensions Use DGA- and vidmode-extensions for X11 if avilable (default: with)],[],[with_extensions=yes])
++AC_ARG_WITH(extensions,[ --with(out)-extensions Use DGA- and vidmode-extensions for X11 if avilable (default: without)],[],[with_extensions=no])
+
+ if test yes = $with_extensions ; then
+ AC_CHECK_LIB(Xxf86dga, XF86DGAQueryExtension, [
+@@ -759,7 +788,7 @@ if test yes = "$with_sound" ; then
+ AC_MSG_CHECKING(if sound is supported on this platform)
+ AC_CACHE_VAL(snes9x_cv_sound, [
+ AC_TRY_COMPILE([
+-#if defined(__linux) || defined(__sun) || defined(__sgi)
++#if defined(__linux) || defined(__sun) || defined(__sgi) || defined(__NetBSD__) || defined(__DragonFly__)
+ /* */
+ #else
+ #error No sound for this platform
diff --git a/emulators/snes9x/patches/patch-aq b/emulators/snes9x/patches/patch-aq
new file mode 100644
index 00000000000..8672ec5a3cf
--- /dev/null
+++ b/emulators/snes9x/patches/patch-aq
@@ -0,0 +1,193 @@
+$NetBSD: patch-aq,v 1.1 2006/03/18 15:56:00 ben Exp $
+
+--- configure.orig 2004-12-30 14:15:48.000000000 -0800
++++ configure
+@@ -23,7 +23,9 @@ ac_help="$ac_help
+ ac_help="$ac_help
+ --with(out)-aido Use a shared memory area for output (default: without)"
+ ac_help="$ac_help
+- --with(out)-assembler Use assembler cores if available (default: with)"
++ --with(out)-assembler Use assembler cores if available (default: without)"
++ac_help="$ac_help
++ --with(out)-mmx Use MMX if available (default: without)"
+ ac_help="$ac_help
+ --with(out)-joystick Enable joystick support if available (default: with)"
+ ac_help="$ac_help
+@@ -45,7 +47,7 @@ ac_help="$ac_help
+ ac_help="$ac_help
+ --with-x use the X Window System"
+ ac_help="$ac_help
+- --with(out)-extensions Use DGA- and vidmode-extensions for X11 if avilable (default: with)"
++ --with(out)-extensions Use DGA- and vidmode-extensions for X11 if avilable (default: without)"
+ ac_help="$ac_help
+ --with(out)-sound Enable sound if available (default: with)"
+
+@@ -2995,6 +2997,74 @@ fi
+
+ echo "$ac_t""$snes9x_cv_linux_os" 1>&6
+
++echo $ac_n "checking if the OS is NetBSD""... $ac_c" 1>&6
++echo "configure:2966: checking if the OS is NetBSD" >&5
++if eval "test \"`echo '$''{'snes9x_cv_netbsd_os'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++
++ cat > conftest.$ac_ext <<EOF
++#line 2972 "configure"
++#include "confdefs.h"
++
++#ifdef __NetBSD__
++/* */
++#else
++#error Not NetBSD.
++#endif
++
++int main() {
++
++; return 0; }
++EOF
++if { (eval echo configure:2985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ snes9x_cv_netbsd_os=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ snes9x_cv_netbsd_os=no
++fi
++rm -f conftest*
++fi
++
++echo "$ac_t""$snes9x_cv_netbsd_os" 1>&6
++
++echo $ac_n "checking if the OS is DragonFly""... $ac_c" 1>&6
++echo "configure:2966: checking if the OS is DragonFly" >&5
++if eval "test \"`echo '$''{'snes9x_cv_dragonfly_os'+set}'`\" = set"; then
++ echo $ac_n "(cached) $ac_c" 1>&6
++else
++
++ cat > conftest.$ac_ext <<EOF
++#line 2972 "configure"
++#include "confdefs.h"
++
++#ifdef __DragonFly__
++/* */
++#else
++#error Not DragonFly.
++#endif
++
++int main() {
++
++; return 0; }
++EOF
++if { (eval echo configure:2985: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
++ rm -rf conftest*
++ snes9x_cv_dragonfly_os=yes
++else
++ echo "configure: failed program was:" >&5
++ cat conftest.$ac_ext >&5
++ rm -rf conftest*
++ snes9x_cv_dragonfly_os=no
++fi
++rm -f conftest*
++fi
++
++echo "$ac_t""$snes9x_cv_dragonfly_os" 1>&6
++
+ echo $ac_n "checking if the OS is HP-UX""... $ac_c" 1>&6
+ echo "configure:3000: checking if the OS is HP-UX" >&5
+ if eval "test \"`echo '$''{'snes9x_cv_hpux_os'+set}'`\" = set"; then
+@@ -3069,7 +3139,7 @@ if test "${with_assembler+set}" = set; t
+ withval="$with_assembler"
+ :
+ else
+- with_assembler=yes
++ with_assembler=no
+ fi
+
+
+@@ -3141,7 +3211,6 @@ if test $NASM != "not_found"; then
+ ZSNESFX='ZSNESFX=1'
+ ZSNESC4='ZSNESC4=1'
+ ASMCPU='ASMCPU=1'
+- ASMKREED='ASMKREED=1'
+ # SPC700ASM='SPC700ASM=1'
+ I386SPC='i386/SPC.O'
+ CPUINC='-Ii386'
+@@ -3172,6 +3241,21 @@ EOF
+ fi; fi
+ fi
+
++# Check whether --with-mmx or --without-mmx was given.
++if test "${with_mmx+set}" = set; then
++ withval="$with_mmx"
++ :
++else
++ with_mmx=no
++fi
++
++
++if test yes = "$with_mmx"; then
++ if test $NASM != "not_found"; then
++ ASMKREED='ASMKREED=1'
++ fi
++fi
++
+ # Check whether --with-joystick or --without-joystick was given.
+ if test "${with_joystick+set}" = set; then
+ withval="$with_joystick"
+@@ -3181,7 +3265,7 @@ else
+ fi
+
+
+-if test yes = "$snes9x_cv_linux_os" -a yes = "$with_joystick"; then
++if test \( yes = "$snes9x_cv_linux_os" -o yes = "$snes9x_cv_netbsd_os" -o yes = "$snes9x_cv_dragonfly_os" \) -a yes = "$with_joystick"; then
+ JOYDEFINES=' -DJOYSTICK_SUPPORT'
+ else
+ with_joystick="no"
+@@ -4093,7 +4177,7 @@ fi
+ if test xyes = x$no_x ; then
+ echo "configure: warning: X is normally required to build on Unix." 1>&2
+ else
+- X_LDFLAGS="-L$x_libraries"
++ X_LDFLAGS="-L$x_libraries -Wl,-R$x_libraries"
+ X_LIBS="-lX11 -lXext"
+ LIBS="$LIBS $X_LIBS"
+ SYSLIBS="$SYSLIBS $X_LDFLAGS $X_LIBS"
+@@ -4113,7 +4197,7 @@ if test "${with_extensions+set}" = set;
+ withval="$with_extensions"
+ :
+ else
+- with_extensions=yes
++ with_extensions=no
+ fi
+
+
+@@ -4648,7 +4732,7 @@ else
+ #line 4649 "configure"
+ #include "confdefs.h"
+
+-#if defined(__linux) || defined(__sun) || defined(__sgi)
++#if defined(__linux) || defined(__sun) || defined(__sgi) || defined(__NetBSD__) || defined(__DragonFly__)
+ /* */
+ #else
+ #error No sound for this platform
+@@ -4938,6 +5022,18 @@ for ac_option
+ do
+ case "\$ac_option" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
++ # Avoid regenerating for rechecks on pkgsrc
++ exit 0
++ # Avoid regenerating for rechecks on pkgsrc
++ exit 0
++ # Avoid regenerating for rechecks on pkgsrc
++ exit 0
++ # Avoid regenerating for rechecks on pkgsrc
++ exit 0
++ # Avoid regenerating for rechecks on pkgsrc
++ exit 0
++ # Avoid regenerating for rechecks on pkgsrc
++ exit 0
+ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion"
+ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;;
+ -version | --version | --versio | --versi | --vers | --ver | --ve | --v)