summaryrefslogtreecommitdiff
path: root/emulators
diff options
context:
space:
mode:
authorwiz <wiz@pkgsrc.org>2015-07-14 20:14:49 +0000
committerwiz <wiz@pkgsrc.org>2015-07-14 20:14:49 +0000
commitf157870a64a5a0355c5f4b1e214567c4724b33b1 (patch)
treec8828098c2acdfdf15aeefd9c9e0e353a35b4c22 /emulators
parent63bfd87f0fcf5558696fd9c9025f16fedb69f9a4 (diff)
downloadpkgsrc-f157870a64a5a0355c5f4b1e214567c4724b33b1.tar.gz
Update to 0.163. Major change compared to previous 0.159:
MESS is now part of MAME. Otherwise, the usual improvements and new drivers.
Diffstat (limited to 'emulators')
-rw-r--r--emulators/mame/Makefile138
-rw-r--r--emulators/mame/Makefile.common95
-rw-r--r--emulators/mame/PLIST417
-rw-r--r--emulators/mame/distinfo18
-rw-r--r--emulators/mame/patches/patch-3rdparty_bgfx_src_renderer__null.cpp43
-rw-r--r--emulators/mame/patches/patch-3rdparty_bx_include_bx_os.h29
-rw-r--r--emulators/mame/patches/patch-3rdparty_bx_include_bx_platform.h41
-rw-r--r--emulators/mame/patches/patch-3rdparty_portmidi_porttime_ptlinux.c39
-rw-r--r--emulators/mame/patches/patch-makefile78
-rw-r--r--emulators/mame/patches/patch-scripts_src_3rdparty.lua32
-rw-r--r--emulators/mame/patches/patch-scripts_toolchain.lua56
-rw-r--r--emulators/mame/patches/patch-src_osd_osdmini_minifile.c32
-rw-r--r--emulators/mame/patches/patch-src_osd_sdl_osinline.h34
13 files changed, 851 insertions, 201 deletions
diff --git a/emulators/mame/Makefile b/emulators/mame/Makefile
index 4af5e6d41a9..1517efb7ecd 100644
--- a/emulators/mame/Makefile
+++ b/emulators/mame/Makefile
@@ -1,36 +1,130 @@
-# $NetBSD: Makefile,v 1.41 2015/04/25 14:20:46 tnn Exp $
+# $NetBSD: Makefile,v 1.42 2015/07/14 20:14:49 wiz Exp $
-DISTNAME= mame0160s
+DISTNAME= mame0163s
PKGNAME= ${DISTNAME:S/0/-0./:S/s$//}
-PKGREVISION= 2
-MASTER_SITES= http://mamedev.org/downloader.php?file=releases/
+CATEGORIES= emulators
+MASTER_SITES= https://github.com/mamedev/mame/releases/download/mame0163/
+EXTRACT_SUFX= .zip
+MAINTAINER= wiz@NetBSD.org
+HOMEPAGE= http://www.mamedev.org/
COMMENT= Multiple Arcade Machine Emulator
-
-CONFLICTS= xmame-[0-9]* sdlmame-[0-9]*
+LICENSE= mame-license
DOCDIR= share/doc/mame
+SHAREDIR= share/mame
INSTALLATION_DIRS= bin ${DOCDIR} ${PKGMANDIR}/man1 ${PKGMANDIR}/man6
+INSTALLATION_DIRS+= ${SHAREDIR}/artwork ${SHAREDIR}/hash
+
+
+RESTRICTED= selling is not allowed
+NO_SRC_ON_CDROM= ${RESTRICTED}
+NO_BIN_ON_CDROM= ${RESTRICTED}
+
+BUILD_DEPENDS+= dos2unix-[0-9]*:../../converters/dos2unix
+DEPENDS+= liberation-ttf-[0-9]*:../../fonts/liberation-ttf
+
+WRKSRC= ${WRKDIR}
+
+USE_LANGUAGES= c99 c++
+USE_TOOLS+= gmake pkg-config
+UNLIMIT_RESOURCES+= datasize
+MAKE_FILE= makefile
+# 0.141 has too many conversion warnings
+MAKE_ENV= NOWERROR=1
+
+# mongoose needs libpthread but somehow doesn't link against it
+MAKE_ENV+= LDOPTS="-Wl,-R${BUILDLINK_PREFIX.flac}/lib -L${BUILDLINK_PREFIX.flac}/lib -lpthread"
+
+# use pkgsrc packages for expat, zlib, jpeg, flac, lua, sqlite3
+MAKE_ENV+= USE_SYSTEM_LIB_EXPAT=1
+MAKE_ENV+= USE_SYSTEM_LIB_ZLIB=1
+MAKE_ENV+= USE_SYSTEM_LIB_JPEG=1
+MAKE_ENV+= USE_SYSTEM_LIB_FLAC=1
+MAKE_ENV+= USE_SYSTEM_LIB_LUA=1
+MAKE_ENV+= USE_SYSTEM_LIB_SQLITE3=1
+# no portmidi package exists yet
+#MAKE_ENV+= USE_SYSTEM_LIB_PORTMIDI=1
+# find proper python binary
+MAKE_ENV+= PYTHON_EXECUTABLE=${PYTHONBIN}
+# don't depend on qt4
+MAKE_ENV+= USE_QTDEBUG=0
+# avoid midi for now
+#MAKE_ENV+= NO_USE_MIDI=1
+# build tools
+MAKE_ENV+= TOOLS=1
+
+.include "../../mk/compiler.mk"
+
+.if !empty(PKGSRC_COMPILER:Mclang)
+_WRAP_EXTRA_ARGS.CC+= -Wno-error=cast-align \
+ -Wno-error=constant-logical-operand \
+ -Wno-error=sometimes-uninitialized \
+ -Wno-error=shift-count-overflow \
+ -Wno-error=unused-private-field \
+ -Wno-error=tautological-constant-out-of-range-compare \
+ -Wno-error=tautological-compare \
+ -Wno-error=self-assign-field \
+ -Wno-error=unused-const-variable \
+ -Wno-error=unused-function
+CWRAPPERS_APPEND.cc+= -Wno-error=cast-align \
+ -Wno-error=constant-logical-operand \
+ -Wno-error=sometimes-uninitialized \
+ -Wno-error=shift-count-overflow \
+ -Wno-error=unused-private-field \
+ -Wno-error=tautological-constant-out-of-range-compare \
+ -Wno-error=tautological-compare \
+ -Wno-error=self-assign-field \
+ -Wno-error=unused-const-variable \
+ -Wno-error=unused-function
+MAKE_ENV+= OPTIMIZE=2
+.endif
+
+. include "../../mk/endian.mk"
+
+.if ${MACHINE_ENDIAN:Mbig}
+MAKE_ENV+= BIGENDIAN=1
+.endif
+
+PYTHON_FOR_BUILD_ONLY= yes
+PYTHON_VERSIONS_INCOMPATIBLE= 33 34 # not yet ported as of 0.151
+
+# mame source is double-zipped
+post-extract:
+ cd ${WRKDIR} && ${.CURDIR}/../../mk/extract/extract mame.zip
+ rm ${WRKDIR}/mame.zip
+ # This needs to be done for every file that is patched.
+ ${RUN} for f in 3rdparty/mongoose/mongoose.c makefile; do \
+ ${CP} ${WRKSRC}/$${f} ${WRKSRC}/$${f}.bak; \
+ ${CAT} ${WRKSRC}/$${f}.bak | dos2unix >${WRKSRC}/$${f}; \
+ done
+pre-build:
+ # problems with mame-specific png.h
+ ${RM} -f ${WRKDIR}/.buildlink/include/png*
-# not installed, because not found necessary so far:
-# regrep, split, src2html, srcclean, testkeys
do-install:
+ ${INSTALL_PROGRAM} ${WRKSRC}/mame64 ${DESTDIR}${PREFIX}/bin/mame
set -e; \
- for prg in chdman jedutil ldresample ldverify mame romcmp unidasm; \
+ for prg in castool chdman floptool imgtool jedutil ldresample ldverify \
+ nltool pngcmp regrep romcmp split src2html srcclean testkeys unidasm; \
do \
${INSTALL_PROGRAM} ${WRKSRC}/"$$prg" ${DESTDIR}${PREFIX}/bin; \
done
- set -e; \
- for doc in config.txt license.txt mame.txt; do \
- ${INSTALL_DATA} ${WRKSRC}/docs/"$$doc" ${DESTDIR}${PREFIX}/${DOCDIR}; \
- done
-# skipped: ldplayer man page exists, but no binary?
-# skipped: testkeys, binary not installed
- set -e; \
- for man in chdman.1 jedutil.1 ldverify.1 romcmp.1; \
- do \
- ${INSTALL_DATA} ${WRKSRC}/src/osd/sdl/man/"$$man" ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1; \
- done
- ${INSTALL_DATA} ${WRKSRC}/src/osd/sdl/man/mame.6 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man6
+ ${INSTALL_DATA} ${WRKSRC}/src/osd/sdl/man/*.1 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man1
+ ${INSTALL_DATA} ${WRKSRC}/src/osd/sdl/man/*.6 ${DESTDIR}${PREFIX}/${PKGMANDIR}/man6
+ ${INSTALL_DATA} ${WRKSRC}/artwork/* ${DESTDIR}${PREFIX}/${SHAREDIR}/artwork
+ ${INSTALL_DATA} ${WRKSRC}/docs/*.txt ${DESTDIR}${PREFIX}/${DOCDIR}
+ ${INSTALL_DATA} ${WRKSRC}/hash/* ${DESTDIR}${PREFIX}/${SHAREDIR}/hash
-.include "Makefile.common"
+.include "../../lang/python/application.mk"
+.include "../../audio/flac/buildlink3.mk"
+.include "../../devel/GConf/buildlink3.mk"
+.include "../../devel/SDL2/buildlink3.mk"
+.include "../../devel/zlib/buildlink3.mk"
+.include "../../databases/sqlite3/buildlink3.mk"
+.include "../../fonts/SDL2_ttf/buildlink3.mk"
+.include "../../mk/jpeg.buildlink3.mk"
+.include "../../textproc/expat/buildlink3.mk"
+.include "../../x11/libXinerama/buildlink3.mk"
+.include "../../x11/gtk2/buildlink3.mk"
+.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/mame/Makefile.common b/emulators/mame/Makefile.common
deleted file mode 100644
index 32a01338bb0..00000000000
--- a/emulators/mame/Makefile.common
+++ /dev/null
@@ -1,95 +0,0 @@
-# $NetBSD: Makefile.common,v 1.20 2015/01/29 20:00:29 wiz Exp $
-#
-# used by emulators/mame/Makefile
-# used by emulators/mess/Makefile
-
-CATEGORIES= emulators
-EXTRACT_SUFX= .zip
-
-MAINTAINER= wiz@NetBSD.org
-HOMEPAGE= http://www.mamedev.org/
-LICENSE= mame-license
-
-RESTRICTED= selling is not allowed
-NO_SRC_ON_CDROM= ${RESTRICTED}
-NO_BIN_ON_CDROM= ${RESTRICTED}
-
-BUILD_DEPENDS+= dos2unix-[0-9]*:../../converters/dos2unix
-DEPENDS+= liberation-ttf-[0-9]*:../../fonts/liberation-ttf
-
-WRKSRC= ${WRKDIR}
-
-PATCHDIR= ${.CURDIR}/../../emulators/mame/patches
-DISTINFO_FILE= ${.CURDIR}/../../emulators/mame/distinfo
-
-USE_LANGUAGES= c99 c++
-USE_TOOLS+= gmake pkg-config
-UNLIMIT_RESOURCES+= datasize
-MAKE_FILE= makefile
-# 0.141 has too many conversion warnings
-MAKE_ENV= NOWERROR=1
-# we don't want to pull in qt4
-MAKE_ENV+= NO_USE_QTDEBUG=1
-
-.include "../../mk/compiler.mk"
-.if !empty(PKGSRC_COMPILER:Mclang)
-_WRAP_EXTRA_ARGS.CC+= -Wno-error=cast-align \
- -Wno-error=constant-logical-operand \
- -Wno-error=sometimes-uninitialized \
- -Wno-error=shift-count-overflow \
- -Wno-error=unused-private-field \
- -Wno-error=tautological-constant-out-of-range-compare \
- -Wno-error=tautological-compare \
- -Wno-error=self-assign-field \
- -Wno-error=unused-const-variable \
- -Wno-error=unused-function
-CWRAPPERS_APPEND.cc+= -Wno-error=cast-align \
- -Wno-error=constant-logical-operand \
- -Wno-error=sometimes-uninitialized \
- -Wno-error=shift-count-overflow \
- -Wno-error=unused-private-field \
- -Wno-error=tautological-constant-out-of-range-compare \
- -Wno-error=tautological-compare \
- -Wno-error=self-assign-field \
- -Wno-error=unused-const-variable \
- -Wno-error=unused-function
-MAKE_ENV+= OPTIMIZE=2
-.endif
-
-. include "../../mk/endian.mk"
-.if ${MACHINE_ENDIAN:Mbig}
-MAKE_FLAGS+= BIGENDIAN=true
-.endif
-
-SUBST_CLASSES+= exe
-SUBST_SED.exe= -e 's,$$(PREFIX)$$(PREFIXSDL)$$(NAME)$$(SUFFIX)$$(SUFFIX64)$$(SUFFIXDEBUG)$$(SUFFIXPROFILE),$$(PREFIXSDL)$$(NAME)$$(SUFFIX)$$(SUFFIXDEBUG)$$(SUFFIXPROFILE),'
-SUBST_SED.exe+= -e 's,PYTHON = .python,PYTHON = ${PYTHONBIN},'
-SUBST_FILES.exe= makefile
-SUBST_STAGE.exe= post-patch
-SUBST_MESSAGE.exe= Fixing executable name.
-
-PYTHON_FOR_BUILD_ONLY= yes
-PYTHON_VERSIONS_INCOMPATIBLE= 33 34 # not yet ported as of 0.151
-
-# mame source is double-zipped
-post-extract:
- cd ${WRKDIR} && ${.CURDIR}/../../mk/extract/extract mame.zip
- rm ${WRKDIR}/mame.zip
- # This needs to be done for every file that is patched.
- ${RUN} for f in 3rdparty/mongoose/mongoose.c makefile src/osd/sdl/sdl.mak; do \
- ${CP} ${WRKSRC}/$${f} ${WRKSRC}/$${f}.bak; \
- ${CAT} ${WRKSRC}/$${f}.bak | dos2unix >${WRKSRC}/$${f}; \
- done
-
-.include "../../lang/python/application.mk"
-.include "../../audio/flac/buildlink3.mk"
-.include "../../devel/GConf/buildlink3.mk"
-.include "../../devel/SDL2/buildlink3.mk"
-.include "../../devel/zlib/buildlink3.mk"
-.include "../../databases/sqlite3/buildlink3.mk"
-.include "../../fonts/SDL2_ttf/buildlink3.mk"
-.include "../../graphics/jpeg/buildlink3.mk"
-.include "../../textproc/expat/buildlink3.mk"
-.include "../../x11/libXinerama/buildlink3.mk"
-.include "../../x11/gtk2/buildlink3.mk"
-.include "../../mk/bsd.pkg.mk"
diff --git a/emulators/mame/PLIST b/emulators/mame/PLIST
index 6068a75c357..6b49d622276 100644
--- a/emulators/mame/PLIST
+++ b/emulators/mame/PLIST
@@ -1,16 +1,429 @@
-@comment $NetBSD: PLIST,v 1.2 2012/06/01 19:42:06 wiz Exp $
+@comment $NetBSD: PLIST,v 1.3 2015/07/14 20:14:49 wiz Exp $
+bin/castool
bin/chdman
+bin/floptool
+bin/imgtool
bin/jedutil
bin/ldresample
bin/ldverify
bin/mame
+bin/nltool
+bin/pngcmp
+bin/regrep
bin/romcmp
+bin/split
+bin/src2html
+bin/srcclean
+bin/testkeys
bin/unidasm
+man/man1/castool.1
man/man1/chdman.1
+man/man1/floptool.1
+man/man1/imgtool.1
man/man1/jedutil.1
+man/man1/ldplayer.1
+man/man1/ldresample.1
man/man1/ldverify.1
man/man1/romcmp.1
+man/man1/testkeys.1
man/man6/mame.6
+man/man6/mess.6
+share/doc/mame/SDL.txt
share/doc/mame/config.txt
-share/doc/mame/license.txt
+share/doc/mame/floppy.txt
+share/doc/mame/hlsl.txt
+share/doc/mame/imgtool.txt
+share/doc/mame/m6502.txt
share/doc/mame/mame.txt
+share/doc/mame/mamelicense.txt
+share/doc/mame/newvideo.txt
+share/doc/mame/nscsi.txt
+share/doc/mame/windows.txt
+share/mame/artwork/adapture-grill.png
+share/mame/artwork/shadow-mask.png
+share/mame/artwork/slot-mask.png
+share/mame/artwork/white.png
+share/mame/hash/32x.xml
+share/mame/hash/3do_m2.xml
+share/mame/hash/a2600.xml
+share/mame/hash/a2600_cass.xml
+share/mame/hash/a5200.hsi
+share/mame/hash/a5200.xml
+share/mame/hash/a7800.xml
+share/mame/hash/a800.xml
+share/mame/hash/a800_flop.xml
+share/mame/hash/abc1600.xml
+share/mame/hash/abc800.xml
+share/mame/hash/abc800_hdd.xml
+share/mame/hash/abc806.xml
+share/mame/hash/abc80_cass.xml
+share/mame/hash/abc80_flop.xml
+share/mame/hash/adam_cart.xml
+share/mame/hash/adam_cass.xml
+share/mame/hash/adam_flop.xml
+share/mame/hash/advantage.xml
+share/mame/hash/advision.xml
+share/mame/hash/aim65_cart.xml
+share/mame/hash/aleste.xml
+share/mame/hash/alice32.xml
+share/mame/hash/alice90.xml
+share/mame/hash/alphatro_flop.xml
+share/mame/hash/altos5.xml
+share/mame/hash/amiga_a1000.xml
+share/mame/hash/amiga_a3000.xml
+share/mame/hash/amiga_apps.xml
+share/mame/hash/amiga_flop.xml
+share/mame/hash/amiga_hardware.xml
+share/mame/hash/amiga_workbench.xml
+share/mame/hash/amigaaga_flop.xml
+share/mame/hash/amigaecs_flop.xml
+share/mame/hash/amigaocs_flop.xml
+share/mame/hash/ampro.xml
+share/mame/hash/apc.xml
+share/mame/hash/apfimag_cass.xml
+share/mame/hash/apfm1000.xml
+share/mame/hash/apogee.xml
+share/mame/hash/apollo_ctape.xml
+share/mame/hash/apple1.xml
+share/mame/hash/apple2.xml
+share/mame/hash/apple2gs.xml
+share/mame/hash/apple3.xml
+share/mame/hash/aquarius.xml
+share/mame/hash/arcadia.xml
+share/mame/hash/archimedes.xml
+share/mame/hash/astrocde.xml
+share/mame/hash/atom.xml
+share/mame/hash/attache.xml
+share/mame/hash/b2m.xml
+share/mame/hash/bbca_cass.xml
+share/mame/hash/bbcb_cass.xml
+share/mame/hash/bbcbc.xml
+share/mame/hash/bbcm_cart.xml
+share/mame/hash/bbcm_cass.xml
+share/mame/hash/bk0010.xml
+share/mame/hash/bml3_flop.xml
+share/mame/hash/bw12.xml
+share/mame/hash/bw2.xml
+share/mame/hash/bx256hp_flop.xml
+share/mame/hash/c128_cart.xml
+share/mame/hash/c128_flop.xml
+share/mame/hash/c128_rom.xml
+share/mame/hash/c64_cart.xml
+share/mame/hash/c64_cass.xml
+share/mame/hash/c64_flop.xml
+share/mame/hash/c65_flop.xml
+share/mame/hash/casloopy.xml
+share/mame/hash/cbm2_cart.xml
+share/mame/hash/cbm2_flop.xml
+share/mame/hash/cbm8096_flop.xml
+share/mame/hash/cbm8296_flop.xml
+share/mame/hash/cc40_cart.xml
+share/mame/hash/cd32.xml
+share/mame/hash/cdi.xml
+share/mame/hash/cdtv.xml
+share/mame/hash/cgenie_cart.xml
+share/mame/hash/cgenie_cass.xml
+share/mame/hash/channelf.xml
+share/mame/hash/coco_cart.xml
+share/mame/hash/coco_flop.xml
+share/mame/hash/coleco.xml
+share/mame/hash/compclr2_flop.xml
+share/mame/hash/compis.xml
+share/mame/hash/comx35_flop.xml
+share/mame/hash/copera.xml
+share/mame/hash/cpc_cass.xml
+share/mame/hash/cpc_flop.xml
+share/mame/hash/crvision.xml
+share/mame/hash/cx3000tc.xml
+share/mame/hash/dai_cass.xml
+share/mame/hash/database.xml
+share/mame/hash/dim68k.xml
+share/mame/hash/dmv.xml
+share/mame/hash/dps1.xml
+share/mame/hash/ec1841.xml
+share/mame/hash/einstein.xml
+share/mame/hash/electron_cart.xml
+share/mame/hash/ep64_cart.xml
+share/mame/hash/ep64_cass.xml
+share/mame/hash/ep64_flop.xml
+share/mame/hash/epson_cpm.xml
+share/mame/hash/exl100.xml
+share/mame/hash/famicom_cass.xml
+share/mame/hash/famicom_flop.xml
+share/mame/hash/fm77av.xml
+share/mame/hash/fm7_cass.xml
+share/mame/hash/fm7_disk.xml
+share/mame/hash/fmtowns_cd.xml
+share/mame/hash/g7400.xml
+share/mame/hash/galaxy.xml
+share/mame/hash/gamate.xml
+share/mame/hash/gameboy.xml
+share/mame/hash/gamecom.xml
+share/mame/hash/gamegear.xml
+share/mame/hash/gameking.xml
+share/mame/hash/gamepock.xml
+share/mame/hash/gba.xml
+share/mame/hash/gbcolor.xml
+share/mame/hash/genius.xml
+share/mame/hash/gimix.xml
+share/mame/hash/gjmovie.xml
+share/mame/hash/gl2000.xml
+share/mame/hash/gl6000sl.xml
+share/mame/hash/glcolor.xml
+share/mame/hash/gmaster.xml
+share/mame/hash/gp32.xml
+share/mame/hash/gx4000.xml
+share/mame/hash/horizon.xml
+share/mame/hash/hp9835a_rom.xml
+share/mame/hash/hp9845a_rom.xml
+share/mame/hash/hp9845b_rom.xml
+share/mame/hash/ht68k.xml
+share/mame/hash/i7000_card.xml
+share/mame/hash/ibm5140.xml
+share/mame/hash/ibm5150.xml
+share/mame/hash/ibm5150_cass.xml
+share/mame/hash/ibm5160_flop.xml
+share/mame/hash/ibm5170.xml
+share/mame/hash/ibm5170_cdrom.xml
+share/mame/hash/ibmpcjr_cart.xml
+share/mame/hash/ibmpcjr_flop.xml
+share/mame/hash/interact.xml
+share/mame/hash/intv.hsi
+share/mame/hash/intv.xml
+share/mame/hash/intvecs.xml
+share/mame/hash/iq128.xml
+share/mame/hash/iq151_cart.xml
+share/mame/hash/iq151_flop.xml
+share/mame/hash/jaguar.xml
+share/mame/hash/juicebox.xml
+share/mame/hash/jupace_cass.xml
+share/mame/hash/kayproii.xml
+share/mame/hash/kc_cart.xml
+share/mame/hash/kc_cass.xml
+share/mame/hash/kc_flop.xml
+share/mame/hash/korvet_flop.xml
+share/mame/hash/lantutor.xml
+share/mame/hash/leapster.xml
+share/mame/hash/lisa.xml
+share/mame/hash/lisa2.xml
+share/mame/hash/lviv.xml
+share/mame/hash/lynx.xml
+share/mame/hash/m20.xml
+share/mame/hash/m5_cart.xml
+share/mame/hash/m5_cass.xml
+share/mame/hash/mac_flop.xml
+share/mame/hash/mac_hdd.xml
+share/mame/hash/mbc200.xml
+share/mame/hash/mbc55x.xml
+share/mame/hash/mc10.xml
+share/mame/hash/mc1000_cass.xml
+share/mame/hash/mc1502_flop.xml
+share/mame/hash/megacd.xml
+share/mame/hash/megacdj.xml
+share/mame/hash/megadriv.xml
+share/mame/hash/megaduck.xml
+share/mame/hash/megapc.xml
+share/mame/hash/megatech.xml
+share/mame/hash/microvision.xml
+share/mame/hash/mikro80.xml
+share/mame/hash/mikrosha_cart.xml
+share/mame/hash/mikrosha_cass.xml
+share/mame/hash/misterx.xml
+share/mame/hash/mm1_flop.xml
+share/mame/hash/mo5_cart.xml
+share/mame/hash/mpu1000.xml
+share/mame/hash/mpz80.xml
+share/mame/hash/msx.hsi
+share/mame/hash/msx1_cart.xml
+share/mame/hash/msx1_cass.xml
+share/mame/hash/msx1_flop.xml
+share/mame/hash/msx2.hsi
+share/mame/hash/msx2_cart.xml
+share/mame/hash/msx2_cass.xml
+share/mame/hash/msx2_flop.xml
+share/mame/hash/msx2p_flop.xml
+share/mame/hash/msxr_flop.xml
+share/mame/hash/mtx_cass.xml
+share/mame/hash/myvision.xml
+share/mame/hash/mz2000_cass.xml
+share/mame/hash/mz2000_flop.xml
+share/mame/hash/mz2500.xml
+share/mame/hash/mz700_cass.xml
+share/mame/hash/mz800_cass.xml
+share/mame/hash/n64.xml
+share/mame/hash/n64dd.xml
+share/mame/hash/nascom_flop.xml
+share/mame/hash/nascom_socket.xml
+share/mame/hash/neocd.xml
+share/mame/hash/neogeo.xml
+share/mame/hash/nes.hsi
+share/mame/hash/nes.xml
+share/mame/hash/nes_ade.xml
+share/mame/hash/nes_datach.xml
+share/mame/hash/nes_kstudio.xml
+share/mame/hash/nes_ntbrom.xml
+share/mame/hash/next.xml
+share/mame/hash/ngp.xml
+share/mame/hash/ngpc.xml
+share/mame/hash/nimbus.xml
+share/mame/hash/odyssey2.xml
+share/mame/hash/ondra.xml
+share/mame/hash/orao.xml
+share/mame/hash/orion_cart.xml
+share/mame/hash/orion_cass.xml
+share/mame/hash/orion_flop.xml
+share/mame/hash/orionpro_flop.xml
+share/mame/hash/osborne1.xml
+share/mame/hash/osborne2.xml
+share/mame/hash/p500_flop.xml
+share/mame/hash/partner_cass.xml
+share/mame/hash/partner_flop.xml
+share/mame/hash/pasogo.xml
+share/mame/hash/pb2000c.xml
+share/mame/hash/pc1512.xml
+share/mame/hash/pc1640.xml
+share/mame/hash/pc8201.xml
+share/mame/hash/pc8801_cass.xml
+share/mame/hash/pc8801_flop.xml
+share/mame/hash/pc88va.xml
+share/mame/hash/pc98.xml
+share/mame/hash/pce.xml
+share/mame/hash/pcecd.xml
+share/mame/hash/pcw.xml
+share/mame/hash/pcw16.xml
+share/mame/hash/pecom_cass.xml
+share/mame/hash/pegasus_cart.xml
+share/mame/hash/pencil2.xml
+share/mame/hash/pentagon_cass.xml
+share/mame/hash/pet_cass.xml
+share/mame/hash/pet_flop.xml
+share/mame/hash/pet_hdd.xml
+share/mame/hash/pet_rom.xml
+share/mame/hash/pico.xml
+share/mame/hash/pippin.xml
+share/mame/hash/pippin_flop.xml
+share/mame/hash/plus4_cart.xml
+share/mame/hash/plus4_cass.xml
+share/mame/hash/plus4_flop.xml
+share/mame/hash/pmd85_cass.xml
+share/mame/hash/pokemini.xml
+share/mame/hash/prof180.xml
+share/mame/hash/prof80.xml
+share/mame/hash/psion1.xml
+share/mame/hash/psion2.xml
+share/mame/hash/psx.xml
+share/mame/hash/pt68k2.xml
+share/mame/hash/pv1000.xml
+share/mame/hash/pv2000.xml
+share/mame/hash/px4_cart.xml
+share/mame/hash/pyl601.xml
+share/mame/hash/ql_cart.xml
+share/mame/hash/ql_cass.xml
+share/mame/hash/ql_flop.xml
+share/mame/hash/qx10_flop.xml
+share/mame/hash/radio86_cart.xml
+share/mame/hash/radio86_cass.xml
+share/mame/hash/rainbow.xml
+share/mame/hash/rwtrntcs.xml
+share/mame/hash/rx78.xml
+share/mame/hash/sage2.xml
+share/mame/hash/samcoupe_cass.xml
+share/mame/hash/samcoupe_flop.xml
+share/mame/hash/sat_cart.xml
+share/mame/hash/saturn.xml
+share/mame/hash/sawatte.xml
+share/mame/hash/sc3000_cart.xml
+share/mame/hash/sc3000_cass.xml
+share/mame/hash/scv.xml
+share/mame/hash/segacd.xml
+share/mame/hash/sf7000.xml
+share/mame/hash/sg1000.xml
+share/mame/hash/sgx.xml
+share/mame/hash/smc777.xml
+share/mame/hash/sms.xml
+share/mame/hash/snes.xml
+share/mame/hash/snes_bspack.xml
+share/mame/hash/snes_strom.xml
+share/mame/hash/snes_vkun.xml
+share/mame/hash/snread.xml
+share/mame/hash/snspell.xml
+share/mame/hash/socrates.xml
+share/mame/hash/softbox.xml
+share/mame/hash/softwarelist.dtd
+share/mame/hash/sol20_cass.xml
+share/mame/hash/sorcerer_cart.xml
+share/mame/hash/sorcerer_cass.xml
+share/mame/hash/sorcerer_flop.xml
+share/mame/hash/spc1000_cass.xml
+share/mame/hash/special_cass.xml
+share/mame/hash/special_flop.xml
+share/mame/hash/specpls3_flop.xml
+share/mame/hash/spectrum_cart.xml
+share/mame/hash/spectrum_cass.xml
+share/mame/hash/st_cart.xml
+share/mame/hash/st_flop.xml
+share/mame/hash/studio2.xml
+share/mame/hash/stv.xml
+share/mame/hash/super6.xml
+share/mame/hash/superpet_flop.xml
+share/mame/hash/supracan.xml
+share/mame/hash/sv8000.xml
+share/mame/hash/svi318_cart.xml
+share/mame/hash/svi318_cass.xml
+share/mame/hash/svi318_flop.xml
+share/mame/hash/svision.xml
+share/mame/hash/svmu.xml
+share/mame/hash/tandy200.xml
+share/mame/hash/tandy2k.xml
+share/mame/hash/tandy6k.xml
+share/mame/hash/tdv2324.xml
+share/mame/hash/tek4052_cart.xml
+share/mame/hash/tg16.xml
+share/mame/hash/ti74_cart.xml
+share/mame/hash/ti99_cart.xml
+share/mame/hash/tiki100.xml
+share/mame/hash/timex_dock.xml
+share/mame/hash/to770_cart.xml
+share/mame/hash/to7_cart.xml
+share/mame/hash/trs80m2.xml
+share/mame/hash/trsm100.xml
+share/mame/hash/tutor.xml
+share/mame/hash/tvc_cart.xml
+share/mame/hash/tvc_cass.xml
+share/mame/hash/tvc_flop.xml
+share/mame/hash/ut88.xml
+share/mame/hash/uzebox.xml
+share/mame/hash/v1050_flop.xml
+share/mame/hash/v1050_hdd.xml
+share/mame/hash/vboy.xml
+share/mame/hash/vc4000.xml
+share/mame/hash/vector06_cart.xml
+share/mame/hash/vectrex.xml
+share/mame/hash/vg5k.xml
+share/mame/hash/vic10.xml
+share/mame/hash/vic1001_cart.xml
+share/mame/hash/vic1001_cass.xml
+share/mame/hash/vic1001_flop.xml
+share/mame/hash/victor9k_flop.xml
+share/mame/hash/vidbrain.xml
+share/mame/hash/vii.xml
+share/mame/hash/vip.xml
+share/mame/hash/visicom.xml
+share/mame/hash/vixen.xml
+share/mame/hash/vreader.xml
+share/mame/hash/vsmile_cart.xml
+share/mame/hash/vsmile_cd.xml
+share/mame/hash/vz_cass.xml
+share/mame/hash/wangpc.xml
+share/mame/hash/wicat.xml
+share/mame/hash/wmbullet.xml
+share/mame/hash/wscolor.xml
+share/mame/hash/wswan.xml
+share/mame/hash/x07_card.xml
+share/mame/hash/x07_cass.xml
+share/mame/hash/x1_cass.xml
+share/mame/hash/x1_flop.xml
+share/mame/hash/x68k_flop.xml
+share/mame/hash/xegs.xml
+share/mame/hash/xerox820.xml
+share/mame/hash/xerox820ii.xml
diff --git a/emulators/mame/distinfo b/emulators/mame/distinfo
index c0224da4196..3af741f020b 100644
--- a/emulators/mame/distinfo
+++ b/emulators/mame/distinfo
@@ -1,7 +1,13 @@
-$NetBSD: distinfo,v 1.35 2015/04/21 17:20:39 joerg Exp $
+$NetBSD: distinfo,v 1.36 2015/07/14 20:14:49 wiz Exp $
-SHA1 (mame0160s.zip) = db3d2f10a5c9ef00f629bfd8ab5665874ef581c2
-RMD160 (mame0160s.zip) = 95a0edb499dc81a690ca13040954c87f586ec673
-Size (mame0160s.zip) = 80937878 bytes
-SHA1 (patch-makefile) = 57837dbc8571682e4fd73a2be5771df109c7225f
-SHA1 (patch-src_osd_sdl_osinline.h) = f710a75a51b603905913f2b282c2fc8b92066466
+SHA1 (mame0163s.zip) = 14617c9d8a98d9f4c9709441b73285ad66f9b3c3
+RMD160 (mame0163s.zip) = d115f68b9ab6bd4f869149fb011955e1c1d5bc16
+Size (mame0163s.zip) = 83107428 bytes
+SHA1 (patch-3rdparty_bgfx_src_renderer__null.cpp) = 908f196d68c9b759b26a75331f543ed3ab73970c
+SHA1 (patch-3rdparty_bx_include_bx_os.h) = 31d9e848dafc0f9a7459deac122577e9aebdc230
+SHA1 (patch-3rdparty_bx_include_bx_platform.h) = a971c90f2ed169d35d4c600a0b4266f942f99383
+SHA1 (patch-3rdparty_portmidi_porttime_ptlinux.c) = 3d7ac3eb870764ed8a94712708299e0391941221
+SHA1 (patch-makefile) = 48eeb6f119b0affb4614c9ff6a51933b4f0c08bf
+SHA1 (patch-scripts_src_3rdparty.lua) = db85c6c50bdd456f8e8127b956f32df809b706be
+SHA1 (patch-scripts_toolchain.lua) = 0b6b8708b5102b154a38872d2a3069f4061ca353
+SHA1 (patch-src_osd_osdmini_minifile.c) = d78d2b3badec7caa1c6aa3e8c335ea64f3e0c6c2
diff --git a/emulators/mame/patches/patch-3rdparty_bgfx_src_renderer__null.cpp b/emulators/mame/patches/patch-3rdparty_bgfx_src_renderer__null.cpp
new file mode 100644
index 00000000000..1ff438b389a
--- /dev/null
+++ b/emulators/mame/patches/patch-3rdparty_bgfx_src_renderer__null.cpp
@@ -0,0 +1,43 @@
+$NetBSD: patch-3rdparty_bgfx_src_renderer__null.cpp,v 1.1 2015/07/14 20:14:49 wiz Exp $
+
+Fix build.
+https://github.com/bkaradzic/bgfx/commit/e1a564ca720ae66298b61928e6ef0e9d1ee40d30#diff-d51370988baf340d4de0bc2861591415
+
+--- 3rdparty/bgfx/src/renderer_null.cpp.orig 2015-06-24 09:53:24.000000000 +0000
++++ 3rdparty/bgfx/src/renderer_null.cpp
+@@ -33,7 +33,7 @@ namespace bgfx { namespace noop
+ {
+ }
+
+- void createIndexBuffer(IndexBufferHandle /*_handle*/, Memory* /*_mem*/, uint8_t /*_flags*/) BX_OVERRIDE
++ void createIndexBuffer(IndexBufferHandle /*_handle*/, Memory* /*_mem*/, uint16_t /*_flags*/) BX_OVERRIDE
+ {
+ }
+
+@@ -49,7 +49,7 @@ namespace bgfx { namespace noop
+ {
+ }
+
+- void createVertexBuffer(VertexBufferHandle /*_handle*/, Memory* /*_mem*/, VertexDeclHandle /*_declHandle*/, uint8_t /*_flags*/) BX_OVERRIDE
++ void createVertexBuffer(VertexBufferHandle /*_handle*/, Memory* /*_mem*/, VertexDeclHandle /*_declHandle*/, uint16_t /*_flags*/) BX_OVERRIDE
+ {
+ }
+
+@@ -57,7 +57,7 @@ namespace bgfx { namespace noop
+ {
+ }
+
+- void createDynamicIndexBuffer(IndexBufferHandle /*_handle*/, uint32_t /*_size*/, uint8_t /*_flags*/) BX_OVERRIDE
++ void createDynamicIndexBuffer(IndexBufferHandle /*_handle*/, uint32_t /*_size*/, uint16_t /*_flags*/) BX_OVERRIDE
+ {
+ }
+
+@@ -69,7 +69,7 @@ namespace bgfx { namespace noop
+ {
+ }
+
+- void createDynamicVertexBuffer(VertexBufferHandle /*_handle*/, uint32_t /*_size*/, uint8_t /*_flags*/) BX_OVERRIDE
++ void createDynamicVertexBuffer(VertexBufferHandle /*_handle*/, uint32_t /*_size*/, uint16_t /*_flags*/) BX_OVERRIDE
+ {
+ }
+
diff --git a/emulators/mame/patches/patch-3rdparty_bx_include_bx_os.h b/emulators/mame/patches/patch-3rdparty_bx_include_bx_os.h
new file mode 100644
index 00000000000..98eca702bc3
--- /dev/null
+++ b/emulators/mame/patches/patch-3rdparty_bx_include_bx_os.h
@@ -0,0 +1,29 @@
+$NetBSD: patch-3rdparty_bx_include_bx_os.h,v 1.1 2015/07/14 20:14:49 wiz Exp $
+
+Add NetBSD support.
+
+--- 3rdparty/bx/include/bx/os.h.orig 2015-06-24 09:53:24.000000000 +0000
++++ 3rdparty/bx/include/bx/os.h
+@@ -17,11 +17,12 @@
+ || BX_PLATFORM_IOS \
+ || BX_PLATFORM_LINUX \
+ || BX_PLATFORM_NACL \
++ || BX_PLATFORM_NETBSD \
+ || BX_PLATFORM_OSX \
+ || BX_PLATFORM_RPI
+
+ # include <sched.h> // sched_yield
+-# if BX_PLATFORM_FREEBSD || BX_PLATFORM_IOS || BX_PLATFORM_NACL || BX_PLATFORM_OSX
++# if BX_PLATFORM_FREEBSD || BX_PLATFORM_IOS || BX_PLATFORM_NACL || BX_PLATFORM_NETBSD || BX_PLATFORM_OSX
+ # include <pthread.h> // mach_port_t
+ # endif // BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_NACL
+
+@@ -93,7 +94,7 @@ namespace bx
+ return (pid_t)::syscall(SYS_gettid);
+ #elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
+ return (mach_port_t)::pthread_mach_thread_np(pthread_self() );
+-#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL
++#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL || BX_PLATFORM_NETBSD
+ // Casting __nc_basic_thread_data*... need better way to do this.
+ return *(uint32_t*)::pthread_self();
+ #else
diff --git a/emulators/mame/patches/patch-3rdparty_bx_include_bx_platform.h b/emulators/mame/patches/patch-3rdparty_bx_include_bx_platform.h
new file mode 100644
index 00000000000..8036913cab3
--- /dev/null
+++ b/emulators/mame/patches/patch-3rdparty_bx_include_bx_platform.h
@@ -0,0 +1,41 @@
+$NetBSD: patch-3rdparty_bx_include_bx_platform.h,v 1.1 2015/07/14 20:14:49 wiz Exp $
+
+Add NetBSD support.
+
+--- 3rdparty/bx/include/bx/platform.h.orig 2015-06-24 09:53:24.000000000 +0000
++++ 3rdparty/bx/include/bx/platform.h
+@@ -18,6 +18,7 @@
+ #define BX_PLATFORM_IOS 0
+ #define BX_PLATFORM_LINUX 0
+ #define BX_PLATFORM_NACL 0
++#define BX_PLATFORM_NETBSD 0
+ #define BX_PLATFORM_OSX 0
+ #define BX_PLATFORM_PS4 0
+ #define BX_PLATFORM_QNX 0
+@@ -187,6 +188,9 @@
+ #elif defined(__FreeBSD__)
+ # undef BX_PLATFORM_FREEBSD
+ # define BX_PLATFORM_FREEBSD 1
++#elif defined(__NetBSD__)
++# undef BX_PLATFORM_NETBSD
++# define BX_PLATFORM_NETBSD 1
+ #else
+ # error "BX_PLATFORM_* is not defined!"
+ #endif //
+@@ -198,6 +202,7 @@
+ || BX_PLATFORM_IOS \
+ || BX_PLATFORM_LINUX \
+ || BX_PLATFORM_NACL \
++ || BX_PLATFORM_NETBSD \
+ || BX_PLATFORM_OSX \
+ || BX_PLATFORM_QNX \
+ || BX_PLATFORM_RPI \
+@@ -250,6 +255,8 @@
+ #elif BX_PLATFORM_NACL
+ # define BX_PLATFORM_NAME "NaCl " \
+ BX_STRINGIZE(BX_PLATFORM_NACL)
++#elif BX_PLATFORM_NETBSD
++# define BX_PLATFORM_NAME "NetBSD"
+ #elif BX_PLATFORM_OSX
+ # define BX_PLATFORM_NAME "OSX"
+ #elif BX_PLATFORM_PS4
diff --git a/emulators/mame/patches/patch-3rdparty_portmidi_porttime_ptlinux.c b/emulators/mame/patches/patch-3rdparty_portmidi_porttime_ptlinux.c
new file mode 100644
index 00000000000..7027f6952b1
--- /dev/null
+++ b/emulators/mame/patches/patch-3rdparty_portmidi_porttime_ptlinux.c
@@ -0,0 +1,39 @@
+$NetBSD: patch-3rdparty_portmidi_porttime_ptlinux.c,v 1.1 2015/07/14 20:14:49 wiz Exp $
+
+ftime() is obsolete.
+
+--- 3rdparty/portmidi/porttime/ptlinux.c.orig 2015-06-24 09:53:30.000000000 +0000
++++ 3rdparty/portmidi/porttime/ptlinux.c
+@@ -38,7 +38,7 @@ CHANGE LOG
+ #define FALSE 0
+
+ static int time_started_flag = FALSE;
+-static struct timeb time_offset = {0, 0, 0, 0};
++static struct timeval time_offset = {0, 0};
+ static pthread_t pt_thread_pid;
+ static int pt_thread_created = FALSE;
+
+@@ -79,7 +79,7 @@ static void *Pt_CallbackProc(void *p)
+ PtError Pt_Start(int resolution, PtCallback *callback, void *userData)
+ {
+ if (time_started_flag) return ptNoError;
+- ftime(&time_offset); /* need this set before process runs */
++ gettimeofday(&time_offset, NULL); /* need this set before process runs */
+ if (callback) {
+ int res;
+ pt_callback_parameters *parms = (pt_callback_parameters *)
+@@ -121,10 +121,10 @@ int Pt_Started()
+ PtTimestamp Pt_Time()
+ {
+ long seconds, milliseconds;
+- struct timeb now;
+- ftime(&now);
+- seconds = now.time - time_offset.time;
+- milliseconds = now.millitm - time_offset.millitm;
++ struct timeval now;
++ gettimeofday(&now, NULL);
++ seconds = now.tv_sec - time_offset.tv_sec;
++ milliseconds = now.tv_usec - time_offset.tv_usec;
+ return seconds * 1000 + milliseconds;
+ }
+
diff --git a/emulators/mame/patches/patch-makefile b/emulators/mame/patches/patch-makefile
index d560095ca56..fc6c37bbe8a 100644
--- a/emulators/mame/patches/patch-makefile
+++ b/emulators/mame/patches/patch-makefile
@@ -1,50 +1,44 @@
-$NetBSD: patch-makefile,v 1.11 2015/03/31 16:35:29 joerg Exp $
+$NetBSD: patch-makefile,v 1.12 2015/07/14 20:14:49 wiz Exp $
-Link against pkgsrc versions of expat, zlib, flac, jpeg, and
-sqlite3, and add appropriate linker search paths.
+Add NetBSD support.
---- makefile.orig 2015-02-28 10:39:06.000000000 +0000
+--- makefile.orig 2015-07-14 19:04:56.000000000 +0000
+++ makefile
-@@ -227,19 +227,19 @@ endif
- # BIGENDIAN = 1
+@@ -295,6 +295,10 @@ ifeq ($(TARGETOS),freebsd)
+ OSD := sdl
+ endif
- # uncomment next line to build expat as part of MAME build
--BUILD_EXPAT = 1
-+#BUILD_EXPAT = 1
++ifeq ($(TARGETOS),netbsd)
++OSD := sdl
++endif
++
+ ifeq ($(TARGETOS),solaris)
+ OSD := sdl
+ endif
+@@ -1000,6 +1004,26 @@ freebsd_x86: generate $(PROJECTDIR)/gmak
- # uncomment next line to build zlib as part of MAME build
--BUILD_ZLIB = 1
-+#BUILD_ZLIB = 1
- # uncomment next line to build libflac as part of MAME build
--BUILD_FLAC = 1
-+#BUILD_FLAC = 1
-
- # uncomment next line to build jpeglib as part of MAME build
--BUILD_JPEGLIB = 1
-+#BUILD_JPEGLIB = 1
-
- # uncomment next line to build libsqlite3 as part of MAME/MESS build
--BUILD_SQLITE3 = 1
-+#BUILD_SQLITE3 = 1
-
- # uncomment next line to build PortMidi as part of MAME/MESS build
- BUILD_MIDILIB = 1
-@@ -527,7 +527,7 @@ CFLAGS = $(CCOMFLAGS) $(CPPONLYFLAGS) $(
-
- # we compile C-only to C89 standard with GNU extensions
- # we compile C++ code to C++98 standard with GNU extensions
--CONLYFLAGS += -std=gnu89
-+CONLYFLAGS += -std=gnu99
- ifdef CPP11
- CPPONLYFLAGS += -x c++ -std=gnu++11
- else
-@@ -742,7 +742,7 @@ DRIVLISTOBJ = $(OBJ)/$(TARGET)/$(SUBTARG
+ #-------------------------------------------------
++# gmake-netbsd
++#-------------------------------------------------
++
++
++$(PROJECTDIR)/gmake-netbsd/Makefile: makefile $(SCRIPTS) $(GENIE)
++ $(SILENT) $(GENIE) $(PARAMS) --gcc=netbsd --gcc_version=$(GCC_VERSION) gmake
++
++.PHONY: netbsd_x64
++netbsd_x64: generate $(PROJECTDIR)/gmake-netbsd/Makefile
++ $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-netbsd config=$(CONFIG)64
++
++.PHONY: netbsd
++netbsd: netbsd_x86
++
++.PHONY: netbsd_x86
++netbsd_x86: generate $(PROJECTDIR)/gmake-netbsd/Makefile
++ $(SILENT) $(MAKE) -C $(PROJECTDIR)/gmake-netbsd config=$(CONFIG)32
++
++
++#-------------------------------------------------
+ # Clean/bootstrap
#-------------------------------------------------
- # start with an empty set of libs
--LIBS =
-+LIBS = -Wl,-R${PREFIX}/lib -L${PREFIX}/lib
-
- # add expat XML library
- ifeq ($(BUILD_EXPAT),1)
diff --git a/emulators/mame/patches/patch-scripts_src_3rdparty.lua b/emulators/mame/patches/patch-scripts_src_3rdparty.lua
new file mode 100644
index 00000000000..d17b37c8c3f
--- /dev/null
+++ b/emulators/mame/patches/patch-scripts_src_3rdparty.lua
@@ -0,0 +1,32 @@
+$NetBSD: patch-scripts_src_3rdparty.lua,v 1.1 2015/07/14 20:14:49 wiz Exp $
+
+Add NetBSD "support" for portmidi.
+
+--- scripts/src/3rdparty.lua.orig 2015-06-24 09:53:30.000000000 +0000
++++ scripts/src/3rdparty.lua
+@@ -534,6 +534,13 @@ project "portmidi"
+ MAME_DIR .. "3rdparty/portmidi/porttime/ptlinux.c",
+ }
+ end
++ if _OPTIONS["targetos"]=="netbsd" then
++ files {
++ MAME_DIR .. "3rdparty/portmidi/pm_linux/pmlinux.c",
++ MAME_DIR .. "3rdparty/portmidi/pm_linux/finddefault.c",
++ MAME_DIR .. "3rdparty/portmidi/porttime/ptlinux.c",
++ }
++ end
+ if _OPTIONS["targetos"]=="macosx" then
+ files {
+ MAME_DIR .. "3rdparty/portmidi/pm_mac/pmmac.c",
+@@ -591,6 +598,11 @@ project "bgfx"
+ MAME_DIR .. "3rdparty/bx/include/compat/freebsd",
+ }
+
++ configuration { "netbsd" }
++ includedirs {
++ MAME_DIR .. "3rdparty/bx/include/compat/freebsd",
++ }
++
+ configuration { "gmake" }
+ buildoptions {
+ "-Wno-uninitialized",
diff --git a/emulators/mame/patches/patch-scripts_toolchain.lua b/emulators/mame/patches/patch-scripts_toolchain.lua
new file mode 100644
index 00000000000..03ad8486577
--- /dev/null
+++ b/emulators/mame/patches/patch-scripts_toolchain.lua
@@ -0,0 +1,56 @@
+$NetBSD: patch-scripts_toolchain.lua,v 1.1 2015/07/14 20:14:49 wiz Exp $
+
+Add NetBSD support.
+
+--- scripts/toolchain.lua.orig 2015-06-24 09:53:32.000000000 +0000
++++ scripts/toolchain.lua
+@@ -24,6 +24,7 @@ newoption {
+ { "mingw-clang", "MinGW (clang compiler)" },
+ { "nacl", "Native Client" },
+ { "nacl-arm", "Native Client - ARM" },
++ { "netbsd", "NetBSD" },
+ { "osx", "OSX (GCC compiler)" },
+ { "osx-clang", "OSX (Clang compiler)" },
+ { "pnacl", "Native Client - PNaCl" },
+@@ -147,6 +148,10 @@ function toolchain(_buildDir, _subDir)
+ location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-freebsd")
+ end
+
++ if "netbsd" == _OPTIONS["gcc"] then
++ location (_buildDir .. "projects/" .. _subDir .. "/".. _ACTION .. "-netbsd")
++ end
++
+ if "ios-arm" == _OPTIONS["gcc"] then
+ premake.gcc.cc = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang"
+ premake.gcc.cxx = "/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++"
+@@ -590,7 +595,30 @@ function toolchain(_buildDir, _subDir)
+
+ configuration { "freebsd", "x64", "Debug" }
+ targetdir (_buildDir .. "freebsd" .. "/bin/x64/Debug")
++
++ configuration { "netbsd", "x32" }
++ objdir (_buildDir .. "netbsd" .. "/obj")
++ buildoptions {
++ "-m32",
++ }
+
++ configuration { "netbsd", "x32", "Release" }
++ targetdir (_buildDir .. "netbsd" .. "/bin/x32/Release")
++
++ configuration { "netbsd", "x32", "Debug" }
++ targetdir (_buildDir .. "netbsd" .. "/bin/x32/Debug")
++
++ configuration { "netbsd", "x64" }
++ objdir (_buildDir .. "netbsd" .. "/obj")
++ buildoptions {
++ "-m64",
++ }
++ configuration { "netbsd", "x64", "Release" }
++ targetdir (_buildDir .. "netbsd" .. "/bin/x64/Release")
++
++ configuration { "netbsd", "x64", "Debug" }
++ targetdir (_buildDir .. "netbsd" .. "/bin/x64/Debug")
++
+ configuration { "android-*" }
+ includedirs {
+ "$(ANDROID_NDK_ROOT)/sources/cxx-stl/gnu-libstdc++/4.8/include",
diff --git a/emulators/mame/patches/patch-src_osd_osdmini_minifile.c b/emulators/mame/patches/patch-src_osd_osdmini_minifile.c
new file mode 100644
index 00000000000..be5fed2ba4c
--- /dev/null
+++ b/emulators/mame/patches/patch-src_osd_osdmini_minifile.c
@@ -0,0 +1,32 @@
+$NetBSD: patch-src_osd_osdmini_minifile.c,v 1.1 2015/07/14 20:14:49 wiz Exp $
+
+Implement missing osd_truncate() function.
+
+--- src/osd/osdmini/minifile.c.orig 2015-06-24 09:53:46.000000000 +0000
++++ src/osd/osdmini/minifile.c
+@@ -102,6 +102,25 @@ file_error osd_write(osd_file *file, con
+
+
+ //============================================================
++// osd_truncate
++//============================================================
++
++file_error osd_truncate(osd_file *file, UINT64 offset)
++{
++ UINT32 result;
++
++ if (!file)
++ return FILERR_FAILURE;
++
++ result = ftruncate(fileno((FILE *)file), offset);
++ if (!result)
++ return FILERR_FAILURE;
++
++ return FILERR_NONE;
++}
++
++
++//============================================================
+ // osd_rmfile
+ //============================================================
+
diff --git a/emulators/mame/patches/patch-src_osd_sdl_osinline.h b/emulators/mame/patches/patch-src_osd_sdl_osinline.h
deleted file mode 100644
index 6d5ee6c485c..00000000000
--- a/emulators/mame/patches/patch-src_osd_sdl_osinline.h
+++ /dev/null
@@ -1,34 +0,0 @@
-$NetBSD: patch-src_osd_sdl_osinline.h,v 1.1 2015/04/21 17:20:39 joerg Exp $
-
---- src/osd/sdl/osinline.h.orig 2015-04-17 15:09:28.000000000 +0000
-+++ src/osd/sdl/osinline.h
-@@ -83,6 +83,29 @@ _osd_exchange64(INT64 volatile *ptr, INT
-
- #endif /* __ppc64__ || __PPC64__ */
-
-+#elif defined(__arm__)
-+INLINE void ATTR_FORCE_INLINE
-+osd_yield_processor(void)
-+{
-+}
-+
-+INLINE INT32 ATTR_UNUSED ATTR_NONNULL(1) ATTR_FORCE_INLINE
-+_osd_exchange32(INT32 volatile *ptr, INT32 exchange)
-+{
-+ INT32 before;
-+ do {
-+ before = *ptr;
-+ } while (!__sync_bool_compare_and_swap(ptr, before, exchange));
-+ return before;
-+}
-+
-+INLINE int ATTR_UNUSED ATTR_NONNULL(1) ATTR_FORCE_INLINE
-+_osd_compare_exchange32(INT32 volatile *ptr, INT32 before, INT32 after)
-+{
-+ return __sync_bool_compare_and_swap(ptr, before, after);
-+}
-+#define osd_exchange32 _osd_exchange32
-+#define osd_compare_exchange32 _osd_compare_exchange32
- #else
-
- #error "no matching assembler implementations found - please compile with NOASM=1"