summaryrefslogtreecommitdiffstats
path: root/emulators
diff options
context:
space:
mode:
authorgreen <green@FreeBSD.org>1999-12-29 07:12:58 +0000
committergreen <green@FreeBSD.org>1999-12-29 07:12:58 +0000
commit74bcd58262749d12fea17ba329266490e0ba7ac6 (patch)
treef60f8aaa5235827321e6b758b681fc1cac4d955f /emulators
parent5401b7c26d561ceafdd7c6324e166f772438080f (diff)
downloadFreeBSD-ports-74bcd58262749d12fea17ba329266490e0ba7ac6.zip
FreeBSD-ports-74bcd58262749d12fea17ba329266490e0ba7ac6.tar.gz
Snes9X needs to _not_ have USE_THREADS auto-defined for FreeBSD in
unix/unix.cpp to build, especially when the Makefile does not have it defined. Also, along with this, split the patches out into the customary one-file-per-patch chunks. I'm not ${MAINTAINER}, but nacai does not mind my working on the port :)
Diffstat (limited to 'emulators')
-rw-r--r--emulators/snes9x/files/patch-aa72
-rw-r--r--emulators/snes9x/files/patch-ab23
-rw-r--r--emulators/snes9x/files/patch-ad21
-rw-r--r--emulators/snes9x/files/patch-ae548
-rw-r--r--emulators/snes9x/files/patch-af85
-rw-r--r--emulators/snes9x/files/patch-ag32
-rw-r--r--emulators/snes9x/files/patch-ah24
7 files changed, 262 insertions, 543 deletions
diff --git a/emulators/snes9x/files/patch-aa b/emulators/snes9x/files/patch-aa
new file mode 100644
index 0000000..267ac89
--- /dev/null
+++ b/emulators/snes9x/files/patch-aa
@@ -0,0 +1,72 @@
+diff -ru ../../work/release/Makefile ./Makefile
+--- ../../work/release/Makefile Wed Sep 22 18:46:14 1999
++++ ./Makefile Wed Dec 29 01:54:04 1999
+@@ -3,9 +3,9 @@
+ #SPC700ASM=1
+ NETPLAY=1
+ UNZIP=1
+-GLIDE=1
++#GLIDE=1
+ #GUI=1
+-THREAD_SOUND=1
++#THREAD_SOUND=1
+
+ ifdef ZSNESFX
+ FXOBJ=i386/fxemu2b.o i386/fxemu2.o i386/fxemu2c.o i386/fxtable.o i386/sfxproc.o i386/zsnes.o
+@@ -73,13 +73,13 @@
+ endif
+
+ MOC = $(QTDIR)/bin/moc
+-CCC = g++ -fno-rtti
+-CC = gcc
++CCC = ${CXX} -fno-rtti
++CC ?= gcc
+ NASM = nasm
+
+ INCLUDES=-I/usr/X11R6/include -I/usr/local/include
+
+-OPTIMISE=-O6 -mpentium -fomit-frame-pointer -fno-exceptions
++OPTIMISE= ${CXXFLAGS} -fomit-frame-pointer
+ #OPTIMISE=-g -fno-exceptions
+ #-DMITSHM
+
+@@ -87,7 +87,6 @@
+ -Ii386 \
+ -I. \
+ -Iunzip \
+--DJOYSTICK_SUPPORT \
+ -DZLIB \
+ -DNO_INLINE_SET_GET \
+ -DVAR_CYCLES \
+@@ -100,7 +99,8 @@
+ $(NETPLAYDEFINES) \
+ $(UNZIPDEFINES) \
+ $(GLIDEDEFINES) \
+-$(GUIDEFINES)
++$(GUIDEFINES) \
++-DSOUND
+
+ #-DSOUND
+ #-DDEBUGGER
+@@ -112,12 +112,12 @@
+ CFLAGS=$(CCFLAGS)
+
+ .SUFFIXES: .o .cpp .c .cc .h .m .i .S .asm
+-LDLIBS = -L/usr/X11R6/lib frame.o
++LDLIBS = -L/usr/X11R6/lib
+
+ ifdef NETPLAY
+-all: offsets snes9x ssnes9x s9xserver
++all: offsets snes9x s9xserver
+ else
+-all: offsets snes9x ssnes9x
++all: offsets snes9x
+ endif
+
+ #ggisnes9x
+@@ -236,5 +236,4 @@
+ snaporig.o: cpuexec.h
+ unix/x11.o: snes9x.h port.h
+ unix/glide.o: snes9x.h port.h 3d.h
+-unix/x11.o: unix/snes9x_gui.h
+ unix/snes9x_gui.o: unix/snes9x_gui.h
diff --git a/emulators/snes9x/files/patch-ab b/emulators/snes9x/files/patch-ab
new file mode 100644
index 0000000..4b45107
--- /dev/null
+++ b/emulators/snes9x/files/patch-ab
@@ -0,0 +1,23 @@
+diff -ru ../../work/release/fxemu.h ./fxemu.h
+--- ../../work/release/fxemu.h Thu Sep 23 19:56:48 1999
++++ ./fxemu.h Wed Dec 29 01:54:04 1999
+@@ -39,18 +39,7 @@
+ #ifndef _FXEMU_H_
+ #define _FXEMU_H_ 1
+
+-/* Types used by structures and code */
+-#ifndef snes9x_types_defined
+-#define snes9x_types_defined
+-
+-typedef unsigned char uint8;
+-typedef unsigned short uint16;
+-typedef unsigned long uint32;
+-typedef unsigned char bool8;
+-typedef signed char int8;
+-typedef short int16;
+-typedef int int32;
+-#endif
++#include "port.h"
+
+ #ifndef TRUE
+ #define TRUE 1
diff --git a/emulators/snes9x/files/patch-ad b/emulators/snes9x/files/patch-ad
new file mode 100644
index 0000000..3c75d94
--- /dev/null
+++ b/emulators/snes9x/files/patch-ad
@@ -0,0 +1,21 @@
+diff -ru ../../work/release/memmap.cpp ./memmap.cpp
+--- ../../work/release/memmap.cpp Thu Sep 23 19:56:48 1999
++++ ./memmap.cpp Wed Dec 29 01:54:04 1999
+@@ -39,7 +39,7 @@
+ #include <string.h>
+ #include <ctype.h>
+
+-#ifdef __linux
++#if defined(__linux) || defined(__FreeBSD__)
+ #include <unistd.h>
+ #endif
+
+@@ -737,7 +737,7 @@
+ {
+ fwrite ((char *) ::SRAM, size, 1, file);
+ fclose (file);
+-#if defined(__linux)
++#if defined(__linux) || defined(__FreeBSD__)
+ chown (filename, getuid (), getgid ());
+ #endif
+ return (TRUE);
diff --git a/emulators/snes9x/files/patch-ae b/emulators/snes9x/files/patch-ae
index 42af888..fefabe7 100644
--- a/emulators/snes9x/files/patch-ae
+++ b/emulators/snes9x/files/patch-ae
@@ -1,405 +1,7 @@
-diff -ruN ./Makefile ../release/Makefile
---- ./Makefile Wed Sep 15 17:22:32 1999
-+++ ../release/Makefile Sun Sep 19 18:41:45 1999
-@@ -3,9 +3,9 @@
- #SPC700ASM=1
- NETPLAY=1
- UNZIP=1
--GLIDE=1
-+#GLIDE=1
- #GUI=1
--THREAD_SOUND=1
-+#THREAD_SOUND=1
-
- ifdef ZSNESFX
- FXOBJ=i386/fxemu2b.o i386/fxemu2.o i386/fxemu2c.o i386/fxtable.o i386/sfxproc.o i386/zsnes.o
-@@ -73,13 +73,13 @@
- endif
-
- MOC = $(QTDIR)/bin/moc
--CCC = g++ -fno-rtti
--CC = gcc
-+CCC = ${CXX} -fno-rtti
-+CC ?= gcc
- NASM = nasm
-
- INCLUDES=-I/usr/X11R6/include -I/usr/local/include
-
--OPTIMISE=-O6 -mpentium -fomit-frame-pointer -fno-exceptions
-+OPTIMISE= ${CXXFLAGS} -fomit-frame-pointer
- #OPTIMISE=-g -fno-exceptions
- #-DMITSHM
-
-@@ -87,7 +87,6 @@
- -Ii386 \
- -I. \
- -Iunzip \
---DJOYSTICK_SUPPORT \
- -DZLIB \
- -DNO_INLINE_SET_GET \
- -DVAR_CYCLES \
-@@ -100,7 +99,8 @@
- $(NETPLAYDEFINES) \
- $(UNZIPDEFINES) \
- $(GLIDEDEFINES) \
--$(GUIDEFINES)
-+$(GUIDEFINES) \
-+-DSOUND
-
- #-DSOUND
- #-DDEBUGGER
-@@ -112,12 +112,12 @@
- CFLAGS=$(CCFLAGS)
-
- .SUFFIXES: .o .cpp .c .cc .h .m .i .S .asm
--LDLIBS = -L/usr/X11R6/lib frame.o
-+LDLIBS = -L/usr/X11R6/lib
-
- ifdef NETPLAY
--all: offsets snes9x ssnes9x s9xserver
-+all: offsets snes9x s9xserver
- else
--all: offsets snes9x ssnes9x
-+all: offsets snes9x
- endif
-
- #ggisnes9x
-@@ -236,5 +236,4 @@
- snaporig.o: cpuexec.h
- unix/x11.o: snes9x.h port.h
- unix/glide.o: snes9x.h port.h 3d.h
--unix/x11.o: unix/snes9x_gui.h
- unix/snes9x_gui.o: unix/snes9x_gui.h
-diff -ruN ./Makefile.alpha ../release/Makefile.alpha
---- ./Makefile.alpha Wed Dec 31 16:00:00 1969
-+++ ../release/Makefile.alpha Sun Sep 19 18:41:45 1999
-@@ -0,0 +1,232 @@
-+#ZSNESFX=1
-+#ASMCPU=1
-+#SPC700ASM=1
-+NETPLAY=1
-+UNZIP=1
-+#GLIDE=1
-+#GUI=1
-+
-+ifdef ZSNESFX
-+FXOBJ=i386/fxemu2b.o i386/fxemu2.o i386/fxemu2c.o i386/fxtable.o i386/sfxproc.o i386/zsnes.o
-+FXDEFINES=-DZSNES_FX -DEXECUTE_SUPERFX_PER_LINE
-+FXDEPENDS=zsnes_fx
-+FXNO_DEPENDS=c_fx
-+else
-+FXOBJ=fxinst.o fxemu.o fxdbg.o
-+FXDEFINES=-DEXECUTE_SUPERFX_PER_LINE
-+FXDEPENDS=c_fx
-+FXNO_DEPENDS=zsnes_fx
-+endif
-+
-+LINUXDEFINES=-DUSE_DGA_EXTENSION -DUSE_VIDMODE_EXTENSION
-+
-+ifdef ASMCPU
-+ifdef SPC700ASM
-+CPUOBJ=i386/cpuops.o i386/cpuexec.o i386/spc700.o sa1cpu.o
-+CPUDEFINES=
-+else
-+CPUOBJ=i386/cpuops.o i386/cpuexec.o spc700.o i386/sa1ops.o
-+CPUDEFINES=-DSPC700_C
-+endif
-+else
-+CPUOBJ=cpuops.o cpuexec.o spc700.o sa1cpu.o
-+CPUDEFINES=
-+endif
-+
-+OBJECTS=$(CPUOBJ) cpu.o sa1.o debug.o tile.o \
-+ gfx.o memmap.o snaporig.o clip.o dsp1.o \
-+ ppu.o dma.o snes9x.o snapshot.o apu.o soundux.o \
-+ cheats.o data.o unix/unix.o unix/config.o $(FXOBJ) globals.o
-+
-+ifdef GUI
-+GUIOBJS = unix/snes9x_gui.o unix/moc_snes9x_gui.o
-+GUILIBS = -L$(QTDIR)/lib -lqt
-+GUIDEFINES = -I$(QTDIR)/include
-+endif
-+
-+ifdef NETPLAY
-+OBJECTS += netplay.o
-+NETPLAYDEFINES=-DNETPLAY_SUPPORT
-+SERVER_OBJECTS=server.o
-+endif
-+
-+ifdef UNZIP
-+OBJECTS += loadzip.o unzip/unzip.o unzip/explode.o unzip/unreduce.o unzip/unshrink.o
-+UNZIPDEFINES=-DUNZIP_SUPPORT
-+endif
-+
-+ifdef GLIDE
-+GLIDEOBJS = unix/glide.o
-+GLIDEDEFINES = -DUSE_GLIDE -I/usr/include/glide
-+GLIDELIBS = -lglide2x
-+GLIDEDEPENDS=use_glide
-+GLIDENO_DEPENDS=no_glide
-+else
-+GLIDEDEPENDS=no_glide
-+GLIDENO_DEPENDS=use_glide
-+endif
-+
-+MOC = $(QTDIR)/bin/moc
-+CCC = ${CXX} -fno-rtti
-+CC ?= gcc
-+NASM = nasm
-+
-+INCLUDES=-I/usr/X11R6/include -I/usr/local/include
-+
-+OPTIMISE=${CXXFLAGS} -fomit-frame-pointer
-+#OPTIMISE=-g -fno-exceptions
-+#-DMITSHM
-+
-+CCFLAGS = $(OPTIMISE) -DMITSHM \
-+-I. \
-+-Iunzip \
-+-DZLIB \
-+-DNO_INLINE_SET_GET \
-+-DVAR_CYCLES \
-+-DDEBUGGER \
-+-DCPU_SHUTDOWN \
-+-DSPC700_SHUTDOWN \
-+$(LINUXDEFINES) \
-+$(FXDEFINES) \
-+$(CPUDEFINES) \
-+$(NETPLAYDEFINES) \
-+$(UNZIPDEFINES) \
-+$(GLIDEDEFINES) \
-+$(GUIDEFINES) \
-+-DSOUND
-+
-+#-DSOUND
-+#-DDEBUGGER
-+#-DNO_INLINE_SET_GET
-+#-DVAR_CYCLES
-+#-DCPU_SHUTDOWN
-+#-DSPC700_SHUTDOWN
-+
-+CFLAGS=$(CCFLAGS)
-+
-+.SUFFIXES: .o .cpp .c .cc .h .m .i .S .asm
-+LDLIBS = -L/usr/X11R6/lib
-+
-+ifdef NETPLAY
-+all: offsets snes9x s9xserver
-+else
-+all: offsets snes9x
-+endif
-+
-+#ggisnes9x
-+#xf86snes9x
-+
-+$(FXDEPENDS):
-+ touch $(FXDEPENDS)
-+ $(RM) $(FXNO_DEPENDS)
-+
-+$(GLIDEDEPENDS):
-+ touch $(GLIDEDEPENDS)
-+ $(RM) $(GLIDENO_DEPENDS)
-+
-+offsets: offsets.o
-+ $(CCC) $(INCLUDES) -o $@ offsets.o
-+ ./offsets >i386/offsets.h
-+
-+snes9x: $(OBJECTS) unix/x11.o $(GLIDEOBJS) $(GUIOBJS)
-+ $(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(GLIDEOBJS) unix/x11.o $(GUIOBJS) $(LDLIBS) $(GLIDELIBS) $(GUILIBS) -lXxf86dga -lXxf86vm -lXext -lX11 -lz -lm
-+
-+ssnes9x: $(OBJECTS) unix/svga.o $(GLIDEOBJS)
-+ $(CCC) $(INCLUDES) -o $@ $(OBJECTS) $(GLIDEOBJS) unix/svga.o $(LDLIBS) $(GLIDELIBS) -lvga -lvgagl -lz -lm
-+
-+gsnes9x: $(OBJECTS) unix/ggi.o
-+ $(CCC) $(INCLUDES) -o $@ $(OBJECTS) unix/ggi.o $(LDLIBS) -lggi -lz -lm
-+
-+s9xserver: $(SERVER_OBJECTS)
-+ $(CCC) $(INCLUDES) -o $@ $(SERVER_OBJECTS)
-+
-+.cpp.o:
-+ $(CCC) $(INCLUDES) -c $(CCFLAGS) $*.cpp -o $@
-+
-+.c.o:
-+ $(CC) $(INCLUDES) -c $(CCFLAGS) $*.c -o $@
-+
-+.cpp.S:
-+ $(CCC) $(INCLUDES) -S $(CCFLAGS) $*.cpp -o $@
-+
-+.cpp.i:
-+ $(CCC) $(INCLUDES) -E $(CCFLAGS) $*.cpp -o $@
-+
-+.S.o:
-+ $(CCC) $(INCLUDES) -c $(CCFLAGS) $*.S -o $@
-+
-+.S.i:
-+ $(CCC) $(INCLUDES) -c -E $(CCFLAGS) $*.S -o $@
-+
-+.asm.o:
-+ $(NASM) -f elf -i. -ii386 -o $@ $*.asm
-+
-+unix/moc_snes9x_gui.cpp: unix/snes9x_gui.h
-+ $(MOC) unix/snes9x_gui.h -o $@
-+
-+clean:
-+ rm -f $(OBJECTS) offsets.o unix/svga.o unix/x11.o unix/ggi.o unix/xf86.o unix/glide.o
-+
-+#release: CCFLAGS += -DNO_DEBUGGER
-+
-+release: clean all
-+
-+ppu.o: $(FXDEPENDS)
-+cpu.o: $(FXDEPENDS)
-+memmap.o: $(FXDEPENDS)
-+globals.o: $(FXDEPENDS)
-+i386/cpuexec.o: $(FXDEPENDS)
-+snapshot.o: $(FXDEPENDS)
-+snaporig.o: $(FXDEPENDS)
-+
-+unix/unix.o: $(GLIDEDEPENDS)
-+unix/x11.o: $(GLIDEDEPENDS)
-+unix/glide.o: $(GLIDEDEPENDS)
-+gfx.o: $(GLIDEDEPENDS)
-+
-+i386/cpuexec.o: i386/asmstruc.h i386/offsets.h
-+i386/cpuops.o: i386/asmstruc.h i386/asmops.h i386/getset.S i386/asmaddr.h \
-+ i386/offsets.h
-+i386/spc700.o: i386/asmstruc.h i386/spcops.h i386/offsets.h
-+i386/sa1ops.o: i386/offsets.h i386/sa1struc.h i386/sa1addr.h i386/sa1ops.h \
-+ i386/sa1gs.S
-+cpuexec.o: cpuexec.h cpuops.h snes9x.h snapshot.h gfx.h sa1.h \
-+ memmap.h ppu.h debug.h port.h display.h apu.h spc700.h apu.h
-+cpuops.o: cpuops.h memmap.h snes9x.h spc700.h apu.h \
-+ cpuaddr.h cpumacro.h debug.h port.h cpuexec.h
-+debug.o: cpuops.h cpuexec.h snes9x.h sa1.h \
-+ memmap.h ppu.h debug.h missing.h port.h display.h apu.h
-+ppu.o: snes9x.h memmap.h ppu.h missing.h port.h cpuexec.h \
-+ apu.h spc700.h fxemu.h fxinst.h sa1.h
-+dsp1.o: snes9x.h port.h dsp1.h
-+snapshot.o: snapshot.h memmap.h snes9x.h 65c816.h ppu.h \
-+ cpuexec.h display.h apu.h spc700.h soundux.h sa1.h
-+snes96.o: port.h snes9x.h memmap.h
-+memmap.o: cpuexec.h snes9x.h memmap.h ppu.h port.h cheats.h getset.h apu.h \
-+ spc700.h sa1.h
-+unix.o: cpuexec.h snes9x.h port.h snapshot.h display.h apu.h gfx.h cheats.h
-+x11.o: display.h snes9x.h memmap.h debug.h ppu.h snapshot.h gfx.h
-+ggi.o: display.h snes9x.h memmap.h debug.h ppu.h snapshot.h gfx.h
-+svga.o: display.h snes9x.h memmap.h debug.h ppu.h snapshot.h gfx.h soundux.h
-+gfx.o: memmap.h snes9x.h ppu.h gfx.h display.h port.h
-+tile.o: memmap.h snes9x.h ppu.h display.h gfx.h tile.h 3d.h
-+spc700.o: spc700.h apu.h apumem.h snes9x.h memmap.h
-+sa1.o: snes9x.h memmap.h ppu.h cpuexec.h dma.h sa1.h cpuops.cpp 65c816.h
-+sa1cpu.o: snes9x.h memmap.h ppu.h cpuexec.h dma.h sa1.h cpuops.cpp 65c816.h
-+apu.o: spc700.h apu.h apumem.h snes9x.h soundux.h
-+soundux.o: snes9x.h soundux.h apu.h
-+dma.o: ppu.h dma.h memmap.h getset.h snes9x.h port.h apu.h spc700.h
-+cheats.o: cheats.h snes9x.h port.h memmap.h
-+fxemu.o: fxemu.h fxinst.h
-+fxinst.o: fxemu.h fxinst.h
-+fxdbg.o: fxemu.h fxinst.h
-+offsets.o: port.h snes9x.h memmap.h ppu.h apu.h cpuexec.h 65c816.h sa1.h
-+globals.o: memmap.h spc700.h apu.h cpuexec.h ppu.h cheats.h snes9x.h gfx.h \
-+ missing.h dma.h dsp1.h soundux.h sa1.h
-+xf86.o: display.h snes9x.h memmap.h debug.h ppu.h snapshot.h gfx.h
-+server.o: snes9x.h port.h memmap.h netplay.h
-+netplay.o: snes9x.h port.h memmap.h netplay.h
-+snaporig.o: cpuexec.h
-+unix/x11.o: snes9x.h port.h
-+unix/glide.o: snes9x.h port.h 3d.h
-+unix/snes9x_gui.o: unix/snes9x_gui.h
-diff -ruN ./fxemu.h ../release/fxemu.h
---- ./fxemu.h Sat Sep 18 09:18:08 1999
-+++ ../release/fxemu.h Sun Sep 19 18:41:45 1999
-@@ -39,18 +39,7 @@
- #ifndef _FXEMU_H_
- #define _FXEMU_H_ 1
-
--/* Types used by structures and code */
--#ifndef snes9x_types_defined
--#define snes9x_types_defined
--
--typedef unsigned char uint8;
--typedef unsigned short uint16;
--typedef unsigned long uint32;
--typedef unsigned char bool8;
--typedef signed char int8;
--typedef short int16;
--typedef int int32;
--#endif
-+#include "port.h"
-
- #ifndef TRUE
- #define TRUE 1
-diff -ruN ./i386/offsets.h ../release/i386/offsets.h
---- ./i386/offsets.h Sat Sep 18 09:18:08 1999
-+++ ../release/i386/offsets.h Sun Sep 19 18:47:04 1999
-@@ -1,41 +1,3 @@
--/*
-- * Snes9x - Portable Super Nintendo Entertainment System (TM) emulator.
-- *
-- * (c) Copyright 1996, 1997, 1998, 1999 Gary Henderson (gary@daniver.demon.co.uk) and
-- * Jerremy Koot (jkoot@snes9x.com)
-- *
-- * Super FX C emulator code
-- * (c) Copyright 1997, 1998, 1999 Ivar (Ivar@snes9x.com) and
-- * Gary Henderson.
-- * Super FX assembler emulator code (c) Copyright 1998 zsKnight and _Demo_.
-- *
-- * DSP1 emulator code (c) Copyright 1998 Ivar, _Demo_ and Gary Henderson.
-- * DOS port code contains the works of other authors. See headers in
-- * individual files.
-- *
-- * Snes9x homepage: www.snes9x.com
-- *
-- * Permission to use, copy, modify and distribute Snes9x in both binary and
-- * source form, for non-commercial purposes, is hereby granted without fee,
-- * providing that this license information and copyright notice appear with
-- * all copies and any derived work.
-- *
-- * This software is provided 'as-is', without any express or implied
-- * warranty. In no event shall the authors be held liable for any damages
-- * arising from the use of this software.
-- *
-- * Snes9x is freeware for PERSONAL USE only. Commercial users should
-- * seek permission of the copyright holders first. Commercial use includes
-- * charging money for Snes9x or software derived from Snes9x.
-- *
-- * The copyright holders request that bug fixes and improvements to the code
-- * should be forwarded to them so everyone can benefit from the modifications
-- * in future versions.
-- *
-- * Super NES and Super Nintendo Entertainment System are trademarks of
-- * Nintendo Co., Limited and its subsidiary companies.
-- */
--
- #define Flags CPU + 0
- #define BranchSkip CPU + 4
- #define NMIActive CPU + 5
-diff -ruN ./memmap.cpp ../release/memmap.cpp
---- ./memmap.cpp Sat Sep 18 09:18:08 1999
-+++ ../release/memmap.cpp Sun Sep 19 18:41:45 1999
-@@ -39,7 +39,7 @@
- #include <string.h>
- #include <ctype.h>
-
--#ifdef __linux
-+#if defined(__linux) || defined(__FreeBSD__)
- #include <unistd.h>
- #endif
-
-@@ -737,7 +737,7 @@
- {
- fwrite ((char *) ::SRAM, size, 1, file);
- fclose (file);
--#if defined(__linux)
-+#if defined(__linux) || defined(__FreeBSD__)
- chown (filename, getuid (), getgid ());
- #endif
- return (TRUE);
-Binary files ./offsets and ../release/offsets differ
-diff -ruN ./port.h ../release/port.h
---- ./port.h Sat Sep 18 09:18:08 1999
-+++ ../release/port.h Sun Sep 19 18:41:45 1999
-@@ -50,17 +50,17 @@
+diff -ru ../../work/release/port.h ./port.h
+--- ../../work/release/port.h Thu Sep 23 19:56:48 1999
++++ ./port.h Wed Dec 29 01:54:04 1999
+@@ -56,17 +56,17 @@
#ifndef snes9x_types_defined
#define snes9x_types_defined
@@ -425,7 +27,7 @@ diff -ruN ./port.h ../release/port.h
#endif
#endif
-@@ -137,6 +137,10 @@
+@@ -156,6 +156,10 @@
#ifdef __linux
#define TITLE "Snes9X: Linux"
@@ -436,143 +38,3 @@ diff -ruN ./port.h ../release/port.h
#endif
#ifndef TITLE
-Binary files ./s9xserver and ../release/s9xserver differ
-Binary files ./server.o and ../release/server.o differ
-Binary files ./snes9x and ../release/snes9x differ
-diff -ruN ./unix/unix.cpp ../release/unix/unix.cpp
---- ./unix/unix.cpp Sat Sep 18 09:18:08 1999
-+++ ../release/unix/unix.cpp Sun Sep 19 18:41:45 1999
-@@ -49,7 +49,7 @@
- #include <ctype.h>
-
-
--#if defined(__linux) || defined(__sun)
-+#if defined(__linux) || defined(__sun) || defined(__FreeBSD__)
- #undef USE_THREADS
- #define USE_THREADS
- #include <unistd.h>
-@@ -66,8 +66,12 @@
- pthread_mutex_t mutex;
- #endif
-
-+#ifndef __sun
- #ifdef __linux
- #include <sys/soundcard.h>
-+#else
-+#include <machine/soundcard.h>
-+#endif
- #include <sys/mman.h>
- #endif
-
-@@ -83,6 +87,10 @@
- typedef void (*SIG_PF)();
- #endif
-
-+#if defined(__FreeBSD__)
-+typedef sig_t SIG_PF;
-+#endif
-+
- #include "snes9x.h"
- #include "memmap.h"
- #include "debug.h"
-@@ -159,7 +167,7 @@
- char *rom_filename = NULL;
- char *snapshot_filename = NULL;
-
--#if defined(__linux) || defined(__sun)
-+#if defined(__linux) || defined(__sun) || defined(__FreeBSD__)
- static void sigbrkhandler(int)
- {
- #ifdef DEBUGGER
-@@ -402,7 +410,7 @@
- #if !defined(__MSDOS) && defined(DEBUGGER)
- #if defined(__unix) && !defined(__NeXT__)
- struct sigaction sa;
--#if defined(__linux)
-+#if defined(__linux) || defined(__FreeBSD__)
- sa.sa_handler = sigbrkhandler;
- #else
- sa.sa_handler = (SIG_PF) sigbrkhandler;
-@@ -1397,7 +1405,7 @@
- }
- #endif
-
--#if defined(__linux)
-+#if defined(__linux) || defined(__FreeBSD__)
- static int Rates[8] =
- {
- 0, 8192, 11025, 16500, 22050, 29300, 36600, 44000
-@@ -1514,7 +1522,7 @@
- }
- #endif
-
--#if defined (__linux) || defined (__sun)
-+#if defined (__linux) || defined (__sun) || defined(__FreeBSD__)
- void S9xUnixProcessSound (void)
- {
- }
-@@ -1613,7 +1621,7 @@
-
- void *S9xProcessSound (void *)
- {
--#ifdef __linux
-+#if defined(__linux) || defined(__FreeBSD__)
- audio_buf_info info;
- count_info count;
-
-diff -ruN ./unix/xf86.cpp ../release/unix/xf86.cpp
---- ./unix/xf86.cpp Tue Sep 22 06:36:50 1998
-+++ ../release/unix/xf86.cpp Sun Sep 19 18:41:45 1999
-@@ -4,16 +4,20 @@
- Question/comments regarding this file only: maciej@imsa.edu
- */
-
--#ifdef __linux
-+#if defined(__linux) || defined(__FreeBSD__)
- //#define USE_XF86VIDMODE
-
-+#ifdef __linux
- #include <asm/ioctls.h>
-+#endif
-+#include <sys/types.h>
- #include <sys/ioctl.h>
- #include <sys/time.h>
-+#ifdef __linux
- #include <linux/ioctl.h>
-+#endif
-
- #include <fcntl.h>
--#include <sys/types.h>
-
- #include <string.h>
- #include <ctype.h>
-@@ -833,4 +837,4 @@
- ret = 1;
- return (ret);
- }
--#endif /* __linux */
-+#endif /* __linux || __FreeBSD__ */
-diff -ruN ./unzip/unzip.h ../release/unzip/unzip.h
---- ./unzip/unzip.h Wed Aug 25 05:52:56 1999
-+++ ../release/unzip/unzip.h Sun Sep 19 18:47:00 1999
-@@ -41,13 +41,17 @@
- #ifndef _unz_H
- #define _unz_H
-
-+#include <sys/types.h>
-+
-+#ifndef _ZLIB_H
-+#include <zlib.h>
-+#endif
-+
- #ifdef __cplusplus
- extern "C" {
- #endif
-
--#ifndef _ZLIB_H
--#include "zlib.h"
--#endif
-+#define ZEXPORT
-
- #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
- /* like the STRICT of WIN32, we define a pointer that cannot be converted
diff --git a/emulators/snes9x/files/patch-af b/emulators/snes9x/files/patch-af
new file mode 100644
index 0000000..54a57f2
--- /dev/null
+++ b/emulators/snes9x/files/patch-af
@@ -0,0 +1,85 @@
+diff -ru ../../work/release/unix/unix.cpp ./unix/unix.cpp
+--- ../../work/release/unix/unix.cpp Thu Sep 23 19:56:48 1999
++++ ./unix/unix.cpp Wed Dec 29 01:56:32 1999
+@@ -49,9 +49,11 @@
+ #include <ctype.h>
+
+
+-#if defined(__linux) || defined(__sun)
++#if defined(__linux) || defined(__sun) || defined(__FreeBSD__)
++#if !defined(__FreeBSD__)
+ #undef USE_THREADS
+ #define USE_THREADS
++#endif
+ #include <unistd.h>
+ #include <sys/types.h>
+ #include <sys/ioctl.h>
+@@ -66,8 +68,12 @@
+ pthread_mutex_t mutex;
+ #endif
+
++#ifndef __sun
+ #ifdef __linux
+ #include <sys/soundcard.h>
++#else
++#include <machine/soundcard.h>
++#endif
+ #include <sys/mman.h>
+ #endif
+
+@@ -83,6 +89,10 @@
+ typedef void (*SIG_PF)();
+ #endif
+
++#if defined(__FreeBSD__)
++typedef sig_t SIG_PF;
++#endif
++
+ #include "snes9x.h"
+ #include "memmap.h"
+ #include "debug.h"
+@@ -159,7 +169,7 @@
+ char *rom_filename = NULL;
+ char *snapshot_filename = NULL;
+
+-#if defined(__linux) || defined(__sun)
++#if defined(__linux) || defined(__sun) || defined(__FreeBSD__)
+ static void sigbrkhandler(int)
+ {
+ #ifdef DEBUGGER
+@@ -402,7 +412,7 @@
+ #if !defined(__MSDOS) && defined(DEBUGGER)
+ #if defined(__unix) && !defined(__NeXT__)
+ struct sigaction sa;
+-#if defined(__linux)
++#if defined(__linux) || defined(__FreeBSD__)
+ sa.sa_handler = sigbrkhandler;
+ #else
+ sa.sa_handler = (SIG_PF) sigbrkhandler;
+@@ -1397,7 +1407,7 @@
+ }
+ #endif
+
+-#if defined(__linux)
++#if defined(__linux) || defined(__FreeBSD__)
+ static int Rates[8] =
+ {
+ 0, 8192, 11025, 16500, 22050, 29300, 36600, 44000
+@@ -1514,7 +1524,7 @@
+ }
+ #endif
+
+-#if defined (__linux) || defined (__sun)
++#if defined (__linux) || defined (__sun) || defined(__FreeBSD__)
+ void S9xUnixProcessSound (void)
+ {
+ }
+@@ -1613,7 +1623,7 @@
+
+ void *S9xProcessSound (void *)
+ {
+-#ifdef __linux
++#if defined(__linux) || defined(__FreeBSD__)
+ audio_buf_info info;
+ count_info count;
+
diff --git a/emulators/snes9x/files/patch-ag b/emulators/snes9x/files/patch-ag
new file mode 100644
index 0000000..eaac096
--- /dev/null
+++ b/emulators/snes9x/files/patch-ag
@@ -0,0 +1,32 @@
+diff -ru ../../work/release/unix/xf86.cpp ./unix/xf86.cpp
+--- ../../work/release/unix/xf86.cpp Tue Sep 22 06:36:50 1998
++++ ./unix/xf86.cpp Wed Dec 29 01:54:04 1999
+@@ -4,16 +4,20 @@
+ Question/comments regarding this file only: maciej@imsa.edu
+ */
+
+-#ifdef __linux
++#if defined(__linux) || defined(__FreeBSD__)
+ //#define USE_XF86VIDMODE
+
++#ifdef __linux
+ #include <asm/ioctls.h>
++#endif
++#include <sys/types.h>
+ #include <sys/ioctl.h>
+ #include <sys/time.h>
++#ifdef __linux
+ #include <linux/ioctl.h>
++#endif
+
+ #include <fcntl.h>
+-#include <sys/types.h>
+
+ #include <string.h>
+ #include <ctype.h>
+@@ -833,4 +837,4 @@
+ ret = 1;
+ return (ret);
+ }
+-#endif /* __linux */
++#endif /* __linux || __FreeBSD__ */
diff --git a/emulators/snes9x/files/patch-ah b/emulators/snes9x/files/patch-ah
new file mode 100644
index 0000000..8c2c145
--- /dev/null
+++ b/emulators/snes9x/files/patch-ah
@@ -0,0 +1,24 @@
+diff -ru ../../work/release/unzip/unzip.h ./unzip/unzip.h
+--- ../../work/release/unzip/unzip.h Wed Aug 25 05:52:56 1999
++++ ./unzip/unzip.h Wed Dec 29 01:54:04 1999
+@@ -41,13 +41,17 @@
+ #ifndef _unz_H
+ #define _unz_H
+
++#include <sys/types.h>
++
++#ifndef _ZLIB_H
++#include <zlib.h>
++#endif
++
+ #ifdef __cplusplus
+ extern "C" {
+ #endif
+
+-#ifndef _ZLIB_H
+-#include "zlib.h"
+-#endif
++#define ZEXPORT
+
+ #if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
+ /* like the STRICT of WIN32, we define a pointer that cannot be converted
OpenPOWER on IntegriCloud