1
0
mirror of https://git.FreeBSD.org/ports.git synced 2024-10-21 20:38:45 +00:00

Snes9X is updated to 1.25.

(And the villagers rejoiced!)
Snes9X actually builds now.
	(And the villagers rejoiced!)
Snes9X should actually work on the Alpha now.
	(And the villagers rejoiced!)
This commit is contained in:
Brian Feldman 1999-09-20 00:04:34 +00:00
parent c5922aa24d
commit 156a1aa3d9
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=21770
6 changed files with 526 additions and 81 deletions

View File

@ -6,27 +6,28 @@
# $FreeBSD$
#
DISTNAME= s9x119asrc
PKGNAME= snes9x-119a
DISTNAME= s9xs125
PKGNAME= snes9x-1.25
CATEGORIES= emulators
MASTER_SITES= http://www.snes9x.com/zips/
MAINTAINER= nacai@iname.com
MAINTAINER= green@FreeBSD.org
BUILD_DEPENDS= pgcc:${PORTSDIR}/lang/pgcc
BUILD_DEPENDS+= nasm:${PORTSDIR}/devel/nasm
ONLY_FOR_ARCHS= i386
.if ${MACHINE_ARCH} == i386
BUILD_DEPENDS= nasm:${PORTSDIR}/devel/nasm
.elif ${MACHINE_ARCH} == alpha
MAKEFILE= Makefile.alpha
.endif
USE_GMAKE= YES
USE_X_PREFIX= YES
MAKEFILE= Makefile.linux
ALL_TARGET= snes9x s9xserver
USE_ZIP= yes
USE_ZIP= YES
WRKSRC= ${WRKDIR}/release
ONLY_FOR_ARCHS= i386 alpha
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/snes9x ${PREFIX}/bin
${INSTALL_PROGRAM} ${WRKSRC}/s9xserver ${PREFIX}/bin

View File

@ -1 +1 @@
MD5 (s9x119asrc.zip) = 96a19ce2f301593676de13fd37e0c569
MD5 (s9xs125.zip) = 522ec53df3c3531349cc44357215f084

View File

@ -1,48 +0,0 @@
--- Makefile.linux.orig Fri Apr 30 17:57:48 1999
+++ Makefile.linux Thu Jul 1 09:57:11 1999
@@ -6,7 +6,7 @@
#GLIDE=1
ifdef ZSNESFX
-FXOBJ=i386/zsnes.o
+FXOBJ=i386/zsnes.o fxinst.o fxemu.o fxdbg.o
FXDEFINES=-DZSNES_FX -DEXECUTE_SUPERFX_PER_LINE
FXDEPENDS=zsnes_fx
FXNO_DEPENDS=c_fx
@@ -17,7 +17,7 @@
FXNO_DEPENDS=zsnes_fx
endif
-LINUXDEFINES=-DUSE_DGA_EXTENSION -DUSE_VIDMODE_EXTENSION
+LINUXDEFINES=-DUSE_DGA_EXTENSION -DUSE_VIDMODE_EXTENSION -D__linux
ifdef ASMCPU
ifdef SPC700ASM
@@ -59,8 +59,8 @@
GLIDENO_DEPENDS=use_glide
endif
-CCC = gcc
-CC = gcc
+CCC = pgcc
+CC = pgcc
NASM = nasm
INCLUDES=-I/usr/X11R6/include -I/usr/local/include
@@ -71,7 +71,6 @@
-Ii386 \
-I. \
-Iunzip \
--DJOYSTICK_SUPPORT \
-DZLIB \
-DNO_INLINE_SET_GET \
-DVAR_CYCLES \
@@ -101,7 +100,7 @@
# system using the egcs compiler get an undefined __register_frame_info
# symbol error when run on a Redhat box.
-LDLIBS = -L/usr/X11R6/lib frame.o
+LDLIBS = -L/usr/X11R6/lib
ifdef GLIDE
ifdef NETPLAY

View File

@ -1,11 +0,0 @@
--- port.h.orig Sat Mar 27 15:23:53 1999
+++ port.h Sat Mar 27 16:24:39 1999
@@ -125,7 +125,7 @@
#define SLASH_CHAR '/'
#endif
-#ifdef __linux
+#if defined(__linux) || defined(__FreeBSD__)
typedef void (*SignalHandler)(int);
#define SIG_PF SignalHandler
#endif

View File

@ -1,11 +0,0 @@
--- unix/unix.cpp.orig Sat Mar 27 15:20:06 1999
+++ unix/unix.cpp Sat Mar 27 15:20:14 1999
@@ -57,7 +57,7 @@
#endif
#ifdef __linux
-#include <sys/soundcard.h>
+#include <machine/soundcard.h>
#endif
#ifdef __sun

View File

@ -0,0 +1,514 @@
--- ./fxemu.h Fri Sep 10 21:43:14 1999
+++ ../release.new/fxemu.h Sat Sep 11 19:59:11 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
--- ./memmap.cpp Fri Sep 10 21:43:14 1999
+++ ../release.new/memmap.cpp Sat Sep 11 15:26:24 1999
@@ -39,7 +39,7 @@
#include <string.h>
#include <ctype.h>
-#ifdef __linux
+#if defined(__linux) || defined(__FreeBSD__)
#include <unistd.h>
#endif
@@ -725,7 +725,7 @@
{
fwrite ((char *) ::SRAM, size, 1, file);
fclose (file);
-#if defined(__linux)
+#if defined(__linux) || defined(__FreeBSD__)
chown (filename, getuid (), getgid ());
#endif
return (TRUE);
--- ./port.h Fri Sep 10 21:43:16 1999
+++ ../release.new/port.h Sat Sep 11 15:49:55 1999
@@ -50,17 +50,17 @@
#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;
+typedef u_int8_t uint8;
+typedef u_int16_t uint16;
+typedef u_int32_t uint32;
+typedef u_int8_t bool8;
+typedef int8_t int8;
+typedef int16_t int16;
+typedef int32_t int32;
#ifndef _WIN32
typedef long long int64;
#else
-typedef __int64 int64;
+typedef u_int64_t int64;
#endif
#endif
@@ -137,6 +137,10 @@
#ifdef __linux
#define TITLE "Snes9X: Linux"
+#endif
+
+#ifdef __FreeBSD__
+#define TITLE "Snes9X: FreeBSD"
#endif
#ifndef TITLE
--- ./unix/unix.cpp Fri Sep 10 21:43:16 1999
+++ ../release.new/unix/unix.cpp Sat Sep 11 15:34:14 1999
@@ -48,18 +48,21 @@
#include <sys/types.h>
#include <ctype.h>
-#if defined(__linux) || defined(__sun)
+#if defined(__linux) || defined(__sun) || defined(__FreeBSD__)
#include <unistd.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/time.h>
#include <signal.h>
-#endif
-
-#ifdef __linux
-#include <sys/soundcard.h>
+#ifndef __sun
+#ifdef __linux
+#include <sys/soundcard.h>
+#else
+#include <machine/soundcard.h>
+#endif
#include <sys/mman.h>
#endif
+#endif
#ifdef __sun
#ifdef __SVR4
@@ -73,6 +76,10 @@
typedef void (*SIG_PF)();
#endif
+#if defined(__FreeBSD__)
+typedef sig_t SIG_PF;
+#endif
+
#include "snes9x.h"
#include "memmap.h"
#include "debug.h"
@@ -149,7 +156,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
@@ -392,7 +399,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;
@@ -1379,7 +1386,7 @@
}
#endif
-#if defined(__linux)
+#if defined(__linux) || defined(__FreeBSD__)
static int Rates[8] =
{
0, 8192, 11025, 16500, 22050, 29300, 36600, 44000
@@ -1496,7 +1503,7 @@
}
#endif
-#if defined (__linux) || defined (__sun)
+#if defined (__linux) || defined (__sun) || defined(__FreeBSD__)
void S9xUnixProcessSound (void)
{
}
@@ -1579,7 +1586,7 @@
void S9xProcessSound ()
{
-#ifdef __linux
+#if defined(__linux) || defined(__FreeBSD__)
audio_buf_info info;
count_info count;
--- ./unix/xf86.cpp Tue Sep 22 06:36:50 1998
+++ ../release.new/unix/xf86.cpp Sat Sep 11 15:35:30 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__ */
--- ./unzip/unzip.h Wed Aug 25 05:52:56 1999
+++ ../release.new/unzip/unzip.h Sat Sep 11 19:47:56 1999
@@ -41,13 +41,14 @@
#ifndef _unz_H
#define _unz_H
+#include <sys/types.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#ifndef _ZLIB_H
-#include "zlib.h"
-#endif
+#define ZEXPORT
+typedef off_t z_off_t;
#if defined(STRICTUNZIP) || defined(STRICTZIPUNZIP)
/* like the STRICT of WIN32, we define a pointer that cannot be converted
--- ../release/Makefile Wed Sep 15 17:22:32 1999
+++ Makefile Sun Sep 19 18:50:07 1999
@@ -3,8 +3,8 @@
#SPC700ASM=1
NETPLAY=1
UNZIP=1
-GLIDE=1
-GUI=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
@@ -73,7 +73,7 @@
INCLUDES=-I/usr/X11R6/include -I/usr/local/include
-OPTIMISE=-O6 -mpentium -fomit-frame-pointer -fno-exceptions
+OPTIMISE=-O -fomit-frame-pointer
#OPTIMISE=-g -fno-exceptions
#-DMITSHM
@@ -81,7 +81,6 @@
-Ii386 \
-I. \
-Iunzip \
--DJOYSTICK_SUPPORT \
-DZLIB \
-DNO_INLINE_SET_GET \
-DVAR_CYCLES \
@@ -94,7 +93,8 @@
$(NETPLAYDEFINES) \
$(UNZIPDEFINES) \
$(GLIDEDEFINES) \
-$(GUIDEFINES)
+$(GUIDEFINES) \
+-DSOUND
#-DSOUND
#-DDEBUGGER
@@ -106,12 +106,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
@@ -230,5 +230,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
--- /dev/null Sun Sep 19 19:19:09 1999
+++ Makefile.alpha Sun Sep 19 19:21:24 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 = g++ -fno-rtti
+CC = gcc
+NASM = nasm
+
+INCLUDES=-I/usr/X11R6/include -I/usr/local/include
+
+OPTIMISE=-O -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