changeset 850:9363ef0e4e47

emulation/libretro-bluemsx: initial import, closes #2130
author David Demelier <markand@malikania.fr>
date Sat, 24 Aug 2019 13:21:28 +0200
parents 3e6fa5e56c05
children 6b456401876c
files emulation/libretro-bluemsx/libretro-bluemsx.sh emulation/libretro-bluemsx/libretro-bluemsx.sha1 emulation/libretro-bluemsx/patch-clang.patch
diffstat 3 files changed, 79 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emulation/libretro-bluemsx/libretro-bluemsx.sh	Sat Aug 24 13:21:28 2019 +0200
@@ -0,0 +1,55 @@
+#!/bin/sh
+#
+# Copyright (c) 2019 David Demelier <markand@malikania.fr>
+#
+# Permission to use, copy, modify, and/or distribute this software for any
+# purpose with or without fee is hereby granted, provided that the above
+# copyright notice and this permission notice appear in all copies.
+#
+# THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+# WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+# ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
+# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+#
+
+_COMMIT=f7795d8936fdbca682a30cd87a86a51e9fb94033
+_SCOMMIT=$(echo $_COMMIT | awk '{ print substr($1, 0, 7) }')
+
+PKGNAME=libretro-bluemsx
+PKGVERSION=$_SCOMMIT
+PKGREVISION=1
+PKGLICENSE="GPLv20"
+PKGSUMMARY="libretro implementation for bluemsx (Microsoft MSX)"
+PKGDOWNLOAD="https://github.com/libretro/blueMSX-libretro/archive/$_COMMIT.tar.gz
+             https://raw.github.com/libretro/libretro-super/master/dist/info/bluemsx_libretro.info"
+
+: ${CC:=clang}
+: ${CFLAGS:=-O2}
+: ${CXX:=clang++}
+: ${CXXFLAGS:=-O2}
+
+build()
+{
+	rm -rf blueMSX-libretro-$_COMMIT
+	tar xvf $_COMMIT.tar.gz
+	cd blueMSX-libretro-$_COMMIT
+
+	sed -i -e '617iCFLAGS+= $(EXTRA_CFLAGS)' Makefile.libretro
+	sed -i -e '617iCXXFLAGS+= $(EXTRA_CXXFLAGS)' Makefile.libretro
+
+	patch -p0 < ../patch-clang.patch
+	make -f Makefile.libretro \
+		GIT_VERSION="$_SCOMMIT" \
+		CC="$CC" \
+		CXX="$CXX" \
+		EXTRA_CFLAGS="$CFLAGS" \
+		EXTRA_CXXFLAGS="$CXXFLAGS"
+	install -Dm0644 ../bluemsx_libretro.info $DESTDIR/share/libretro/info/bluemsx_libretro.info
+	install -Dm0644 bluemsx_libretro.so $DESTDIR/lib/libretro/bluemsx_libretro.so
+
+	cd ..
+	rm -rf blueMSX-libretro-$_COMMIT
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emulation/libretro-bluemsx/libretro-bluemsx.sha1	Sat Aug 24 13:21:28 2019 +0200
@@ -0,0 +1,2 @@
+7fc9f64459c2561d8b84cff72ccfbd429535e7ee  bluemsx_libretro.info
+8a63c0af69082adc7d7d4fb6a22553096e4a3075  f7795d8936fdbca682a30cd87a86a51e9fb94033.tar.gz
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/emulation/libretro-bluemsx/patch-clang.patch	Sat Aug 24 13:21:28 2019 +0200
@@ -0,0 +1,22 @@
+--- ./Src/SoundChips/OpenMsxYMF278.cpp.orig	2019-08-24 11:13:09.319169389 +0000
++++ ./Src/SoundChips/OpenMsxYMF278.cpp	2019-08-24 11:14:16.531171453 +0000
+@@ -143,7 +143,7 @@
+ #undef O
+ 
+ 
+-#define SC(db) (unsigned int) (db * (2.0 / ENV_STEP))
++#define SC(db) static_cast<int>(db * (2.0 / ENV_STEP))
+ const int am_depth[8] = {
+ 	SC(0),	   SC(1.781), SC(2.906), SC(3.656),
+ 	SC(4.406), SC(5.906), SC(7.406), SC(11.91)
+--- ./Src/SoundChips/OpenMsxYM2413_2.cpp.orig	2019-08-24 11:10:11.007163911 +0000
++++ ./Src/SoundChips/OpenMsxYM2413_2.cpp	2019-08-24 11:12:25.523168043 +0000
+@@ -781,7 +781,7 @@
+ // EG
+ void OpenYM2413_2::Slot::calc_envelope(int lfo_am)
+ {
+-	#define S2E(x) (SL2EG((int)(x / SL_STEP)) << (EG_DP_BITS - EG_BITS)) 
++	#define S2E(x) static_cast<unsigned int>(SL2EG((int)(x / SL_STEP)) << (EG_DP_BITS - EG_BITS)) 
+ 	static unsigned int SL[16] = {
+ 		S2E( 0.0), S2E( 3.0), S2E( 6.0), S2E( 9.0),
+ 		S2E(12.0), S2E(15.0), S2E(18.0), S2E(21.0),