Import sdlmame 0.130 :

MAME stands for Multi Arcade Machine Emulator. As the name suggests, it
is a program that emulates the hardware (and low-level firmware) of a
massive variety of arcade machines.
SDLMAME is a port of MAME using the SDL library.

After many submissions and updates by Pierre Riteau (at gmail), thanks!
This commit is contained in:
landry 2009-03-17 19:55:09 +00:00
parent 1bb632c879
commit 0bd408a5cb
13 changed files with 357 additions and 0 deletions

View File

@ -0,0 +1,75 @@
# $OpenBSD: Makefile,v 1.1.1.1 2009/03/17 19:55:09 landry Exp $
# Other archs have not been tested
ONLY_FOR_ARCHS = amd64 i386
MULTI_PACKAGES = -main -tools
COMMENT-main = emulates a massive variety of arcades machines
COMMENT-tools = tools to manipulate MAME/MESS roms and disk images
V = 130
DISTNAME = sdlmame0${V}
PKGNAME-main = sdlmame-0.${V}
PKGNAME-tools = sdlmame-tools-0.${V}
CATEGORIES = emulators games
HOMEPAGE = http://rbelmont.mameworld.info/?page_id=163
MAINTAINER = Pierre Riteau <pierre.riteau@gmail.com>
# MAME Distribution License, see http://mamedev.org/license.html
PERMIT_PACKAGE_CDROM = may not sell
PERMIT_PACKAGE_FTP = Yes
PERMIT_DISTFILES_CDROM = may not sell
PERMIT_DISTFILES_FTP = Yes
WANTLIB += ORBit-2 X11 Xau Xcomposite Xcursor Xdamage Xdmcp Xext
WANTLIB += Xfixes Xi Xinerama Xrandr Xrender atk-1.0 c cairo dbus-1
WANTLIB += expat fontconfig freetype gio-2.0 glib-2.0 glitz gmodule-2.0
WANTLIB += gobject-2.0 gthread-2.0 iconv intl m pango-1.0 pangocairo-1.0
WANTLIB += pangoft2-1.0 pixman-1 png pthread z
MASTER_SITES = http://rbelmont.mameworld.info/
EXTRACT_SUFX = .zip
MODULES = gcc4
MODGCC4_ARCHES = *
MODGCC4_LANG = c
LIB_DEPENDS = SDL::devel/sdl gconf-2.>=5::devel/gconf2 \
gdk-x11-2.0.>=0.11,gdk_pixbuf-2.0.>=0.11,gtk-x11-2.0.>=0.11::x11/gtk+2
RUN_DEPENDS-main = :sdlmame-tools-0.${V}:emulators/sdlmame,-tools
USE_GMAKE = Yes
USE_X11 = Yes
NO_REGRESS = Yes
VMEM_WARNING = Yes
MAKE_ENV = ARCH=$(ARCH) CC=$(CC) CFLAGS="$(CFLAGS)" LD=$(CC) \
TARGETOS=openbsd
.if ${MACHINE_ARCH} == "amd64"
MAKE_ENV+= PTR64=1
.endif
MAKE_FILE = makefile
MAME_EXTBIN = chdman jedutil ldresample ldverify romcmp
MAME_DOC = config.txt license.txt mame.txt newvideo.txt
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/mame ${PREFIX}/bin/sdlmame
.for i in ${MAME_EXTBIN}
${INSTALL_PROGRAM} ${WRKSRC}/${i} ${PREFIX}/bin/${i}
.endfor
${INSTALL_DATA_DIR} ${PREFIX}/share/sdlmame/keymaps
${INSTALL_DATA} ${WRKSRC}/keymaps/km[-_]??.txt \
${PREFIX}/share/sdlmame/keymaps/
${INSTALL_DATA_DIR} ${PREFIX}/share/doc/sdlmame
.for i in ${MAME_DOC}
${INSTALL_DATA} ${WRKSRC}/docs/${i} ${PREFIX}/share/doc/sdlmame/
.endfor
${INSTALL_DATA} $(WRKSRC)/SDLMAME.txt ${PREFIX}/share/doc/sdlmame/
.include <bsd.port.mk>

View File

@ -0,0 +1,5 @@
MD5 (sdlmame0130.zip) = EZXaC2rnYu7rsh9QBQnWLQ==
RMD160 (sdlmame0130.zip) = 96ra0tnq1v2Dtc9z2AwoSRskwK4=
SHA1 (sdlmame0130.zip) = r20FAmVGcoWzC2BvCkBtmig31bY=
SHA256 (sdlmame0130.zip) = 1vJSkex5WD3OswCnIfdqENGDmtE4kOUdntR7UjY2Peg=
SIZE (sdlmame0130.zip) = 17681979

View File

@ -0,0 +1,57 @@
$OpenBSD: patch-makefile,v 1.1.1.1 2009/03/17 19:55:09 landry Exp $
--- makefile.orig Thu Mar 5 15:16:35 2009
+++ makefile Sun Mar 15 15:05:18 2009
@@ -125,10 +125,10 @@ endif
# BIGENDIAN = 1
# uncomment next line to build expat as part of MAME build
-BUILD_EXPAT = 1
+# BUILD_EXPAT = 1
# uncomment next line to build zlib as part of MAME build
-BUILD_ZLIB = 1
+# BUILD_ZLIB = 1
# uncomment next line to include the symbols
# SYMBOLS = 1
@@ -197,8 +197,8 @@ endif
# compiler, linker and utilities
AR = @ar
-CC = @gcc
-LD = @gcc
+CC ?= @gcc
+LD ?= @gcc
MD = -mkdir$(EXE)
RM = @rm -f
@@ -227,7 +227,7 @@ NAME = $(TARGET)$(SUBTARGET)
endif
# fullname is prefix+name+suffix+debugsuffix
-FULLNAME = $(PREFIX)$(NAME)$(CPPSUFFIX)$(SUFFIX)$(DEBUGSUFFIX)
+FULLNAME = $(NAME)$(CPPSUFFIX)$(SUFFIX)$(DEBUGSUFFIX)
# add an EXE suffix to get the final emulator name
EMULATOR = $(FULLNAME)$(EXE)
@@ -302,9 +302,9 @@ CPPONLYFLAGS =
# CFLAGS is defined based on C or C++ targets
# (remember, expansion only happens when used, so doing it here is ok)
ifdef CPP_COMPILE
-CFLAGS = $(CCOMFLAGS) $(CPPONLYFLAGS)
+CFLAGS += $(CCOMFLAGS) $(CPPONLYFLAGS)
else
-CFLAGS = $(CCOMFLAGS) $(CONLYFLAGS)
+CFLAGS += $(CCOMFLAGS) $(CONLYFLAGS)
endif
# we compile C-only to C89 standard with GNU extensions
@@ -331,7 +331,7 @@ CCOMFLAGS += -pg
endif
# add the optimization flag
-CCOMFLAGS += -O$(OPTIMIZE)
+#CCOMFLAGS += -O$(OPTIMIZE)
# if we are optimizing, include optimization options
# and make all errors into warnings

View File

@ -0,0 +1,15 @@
$OpenBSD: patch-src_osd_sdl_sdl_mak,v 1.1.1.1 2009/03/17 19:55:09 landry Exp $
--- src/osd/sdl/sdl.mak.orig Sat Jan 10 18:28:42 2009
+++ src/osd/sdl/sdl.mak Sat Jan 10 18:27:52 2009
@@ -130,6 +130,11 @@ TARGETOS = unix
DEFS += -DNO_THREAD_COOPERATIVE -DNO_DEBUGGER
endif
+ifeq ($(TARGETOS),openbsd)
+TARGETOS = unix
+DEFS += -DNO_THREAD_COOPERATIVE
+endif
+
ifeq ($(TARGETOS),unix)
DEFS += -DSDLMAME_UNIX
ifndef NO_X11

View File

@ -0,0 +1,57 @@
$OpenBSD: patch-src_osd_sdl_sdldir_c,v 1.1.1.1 2009/03/17 19:55:09 landry Exp $
--- src/osd/sdl/sdldir.c.orig Sun Mar 15 10:50:02 2009
+++ src/osd/sdl/sdldir.c Sun Mar 15 10:53:02 2009
@@ -13,7 +13,7 @@
#ifdef SDLMAME_LINUX
#define __USE_LARGEFILE64
#endif
-#ifndef SDLMAME_FREEBSD
+#ifndef SDLMAME_BSD
#define _XOPEN_SOURCE 500
#endif
@@ -43,7 +43,7 @@
struct _osd_directory
{
osd_directory_entry ent;
-#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
+#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
struct dirent *data;
#else
struct dirent64 *data;
@@ -52,7 +52,7 @@ struct _osd_directory
};
-#if defined (SDLMAME_LINUX) || defined (SDLMAME_FREEBSD) || defined(SDLMAME_DARWIN)
+#if defined (SDLMAME_LINUX) || defined (SDLMAME_BSD) || defined(SDLMAME_DARWIN)
static osd_dir_entry_type get_attributes_enttype(int attributes)
{
if (attributes == DT_DIR)
@@ -85,7 +85,7 @@ static osd_dir_entry_type get_attributes_stat(const ch
static UINT64 osd_get_file_size(const char *file)
{
-#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
+#if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
struct stat st;
if(stat(file, &st))
return 0;
@@ -171,7 +171,7 @@ osd_directory *osd_opendir(const char *dirname)
const osd_directory_entry *osd_readdir(osd_directory *dir)
{
- #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
+ #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
dir->data = readdir(dir->fd);
#else
dir->data = readdir64(dir->fd);
@@ -181,7 +181,7 @@ const osd_directory_entry *osd_readdir(osd_directory *
return NULL;
dir->ent.name = dir->data->d_name;
- #if defined (SDLMAME_LINUX) || defined (SDLMAME_FREEBSD) || defined(SDLMAME_DARWIN)
+ #if defined (SDLMAME_LINUX) || defined (SDLMAME_BSD) || defined(SDLMAME_DARWIN)
dir->ent.type = get_attributes_enttype(dir->data->d_type);
#else
dir->ent.type = get_attributes_stat(dir->data->d_name);

View File

@ -0,0 +1,82 @@
$OpenBSD: patch-src_osd_sdl_sdlfile_c,v 1.1.1.1 2009/03/17 19:55:09 landry Exp $
--- src/osd/sdl/sdlfile.c.orig Sun Mar 15 10:50:07 2009
+++ src/osd/sdl/sdlfile.c Sun Mar 15 10:53:02 2009
@@ -13,7 +13,7 @@
#ifdef SDLMAME_LINUX
#define __USE_LARGEFILE64
#endif
-#ifndef SDLMAME_FREEBSD
+#ifndef SDLMAME_BSD
#define _XOPEN_SOURCE 500
#endif
@@ -96,7 +96,7 @@ file_error osd_open(const char *path, UINT32 openflags
UINT32 access;
const char *src;
char *dst;
- #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
+ #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
struct stat st;
#else
struct stat64 st;
@@ -180,7 +180,7 @@ file_error osd_open(const char *path, UINT32 openflags
#endif
// attempt to open the file
- #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
+ #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
(*file)->handle = open(tmpstr, access, 0666);
#else
(*file)->handle = open64(tmpstr, access, 0666);
@@ -203,7 +203,7 @@ file_error osd_open(const char *path, UINT32 openflags
// attempt to reopen the file
if (error == NO_ERROR)
{
- #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
+ #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
(*file)->handle = open(tmpstr, access, 0666);
#else
(*file)->handle = open64(tmpstr, access, 0666);
@@ -223,7 +223,7 @@ file_error osd_open(const char *path, UINT32 openflags
}
// get the file size
- #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
+ #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
fstat((*file)->handle, &st);
#else
fstat64((*file)->handle, &st);
@@ -253,7 +253,7 @@ file_error osd_read(osd_file *file, void *buffer, UINT
{
ssize_t result;
-#if defined(SDLMAME_DARWIN) || defined(SDLMAME_FREEBSD)
+#if defined(SDLMAME_DARWIN) || defined(SDLMAME_BSD)
result = pread(file->handle, buffer, count, offset);
if (result < 0)
#elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_OS2)
@@ -281,7 +281,7 @@ file_error osd_write(osd_file *file, const void *buffe
{
UINT32 result;
-#if defined(SDLMAME_DARWIN) || defined(SDLMAME_FREEBSD)
+#if defined(SDLMAME_DARWIN) || defined(SDLMAME_BSD)
result = pwrite(file->handle, buffer, count, offset);
if (!result)
#elif defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_OS2)
@@ -465,13 +465,13 @@ osd_directory_entry *osd_stat(const char *path)
{
int err;
osd_directory_entry *result = NULL;
- #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
+ #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
struct stat st;
#else
struct stat64 st;
#endif
- #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_FREEBSD) || defined(SDLMAME_OS2)
+ #if defined(SDLMAME_DARWIN) || defined(SDLMAME_WIN32) || defined(SDLMAME_NO64BITIO) || defined(SDLMAME_BSD) || defined(SDLMAME_OS2)
err = stat(path, &st);
#else
err = stat64(path, &st);

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_osd_sdl_sdlmain_c,v 1.1.1.1 2009/03/17 19:55:09 landry Exp $
--- src/osd/sdl/sdlmain.c.orig Sun Mar 15 10:50:13 2009
+++ src/osd/sdl/sdlmain.c Sun Mar 15 10:53:02 2009
@@ -455,7 +455,7 @@ static void defines_verbose(void)
MACRO_VERBOSE(SDLMAME_LINUX);
MACRO_VERBOSE(SDLMAME_SOLARIS);
MACRO_VERBOSE(SDLMAME_IRIX);
- MACRO_VERBOSE(SDLMAME_FREEBSD);
+ MACRO_VERBOSE(SDLMAME_BSD);
MACRO_VERBOSE(LSB_FIRST);
MACRO_VERBOSE(PTR64);
MACRO_VERBOSE(MAME_DEBUG);

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-src_osd_sdl_sdlmisc_c,v 1.1.1.1 2009/03/17 19:55:09 landry Exp $
--- src/osd/sdl/sdlmisc.c.orig Sun Mar 15 10:50:18 2009
+++ src/osd/sdl/sdlmisc.c Sun Mar 15 10:53:02 2009
@@ -50,7 +50,7 @@ void *osd_alloc_executable(size_t size)
{
#if defined(SDLMAME_DARWIN)
return (void *)malloc(size);
-#elif defined(SDLMAME_FREEBSD)
+#elif defined(SDLMAME_BSD)
return (void *)mmap(0, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, -1, 0);
#elif defined(SDLMAME_UNIX)
return (void *)mmap(0, size, PROT_EXEC|PROT_READ|PROT_WRITE, MAP_ANON|MAP_SHARED, 0, 0);

View File

@ -0,0 +1,14 @@
$OpenBSD: patch-src_osd_sdl_sdlprefix_h,v 1.1.1.1 2009/03/17 19:55:09 landry Exp $
--- src/osd/sdl/sdlprefix.h.orig Sun Mar 15 10:47:29 2009
+++ src/osd/sdl/sdlprefix.h Sun Mar 15 10:48:01 2009
@@ -30,8 +30,8 @@
#elif defined(__linux__)
#define SDLMAME_LINUX 1
-#elif defined(__FreeBSD__) || defined(__DragonFly__)
-#define SDLMAME_FREEBSD 1
+#elif defined(__FreeBSD__) || defined(__DragonFly__) || defined(__OpenBSD__)
+#define SDLMAME_BSD 1
#endif
// fix for Ubuntu 8.10

View File

@ -0,0 +1,5 @@
MAME stands for Multi Arcade Machine Emulator. As the name suggests, it
is a program that emulates the hardware (and low-level firmware) of a
massive variety of arcade machines.
SDLMAME is a port of MAME using the SDL library.

View File

@ -0,0 +1,2 @@
This package contains tools to manipulate roms and disk images used by
SDLMAME and SDLMESS.

View File

@ -0,0 +1,15 @@
@comment $OpenBSD: PLIST-main,v 1.1.1.1 2009/03/17 19:55:09 landry Exp $
@bin bin/sdlmame
share/doc/sdlmame/
share/doc/sdlmame/SDLMAME.txt
share/doc/sdlmame/config.txt
share/doc/sdlmame/license.txt
share/doc/sdlmame/mame.txt
share/doc/sdlmame/newvideo.txt
share/sdlmame/
share/sdlmame/keymaps/
share/sdlmame/keymaps/km-be.txt
share/sdlmame/keymaps/km-ch.txt
share/sdlmame/keymaps/km-de.txt
share/sdlmame/keymaps/km-fr.txt
share/sdlmame/keymaps/km_it.txt

View File

@ -0,0 +1,6 @@
@comment $OpenBSD: PLIST-tools,v 1.1.1.1 2009/03/17 19:55:09 landry Exp $
@bin bin/chdman
@bin bin/jedutil
@bin bin/ldresample
@bin bin/ldverify
@bin bin/romcmp