From 52a4a206e8bb5f6803c09c0abde1b5005c953278 Mon Sep 17 00:00:00 2001 From: Romain Forlot Date: Tue, 2 Jan 2018 08:55:45 +0000 Subject: [PATCH] First recipes Change-Id: I479fee683bb01320ffe1b6f5cc7137b70b77566f Signed-off-by: Romain Forlot --- COPYING.MIT | 17 + README | 47 ++ TODO | 8 + conf/distro/poky-emulators.conf | 14 + conf/layer.conf | 14 + .../guichan/guichan/configure_sdl.patch | 13 + .../fixes-crash-no-focushandler-set.patch | 81 +++ recipes-graphics/guichan/guichan_0.8.2.bb | 20 + recipes-graphics/libsdl-gfx/libsdl-gfx/pkg.m4 | 199 +++++++ .../libsdl-gfx/libsdl-gfx_2.0.25.bb | 25 + ...fixes-from-pssc-https-github.com-ras.patch | 266 +++++++++ ...upport-to-sdl-enabled-by-changing-en.patch | 529 ++++++++++++++++++ .../libsdl/rpi/0003-added-missing-n.patch | 25 + ...once-SetVideoMode-can-be-called-mult.patch | 65 +++ .../rpi/0005-should-be-0-not-NULL.patch | 25 + .../libsdl/libsdl_1.2.15.bbappend | 15 + .../0001-Fix-compiler_test_at_configure.patch | 77 +++ ...-initializer_element_is_not_constant.patch | 59 ++ recipes-retroarch/retroarch/retroarch_git.bb | 27 + .../snes9x2010/snes9x2010_1.53.bb | 26 + .../images/core-image-emulators-base.bb | 10 + .../images/core-image-emulators-full.bb | 14 + .../images/core-image-graphics-tests.bb | 12 + .../libsdl-tests-1.2.15/configure_fix.patch | 23 + .../libsdl-tests/libsdl-tests_1.2.15.bb | 45 ++ 25 files changed, 1656 insertions(+) create mode 100644 COPYING.MIT create mode 100644 README create mode 100644 TODO create mode 100644 conf/distro/poky-emulators.conf create mode 100644 conf/layer.conf create mode 100644 recipes-graphics/guichan/guichan/configure_sdl.patch create mode 100644 recipes-graphics/guichan/guichan/fixes-crash-no-focushandler-set.patch create mode 100644 recipes-graphics/guichan/guichan_0.8.2.bb create mode 100644 recipes-graphics/libsdl-gfx/libsdl-gfx/pkg.m4 create mode 100644 recipes-graphics/libsdl-gfx/libsdl-gfx_2.0.25.bb create mode 100644 recipes-graphics/libsdl/libsdl/rpi/0001-rpi-framebuffer-fixes-from-pssc-https-github.com-ras.patch create mode 100644 recipes-graphics/libsdl/libsdl/rpi/0002-added-dispmanx-support-to-sdl-enabled-by-changing-en.patch create mode 100644 recipes-graphics/libsdl/libsdl/rpi/0003-added-missing-n.patch create mode 100644 recipes-graphics/libsdl/libsdl/rpi/0004-only-initialise-once-SetVideoMode-can-be-called-mult.patch create mode 100644 recipes-graphics/libsdl/libsdl/rpi/0005-should-be-0-not-NULL.patch create mode 100644 recipes-graphics/libsdl/libsdl_1.2.15.bbappend create mode 100644 recipes-retroarch/retroarch/retroarch/0001-Fix-compiler_test_at_configure.patch create mode 100644 recipes-retroarch/retroarch/retroarch/0001-Fix-initializer_element_is_not_constant.patch create mode 100644 recipes-retroarch/retroarch/retroarch_git.bb create mode 100644 recipes-retroarch/snes9x2010/snes9x2010_1.53.bb create mode 100644 recipes-tests/images/core-image-emulators-base.bb create mode 100644 recipes-tests/images/core-image-emulators-full.bb create mode 100644 recipes-tests/images/core-image-graphics-tests.bb create mode 100644 recipes-tests/libsdl-tests/libsdl-tests-1.2.15/configure_fix.patch create mode 100644 recipes-tests/libsdl-tests/libsdl-tests_1.2.15.bb diff --git a/COPYING.MIT b/COPYING.MIT new file mode 100644 index 0000000..89de354 --- /dev/null +++ b/COPYING.MIT @@ -0,0 +1,17 @@ +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. diff --git a/README b/README new file mode 100644 index 0000000..57421df --- /dev/null +++ b/README @@ -0,0 +1,47 @@ +OpenEmbedded/Yocto software layer for video game system emulators +============================================================ + +This layer provides video game system emulators recipes for +use with OpenEmbedded and/or Yocto. + + +Dependencies +============ + +This layer depends on: + + URI: git://git.openembedded.org/openembedded-core + layers: meta + branch: master + + URI: git://git.openembedded.org/meta-openembedded + layers: meta-oe + branch: master + + +Patches +======= + +Please submit any patches against the meta-game-emulators layer +to the maintainer. + +Maintainer: Romain Forlot + + +Adding the meta-game-emulators layer to your build +================================================= + +In order to use this layer, you need to make the build system aware of +it. + +Assuming the meta-game-emulators layer exists at the top-level of your +yocto build tree, you can add it to the build system by adding the +location of the meta-game-emulators layer to bblayers.conf, along with any +other layers needed. e.g.: + + BBLAYERS ?= " \ + /path/to/yocto/meta \ + /path/to/yocto/meta-yocto \ + /path/to/yocto/meta-yocto-bsp \ + /path/to/yocto/meta-libretro \ + " diff --git a/TODO b/TODO new file mode 100644 index 0000000..7d75313 --- /dev/null +++ b/TODO @@ -0,0 +1,8 @@ +If you want to colaborate, create a recipe to compile a new libretro core e +mulator. + +A good list of emulators is available here: +https://github.com/libretro/ + +Please let me know if you are working on a recipe for a new emulator, +sending an e-mail to claneys.skyne@gmail.com diff --git a/conf/distro/poky-emulators.conf b/conf/distro/poky-emulators.conf new file mode 100644 index 0000000..21a0fa1 --- /dev/null +++ b/conf/distro/poky-emulators.conf @@ -0,0 +1,14 @@ +# Distribution definition for: poky-emulators +# +# Copyright (c) 2014, Embedded Labworks. +# All rights reserved. +# +# This file is released under the MIT license as described in +# COPYING.MIT. +# + +require conf/distro/poky.conf + +DISTRO = "poky-emulators" + +DISTRO_FEATURES_append = " directfb opengl x11 alsa" diff --git a/conf/layer.conf b/conf/layer.conf new file mode 100644 index 0000000..4039254 --- /dev/null +++ b/conf/layer.conf @@ -0,0 +1,14 @@ +# We have a conf and classes directory, add to BBPATH +BBPATH .= ":${LAYERDIR}" + +# We have recipes-* directories, add to BBFILES +BBFILES += "${LAYERDIR}/recipes-*/*/*.bb \ + ${LAYERDIR}/recipes-*/*/*.bbappend" + +BBFILE_COLLECTIONS += "meta-libretro" +BBFILE_PATTERN_meta-libretro = "^${LAYERDIR}/" +BBFILE_PRIORITY_meta-libretro = "6" + +LAYERVERSION_meta-libretro = "1" +LAYERDEPENDS_meta-libretro = "core openembedded-layer" + diff --git a/recipes-graphics/guichan/guichan/configure_sdl.patch b/recipes-graphics/guichan/guichan/configure_sdl.patch new file mode 100644 index 0000000..430317b --- /dev/null +++ b/recipes-graphics/guichan/guichan/configure_sdl.patch @@ -0,0 +1,13 @@ +diff --git a/configure.in b/configure.in +index b901d8c33b1d..71ed4e40b352 100644 +--- a/configure.in ++++ b/configure.in +@@ -115,7 +115,7 @@ HaveSDLImage() + { + SDLIMAGE="yes" + SDL_LIBS="$SDL_LIBS -lSDL_image" +- CPPFLAGS="$CPPFLAGS `sdl-config --cflags`" ++ CPPFLAGS="$CPPFLAGS `pkg-config sdl --cflags`" + } + + ForceSDLImage() diff --git a/recipes-graphics/guichan/guichan/fixes-crash-no-focushandler-set.patch b/recipes-graphics/guichan/guichan/fixes-crash-no-focushandler-set.patch new file mode 100644 index 0000000..ae501e1 --- /dev/null +++ b/recipes-graphics/guichan/guichan/fixes-crash-no-focushandler-set.patch @@ -0,0 +1,81 @@ +From 1a727941539e7ed4376dc8194cb4988961c86340 Mon Sep 17 00:00:00 2001 +From: Arnaud Loonstra +Date: Sun, 18 Jan 2015 14:55:36 +0100 +Subject: [PATCH 1/1] fixes for causing a crash with uae4all: No focushandler + set (did you add the widget to the gui?). see reference: + http://www.raspberrypi.org/forums/viewtopic.php?p=653405#p653405 + +--- + src/widget.cpp | 12 +++++++----- + src/widgets/tabbedarea.cpp | 4 ++++ + 2 files changed, 11 insertions(+), 5 deletions(-) + +diff --git a/src/widget.cpp b/src/widget.cpp +index 7dfc7e10d5b1..97978a7ace1e 100644 +--- a/src/widget.cpp ++++ b/src/widget.cpp +@@ -269,7 +269,7 @@ namespace gcn + { + if (mFocusHandler == NULL) + { +- throw GCN_EXCEPTION("No focushandler set (did you add the widget to the gui?)."); ++ throw GCN_EXCEPTION("No focushandler set (requestFocus: did you add the widget to the gui?)."); + } + + if (isFocusable()) +@@ -558,7 +558,7 @@ namespace gcn + { + if (mFocusHandler == NULL) + { +- throw GCN_EXCEPTION("No focushandler set (did you add the widget to the gui?)."); ++ throw GCN_EXCEPTION("No focushandler set (requestModalFocus: did you add the widget to the gui?)."); + } + + mFocusHandler->requestModalFocus(this); +@@ -568,7 +568,7 @@ namespace gcn + { + if (mFocusHandler == NULL) + { +- throw GCN_EXCEPTION("No focushandler set (did you add the widget to the gui?)."); ++ throw GCN_EXCEPTION("No focushandler set (requestModalMouseInputFocus: did you add the widget to the gui?)."); + } + + mFocusHandler->requestModalMouseInputFocus(this); +@@ -598,7 +598,8 @@ namespace gcn + { + if (mFocusHandler == NULL) + { +- throw GCN_EXCEPTION("No focushandler set (did you add the widget to the gui?)."); ++ return false; ++ //throw GCN_EXCEPTION("No focushandler set (isModalFocused: did you add the widget to the gui?)."); + } + + if (getParent() != NULL) +@@ -614,7 +615,8 @@ namespace gcn + { + if (mFocusHandler == NULL) + { +- throw GCN_EXCEPTION("No focushandler set (did you add the widget to the gui?)."); ++ return false; ++ //throw GCN_EXCEPTION("No focushandler set (isModalMouseInputFocused: did you add the widget to the gui?)."); + } + + if (getParent() != NULL) +diff --git a/src/widgets/tabbedarea.cpp b/src/widgets/tabbedarea.cpp +index e07d14c4d718..5ed9d39ba41c 100644 +--- a/src/widgets/tabbedarea.cpp ++++ b/src/widgets/tabbedarea.cpp +@@ -317,6 +317,10 @@ namespace gcn + + void TabbedArea::logic() + { ++ for (unsigned int i = 0; i < mTabs.size(); i++) ++ { ++ mTabs[i].second->logic(); ++ } + } + + void TabbedArea::adjustSize() +-- +1.9.1 + diff --git a/recipes-graphics/guichan/guichan_0.8.2.bb b/recipes-graphics/guichan/guichan_0.8.2.bb new file mode 100644 index 0000000..25fdd5d --- /dev/null +++ b/recipes-graphics/guichan/guichan_0.8.2.bb @@ -0,0 +1,20 @@ +SUMMARY = "Guichan is a C++ GUI library designed for games." +HOMEPAGE = "http://guichan.sourceforge.net" +SECTION = "libs" + +LICENSE = "BSD-3-Clause" +LIC_FILES_CHKSUM = "file://COPYING;md5=42944e670bc8ebf3eed9929739cc39db" + +SRC_URI = "git://gitorious.org/guichan/mainline.git;protocol=https \ + file://configure_sdl.patch \ + file://fixes-crash-no-focushandler-set.patch" + +SRCREV = "fc9e3a0f76fbab229af457f0f113159425c27fcf" + +S = "${WORKDIR}/git" + +DEPENDS = "libsdl libsdl-gfx" + +EXTRA_OECONF += "--enable-force-sdl" + +inherit autotools pkgconfig diff --git a/recipes-graphics/libsdl-gfx/libsdl-gfx/pkg.m4 b/recipes-graphics/libsdl-gfx/libsdl-gfx/pkg.m4 new file mode 100644 index 0000000..f26f84c --- /dev/null +++ b/recipes-graphics/libsdl-gfx/libsdl-gfx/pkg.m4 @@ -0,0 +1,199 @@ +# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- +# serial 1 (pkg-config-0.24) +# +# Copyright © 2004 Scott James Remnant . +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# +# As a special exception to the GNU General Public License, if you +# distribute this file as part of a program that contains a +# configuration script generated by Autoconf, you may include it under +# the same distribution terms that you use for the rest of that program. + +# PKG_PROG_PKG_CONFIG([MIN-VERSION]) +# ---------------------------------- +AC_DEFUN([PKG_PROG_PKG_CONFIG], +[m4_pattern_forbid([^_?PKG_[A-Z_]+$]) +m4_pattern_allow([^PKG_CONFIG(_(PATH|LIBDIR|SYSROOT_DIR|ALLOW_SYSTEM_(CFLAGS|LIBS)))?$]) +m4_pattern_allow([^PKG_CONFIG_(DISABLE_UNINSTALLED|TOP_BUILD_DIR|DEBUG_SPEW)$]) +AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility]) +AC_ARG_VAR([PKG_CONFIG_PATH], [directories to add to pkg-config's search path]) +AC_ARG_VAR([PKG_CONFIG_LIBDIR], [path overriding pkg-config's built-in search path]) + +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) +fi +if test -n "$PKG_CONFIG"; then + _pkg_min_version=m4_default([$1], [0.9.0]) + AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) + if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then + AC_MSG_RESULT([yes]) + else + AC_MSG_RESULT([no]) + PKG_CONFIG="" + fi +fi[]dnl +])# PKG_PROG_PKG_CONFIG + +# PKG_CHECK_EXISTS(MODULES, [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) +# +# Check to see whether a particular set of modules exists. Similar +# to PKG_CHECK_MODULES(), but does not set variables or print errors. +# +# Please remember that m4 expands AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +# only at the first occurence in configure.ac, so if the first place +# it's called might be skipped (such as if it is within an "if", you +# have to call PKG_CHECK_EXISTS manually +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_EXISTS], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +if test -n "$PKG_CONFIG" && \ + AC_RUN_LOG([$PKG_CONFIG --exists --print-errors "$1"]); then + m4_default([$2], [:]) +m4_ifvaln([$3], [else + $3])dnl +fi]) + +# _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) +# --------------------------------------------- +m4_define([_PKG_CONFIG], +[if test -n "$$1"; then + pkg_cv_[]$1="$$1" + elif test -n "$PKG_CONFIG"; then + PKG_CHECK_EXISTS([$3], + [pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` + test "x$?" != "x0" && pkg_failed=yes ], + [pkg_failed=yes]) + else + pkg_failed=untried +fi[]dnl +])# _PKG_CONFIG + +# _PKG_SHORT_ERRORS_SUPPORTED +# ----------------------------- +AC_DEFUN([_PKG_SHORT_ERRORS_SUPPORTED], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG]) +if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then + _pkg_short_errors_supported=yes +else + _pkg_short_errors_supported=no +fi[]dnl +])# _PKG_SHORT_ERRORS_SUPPORTED + + +# PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], +# [ACTION-IF-NOT-FOUND]) +# +# +# Note that if there is a possibility the first call to +# PKG_CHECK_MODULES might not happen, you should be sure to include an +# explicit call to PKG_PROG_PKG_CONFIG in your configure.ac +# +# +# -------------------------------------------------------------- +AC_DEFUN([PKG_CHECK_MODULES], +[AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl +AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl +AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl + +pkg_failed=no +AC_MSG_CHECKING([for $1]) + +_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2]) +_PKG_CONFIG([$1][_LIBS], [libs], [$2]) + +m4_define([_PKG_TEXT], [Alternatively, you may set the environment variables $1[]_CFLAGS +and $1[]_LIBS to avoid the need to call pkg-config. +See the pkg-config man page for more details.]) + +if test $pkg_failed = yes; then + AC_MSG_RESULT([no]) + _PKG_SHORT_ERRORS_SUPPORTED + if test $_pkg_short_errors_supported = yes; then + $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1` + else + $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$$1[]_PKG_ERRORS" >&AS_MESSAGE_LOG_FD + + m4_default([$4], [AC_MSG_ERROR( +[Package requirements ($2) were not met: + +$$1_PKG_ERRORS + +Consider adjusting the PKG_CONFIG_PATH environment variable if you +installed software in a non-standard prefix. + +_PKG_TEXT])[]dnl + ]) +elif test $pkg_failed = untried; then + AC_MSG_RESULT([no]) + m4_default([$4], [AC_MSG_FAILURE( +[The pkg-config script could not be found or is too old. Make sure it +is in your PATH or set the PKG_CONFIG environment variable to the full +path to pkg-config. + +_PKG_TEXT + +To get pkg-config, see .])[]dnl + ]) +else + $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS + $1[]_LIBS=$pkg_cv_[]$1[]_LIBS + AC_MSG_RESULT([yes]) + $3 +fi[]dnl +])# PKG_CHECK_MODULES + + +# PKG_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable pkgconfigdir as the location where a module +# should install pkg-config .pc files. By default the directory is +# $libdir/pkgconfig, but the default can be changed by passing +# DIRECTORY. The user can override through the --with-pkgconfigdir +# parameter. +AC_DEFUN([PKG_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${libdir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([pkgconfigdir], + [AS_HELP_STRING([--with-pkgconfigdir], pkg_description)],, + [with_pkgconfigdir=]pkg_default) +AC_SUBST([pkgconfigdir], [$with_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_INSTALLDIR + + +# PKG_NOARCH_INSTALLDIR(DIRECTORY) +# ------------------------- +# Substitutes the variable noarch_pkgconfigdir as the location where a +# module should install arch-independent pkg-config .pc files. By +# default the directory is $datadir/pkgconfig, but the default can be +# changed by passing DIRECTORY. The user can override through the +# --with-noarch-pkgconfigdir parameter. +AC_DEFUN([PKG_NOARCH_INSTALLDIR], +[m4_pushdef([pkg_default], [m4_default([$1], ['${datadir}/pkgconfig'])]) +m4_pushdef([pkg_description], + [pkg-config arch-independent installation directory @<:@]pkg_default[@:>@]) +AC_ARG_WITH([noarch-pkgconfigdir], + [AS_HELP_STRING([--with-noarch-pkgconfigdir], pkg_description)],, + [with_noarch_pkgconfigdir=]pkg_default) +AC_SUBST([noarch_pkgconfigdir], [$with_noarch_pkgconfigdir]) +m4_popdef([pkg_default]) +m4_popdef([pkg_description]) +]) dnl PKG_NOARCH_INSTALLDIR diff --git a/recipes-graphics/libsdl-gfx/libsdl-gfx_2.0.25.bb b/recipes-graphics/libsdl-gfx/libsdl-gfx_2.0.25.bb new file mode 100644 index 0000000..22d55cb --- /dev/null +++ b/recipes-graphics/libsdl-gfx/libsdl-gfx_2.0.25.bb @@ -0,0 +1,25 @@ +DESCRIPTION = "SDL graphics drawing primitives and other support functions." +SECTION = "libs" + +LICENSE = "Zlib" +LIC_FILES_CHKSUM = "file://LICENSE;md5=5d1de21f0b70830e299905eac3419084" + +DEPENDS = "virtual/libsdl" + +DEPENDS_append_rpi = " virtual/libgles2 virtual/egl" + +SRC_URI = "http://www.ferzkopp.net/Software/SDL_gfx-2.0/SDL_gfx-${PV}.tar.gz \ + file://pkg.m4" + +SRC_URI[md5sum] = "ea24ed4b82ff1304809c363494fa8e16" +SRC_URI[sha256sum] = "556eedc06b6cf29eb495b6d27f2dcc51bf909ad82389ba2fa7bdc4dec89059c0" + +S = "${WORKDIR}/SDL_gfx-${PV}" + +inherit autotools + +EXTRA_OECONF += "SDL_CONFIG=${STAGING_BINDIR_CROSS}/sdl-config --disable-mmx" + +do_configure_prepend() { + cp ${WORKDIR}/pkg.m4 ${S}/m4/ +} diff --git a/recipes-graphics/libsdl/libsdl/rpi/0001-rpi-framebuffer-fixes-from-pssc-https-github.com-ras.patch b/recipes-graphics/libsdl/libsdl/rpi/0001-rpi-framebuffer-fixes-from-pssc-https-github.com-ras.patch new file mode 100644 index 0000000..a20ca96 --- /dev/null +++ b/recipes-graphics/libsdl/libsdl/rpi/0001-rpi-framebuffer-fixes-from-pssc-https-github.com-ras.patch @@ -0,0 +1,266 @@ +From 18831ad4b41dbce8c80ba87bbc64dbe9760f4965 Mon Sep 17 00:00:00 2001 +From: Jools Wills +Date: Thu, 12 Feb 2015 09:19:16 +0000 +Subject: [PATCH 1/5] rpi framebuffer fixes from pssc - + https://github.com/raspberrypi/firmware/issues/354 + +he writes: +number of fixes for the frame buffer and HW double buffering specifically around the Pi, making it more robust in general and coping with extended key codes better. +On a mode change on the Pi the FIXSCREEN info can change, including the base address of the bufferer and offsets stuffing up the Flips etc + +Having reread all the docs and code I am more inclined to believe this is an incorrect assumption in the original SDL fbcon driver. As 'unchangeable information about a frame buffer device and +a specific video mode' had been interpreted as this info will never change, which Is a trap I also fell into on my first reading and is the assumption the original code makes. +--- + src/video/fbcon/SDL_fbvideo.c | 106 +++++++++++++++++++++++++++++++----------- + 1 file changed, 79 insertions(+), 27 deletions(-) + +diff --git a/src/video/fbcon/SDL_fbvideo.c b/src/video/fbcon/SDL_fbvideo.c +index 5e5880908d09..03da842aba2e 100644 +--- a/src/video/fbcon/SDL_fbvideo.c ++++ b/src/video/fbcon/SDL_fbvideo.c +@@ -65,22 +65,29 @@ static inline void outb (unsigned char value, unsigned short port) + #endif /* FB_TYPE_VGA_PLANES */ + + /* A list of video resolutions that we query for (sorted largest to smallest) */ ++/* http://en.wikipedia.org/wiki/Graphics_display_resolution */ + static const SDL_Rect checkres[] = { +- { 0, 0, 1600, 1200 }, /* 16 bpp: 0x11E, or 286 */ +- { 0, 0, 1408, 1056 }, /* 16 bpp: 0x19A, or 410 */ +- { 0, 0, 1280, 1024 }, /* 16 bpp: 0x11A, or 282 */ +- { 0, 0, 1152, 864 }, /* 16 bpp: 0x192, or 402 */ +- { 0, 0, 1024, 768 }, /* 16 bpp: 0x117, or 279 */ ++ { 0, 0, 1920, 1200 }, // WUXGA ++ { 0, 0, 1920, 1080 }, // 1080p FHD 16:9 = 1.7 ++ { 0, 0, 1600, 1200 }, /* 16 bpp: 0x11E, or 286 / UXGA */ ++ { 0, 0, 1408, 1056 }, /* 16 bpp: 0x19A, or 410 */ ++ { 0, 0, 1280, 1024 }, /* 16 bpp: 0x11A, or 282 / SXGA */ ++ { 0, 0, 1280, 720 }, // 720p HD/WXGA 16:9 = 1.7 ++ { 0, 0, 1152, 864 }, /* 16 bpp: 0x192, or 402 / XGA+ */ ++ { 0, 0, 1024, 768 }, /* 16 bpp: 0x117, or 279 / XGA */ + { 0, 0, 960, 720 }, /* 16 bpp: 0x18A, or 394 */ +- { 0, 0, 800, 600 }, /* 16 bpp: 0x114, or 276 */ ++ { 0, 0, 800, 600 }, /* 16 bpp: 0x114, or 276 / SVGA */ ++ { 0, 0, 800, 480 }, // WVGA 5:3 = 1.6 + { 0, 0, 768, 576 }, /* 16 bpp: 0x182, or 386 */ + { 0, 0, 720, 576 }, /* PAL */ + { 0, 0, 720, 480 }, /* NTSC */ + { 0, 0, 640, 480 }, /* 16 bpp: 0x111, or 273 */ + { 0, 0, 640, 400 }, /* 8 bpp: 0x100, or 256 */ + { 0, 0, 512, 384 }, +- { 0, 0, 320, 240 }, +- { 0, 0, 320, 200 } ++ { 0, 0, 480, 320 }, // HVGA 3:2 = 1.5 ++ { 0, 0, 480, 272 }, // WQVGA? ++ { 0, 0, 320, 240 }, // QVGA 4:3 = 1.3 ++ { 0, 0, 320, 200 } // CGA 4:3 = 1.3 + }; + static const struct { + int xres; +@@ -177,6 +184,8 @@ static int SDL_getpagesize(void) + #endif + } + ++static void print_finfo(struct fb_fix_screeninfo *finfo); ++ + + /* Small wrapper for mmap() so we can play nicely with no-mmu hosts + * (non-mmu hosts disallow the MAP_SHARED flag) */ +@@ -329,6 +338,8 @@ static int read_fbmodes_mode(FILE *f, struct fb_var_screeninfo *vinfo) + } + while(1); + ++ SDL_memset(vinfo, 0, sizeof(struct fb_var_screeninfo)); // prevent random junk ++ + SDL_sscanf(line, "geometry %d %d %d %d %d", &vinfo->xres, &vinfo->yres, + &vinfo->xres_virtual, &vinfo->yres_virtual, &vinfo->bits_per_pixel); + if (read_fbmodes_line(f, line, sizeof(line))==0) +@@ -495,7 +506,6 @@ static void FB_SortModes(_THIS) + + static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat) + { +- const int pagesize = SDL_getpagesize(); + struct fb_fix_screeninfo finfo; + struct fb_var_screeninfo vinfo; + int i, j; +@@ -533,6 +543,10 @@ static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat) + FB_VideoQuit(this); + return(-1); + } ++#ifdef FBCON_DEBUG ++ print_finfo(&finfo); ++#endif ++ + switch (finfo.type) { + case FB_TYPE_PACKED_PIXELS: + /* Supported, no worries.. */ +@@ -578,7 +592,7 @@ static int FB_VideoInit(_THIS, SDL_PixelFormat *vformat) + + /* Memory map the device, compensating for buggy PPC mmap() */ + mapped_offset = (((long)finfo.smem_start) - +- (((long)finfo.smem_start)&~(pagesize-1))); ++ (((long)finfo.smem_start)&~(SDL_getpagesize()-1))); + mapped_memlen = finfo.smem_len+mapped_offset; + mapped_mem = do_mmap(NULL, mapped_memlen, + PROT_READ|PROT_WRITE, MAP_SHARED, console_fd, 0); +@@ -885,6 +899,10 @@ static int choose_fbmodes_mode(struct fb_var_screeninfo *vinfo) + while ( read_fbmodes_mode(modesdb, &cinfo) ) { + if ( (vinfo->xres == cinfo.xres && vinfo->yres == cinfo.yres) && + (!matched || (vinfo->bits_per_pixel == cinfo.bits_per_pixel)) ) { ++#ifdef FBCON_DEBUG ++ fprintf(stderr, "Using FBModes timings for %dx%d\n", ++ vinfo->xres, vinfo->yres); ++#endif + vinfo->pixclock = cinfo.pixclock; + vinfo->left_margin = cinfo.left_margin; + vinfo->right_margin = cinfo.right_margin; +@@ -1015,13 +1033,20 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current, + /* Restore the original palette */ + FB_RestorePalette(this); + ++ SDL_memset(&vinfo, 0, sizeof(vinfo)); + /* Set the video mode and get the final screen format */ + if ( ioctl(console_fd, FBIOGET_VSCREENINFO, &vinfo) < 0 ) { + SDL_SetError("Couldn't get console screen info"); + return(NULL); + } ++ /* Get the type of video hardware */ ++ if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) { ++ SDL_SetError("Couldn't get console hardware info"); ++ return(NULL); ++ } + #ifdef FBCON_DEBUG +- fprintf(stderr, "Printing original vinfo:\n"); ++ fprintf(stderr, "Printing original info:\n"); ++ print_finfo(&finfo); + print_vinfo(&vinfo); + #endif + /* Do not use double buffering with shadow buffer */ +@@ -1031,6 +1056,10 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current, + + if ( (vinfo.xres != width) || (vinfo.yres != height) || + (vinfo.bits_per_pixel != bpp) || (flags & SDL_DOUBLEBUF) ) { ++#ifdef FBCON_DEBUG ++ fprintf(stderr, "Request %dx%d %d Actual %dx%d %d %s flags %x current %dx%d\n",width,height,bpp,vinfo.xres,vinfo.yres,vinfo.bits_per_pixel,(flags & SDL_DOUBLEBUF) ? "SDL_DOUBLEBUF" : "" ,flags , current->w,current->h); ++#endif ++ SDL_memset(&vinfo, 0, sizeof(vinfo)); + vinfo.activate = FB_ACTIVATE_NOW; + vinfo.accel_flags = 0; + vinfo.bits_per_pixel = bpp; +@@ -1048,6 +1077,9 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current, + vinfo.green.length = vinfo.green.offset = 0; + vinfo.blue.length = vinfo.blue.offset = 0; + vinfo.transp.length = vinfo.transp.offset = 0; ++ // vinfo.height = 0; ++ // vinfo.width = 0; ++ // vinfo.vmode |= FB_VMODE_CONUPDATE; + if ( ! choose_fbmodes_mode(&vinfo) ) { + choose_vesa_mode(&vinfo); + } +@@ -1076,11 +1108,20 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current, + vinfo.yres_virtual = maxheight; + } + } +- cache_vinfo = vinfo; ++ /* Get the fixed information about the console hardware. ++ This is necessary since finfo.line_length changes. ++ and in case RPI the frame buffer offsets and length change ++ */ ++ if ( ioctl(console_fd, FBIOGET_FSCREENINFO, &finfo) < 0 ) { ++ SDL_SetError("Couldn't get console hardware info"); ++ return(NULL); ++ } + #ifdef FBCON_DEBUG +- fprintf(stderr, "Printing actual vinfo:\n"); ++ fprintf(stderr, "Printing actual info:\n"); ++ print_finfo(&finfo); + print_vinfo(&vinfo); + #endif ++ cache_vinfo = vinfo; + Rmask = 0; + for ( i=0; iflags &= SDL_FULLSCREEN; + if (shadow_fb) { +@@ -1167,7 +1213,7 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current, + + /* Update for double-buffering, if we can */ + if ( flags & SDL_DOUBLEBUF ) { +- if ( vinfo.yres_virtual == (height*2) ) { ++ if ( vinfo.yres_virtual >= (vinfo.yres*2) ) { + current->flags |= SDL_DOUBLEBUF; + flip_page = 0; + flip_address[0] = (char *)current->pixels; +@@ -1176,6 +1222,10 @@ static SDL_Surface *FB_SetVideoMode(_THIS, SDL_Surface *current, + this->screen = current; + FB_FlipHWSurface(this, current); + this->screen = NULL; ++#ifdef FBCON_DEBUG ++ fprintf(stderr, "SDL_DOUBLEBUF 0:%x 1:%x pitch %x\n",(unsigned int)flip_address[0],(unsigned int) flip_address[1],current->pitch); ++#endif ++ + } + } + +@@ -1409,9 +1459,7 @@ static void FB_UnlockHWSurface(_THIS, SDL_Surface *surface) + + static void FB_WaitVBL(_THIS) + { +-#ifdef FBIOWAITRETRACE /* Heheh, this didn't make it into the main kernel */ +- ioctl(console_fd, FBIOWAITRETRACE, 0); +-#endif ++ ioctl(console_fd, FBIO_WAITFORVSYNC, 0); + return; + } + +@@ -1426,8 +1474,12 @@ static int FB_FlipHWSurface(_THIS, SDL_Surface *surface) + return -2; /* no hardware access */ + } + ++#ifdef FBCON_DEBUG ++ fprintf(stderr, "Flip vinfo offset changing to %d current:\n",flip_page*cache_vinfo.yres); ++ print_vinfo(&cache_vinfo); ++#endif + /* Wait for vertical retrace and then flip display */ +- cache_vinfo.yoffset = flip_page*surface->h; ++ cache_vinfo.yoffset = flip_page*cache_vinfo.yres; + if ( FB_IsSurfaceBusy(this->screen) ) { + FB_WaitBusySurfaces(this); + } +-- +1.9.1 + diff --git a/recipes-graphics/libsdl/libsdl/rpi/0002-added-dispmanx-support-to-sdl-enabled-by-changing-en.patch b/recipes-graphics/libsdl/libsdl/rpi/0002-added-dispmanx-support-to-sdl-enabled-by-changing-en.patch new file mode 100644 index 0000000..7a305a4 --- /dev/null +++ b/recipes-graphics/libsdl/libsdl/rpi/0002-added-dispmanx-support-to-sdl-enabled-by-changing-en.patch @@ -0,0 +1,529 @@ +From 09f695c70366a03e3e639f4ea2005a50f471503d Mon Sep 17 00:00:00 2001 +From: Jools Wills +Date: Thu, 12 Feb 2015 09:21:09 +0000 +Subject: [PATCH 2/5] added dispmanx support to sdl - enabled by changing env + SDL1_VIDEODRIVER to "dispmanx". By default it still outputs to framebuffer. + This will replace our current system of having a additional sdl library + installed + +the dispmanx code was based on work by vanfanel, with a lot of cleanups/changes. + +I stripped it down, removed a lot of code I didn't think was needed, and made some improvements - such as fixing a crash for me with advmame + sdl (and other code that called SDL_GetVideoInfo/ListModes), rewriting the scaling code, removing an exit(0), fixing a double free issue, de-duplicating it by making it share the SDL input/video headers, and some other bits +--- + configure.in | 21 ++ + include/SDL_config.h.in | 1 + + src/SDL.c | 2 +- + src/video/SDL_sysvideo.h | 3 + + src/video/SDL_video.c | 3 + + src/video/dispmanx/SDL_dispmanxvideo.c | 407 +++++++++++++++++++++++++++++++++ + 6 files changed, 436 insertions(+), 1 deletion(-) + create mode 100644 src/video/dispmanx/SDL_dispmanxvideo.c + +diff --git a/configure.in b/configure.in +index 08c8e1e97c67..f76e6712472b 100644 +--- a/configure.in ++++ b/configure.in +@@ -1252,6 +1252,26 @@ AC_HELP_STRING([--enable-video-fbcon], [use framebuffer console video driver [[d + fi + } + ++dnl Find the DISPMANX includes ++CheckDISPMANX() ++{ ++ AC_ARG_ENABLE(video-dispmanx, ++AC_HELP_STRING([--enable-video-dispmanx], [use DISPMANX video modes [[default=yes]]]), ++ , enable_video_dispmanx=yes) ++ if test x$enable_video = xyes -a x$enable_video_dispmanx = xyes; then ++ AC_MSG_CHECKING(for dispmanx support) ++ DISPMANX_LDFLAGS="-L/opt/vc/lib -lbcm_host -lvcos -lvchiq_arm" ++ DISPMANX_INCLUDES="-I/opt/vc/include -I/opt/vc/include/interface/vcos/pthreads -I/opt/vc/include/interface/vmcs_host/linux" ++ EXTRA_CFLAGS="$EXTRA_CFLAGS $DISPMANX_INCLUDES" ++ EXTRA_LDFLAGS="$EXTRA_LDFLAGS $DISPMANX_LDFLAGS" ++ SOURCES="$SOURCES $srcdir/src/video/dispmanx/*.c" ++ AC_DEFINE(SDL_VIDEO_DRIVER_DISPMANX) ++ video_dispmanx=yes ++ have_video=yes ++ AC_MSG_RESULT($video_dispmanx) ++ fi ++} ++ + dnl Find DirectFB + CheckDirectFB() + { +@@ -2363,6 +2383,7 @@ case "$host" in + CheckX11 + CheckNANOX + CheckFBCON ++ CheckDISPMANX + CheckDirectFB + CheckPS2GS + CheckPS3 +diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in +index 8bb1773c0eb7..31cb2a4d7502 100644 +--- a/include/SDL_config.h.in ++++ b/include/SDL_config.h.in +@@ -263,6 +263,7 @@ + #undef SDL_VIDEO_DRIVER_DRAWSPROCKET + #undef SDL_VIDEO_DRIVER_DUMMY + #undef SDL_VIDEO_DRIVER_FBCON ++#undef SDL_VIDEO_DRIVER_DISPMANX + #undef SDL_VIDEO_DRIVER_GAPI + #undef SDL_VIDEO_DRIVER_GEM + #undef SDL_VIDEO_DRIVER_GGI +diff --git a/src/SDL.c b/src/SDL.c +index 87f1b1af2a7c..84c0cabf6d41 100644 +--- a/src/SDL.c ++++ b/src/SDL.c +@@ -86,7 +86,7 @@ int SDL_InitSubSystem(Uint32 flags) + #if !SDL_VIDEO_DISABLED + /* Initialize the video/event subsystem */ + if ( (flags & SDL_INIT_VIDEO) && !(SDL_initialized & SDL_INIT_VIDEO) ) { +- if ( SDL_VideoInit(SDL_getenv("SDL_VIDEODRIVER"), ++ if ( SDL_VideoInit(SDL_getenv("SDL1_VIDEODRIVER"), + (flags&SDL_INIT_EVENTTHREAD)) < 0 ) { + return(-1); + } +diff --git a/src/video/SDL_sysvideo.h b/src/video/SDL_sysvideo.h +index 436450e330e7..17fa7853dedf 100644 +--- a/src/video/SDL_sysvideo.h ++++ b/src/video/SDL_sysvideo.h +@@ -344,6 +344,9 @@ extern VideoBootStrap FBCON_bootstrap; + #if SDL_VIDEO_DRIVER_DIRECTFB + extern VideoBootStrap DirectFB_bootstrap; + #endif ++#if SDL_VIDEO_DRIVER_DISPMANX ++extern VideoBootStrap DISPMANX_bootstrap; ++#endif + #if SDL_VIDEO_DRIVER_PS2GS + extern VideoBootStrap PS2GS_bootstrap; + #endif +diff --git a/src/video/SDL_video.c b/src/video/SDL_video.c +index 46285c990e40..8f7dfaa16457 100644 +--- a/src/video/SDL_video.c ++++ b/src/video/SDL_video.c +@@ -57,6 +57,9 @@ static VideoBootStrap *bootstrap[] = { + #if SDL_VIDEO_DRIVER_FBCON + &FBCON_bootstrap, + #endif ++#if SDL_VIDEO_DRIVER_DISPMANX ++ &DISPMANX_bootstrap, ++#endif + #if SDL_VIDEO_DRIVER_DIRECTFB + &DirectFB_bootstrap, + #endif +diff --git a/src/video/dispmanx/SDL_dispmanxvideo.c b/src/video/dispmanx/SDL_dispmanxvideo.c +new file mode 100644 +index 000000000000..5daf76325bf3 +--- /dev/null ++++ b/src/video/dispmanx/SDL_dispmanxvideo.c +@@ -0,0 +1,407 @@ ++/* ++ SDL - Simple DirectMedia Layer ++ Copyright (C) 1997-2012 Sam Lantinga ++ ++ This library is free software; you can redistribute it and/or ++ modify it under the terms of the GNU Lesser General Public ++ License as published by the Free Software Foundation; either ++ version 2.1 of the License, or (at your option) any later version. ++ ++ This library is distributed in the hope that it will be useful, ++ but WITHOUT ANY WARRANTY; without even the implied warranty of ++ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ++ Lesser General Public License for more details. ++ ++ You should have received a copy of the GNU Lesser General Public ++ License along with this library; if not, write to the Free Software ++ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA ++ ++ Sam Lantinga ++ slouken@libsdl.org ++*/ ++ ++#include "SDL_config.h" ++ ++#include ++ ++#include ++ ++#include ++ ++#include "SDL_video.h" ++#include "SDL_mouse.h" ++#include "../SDL_sysvideo.h" ++#include "../SDL_pixels_c.h" ++#include "../fbcon/SDL_fbmouse_c.h" ++#include "../fbcon/SDL_fbevents_c.h" ++ ++#define min(a,b) ((a)<(b)?(a):(b)) ++#define RGB565(r,g,b) (((r)>>3)<<11 | ((g)>>2)<<5 | (b)>>3) ++ ++/* Initialization/Query functions */ ++static int DISPMANX_VideoInit(_THIS, SDL_PixelFormat *vformat); ++static SDL_Rect **DISPMANX_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags); ++static SDL_Surface *DISPMANX_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags); ++static int DISPMANX_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors); ++static void DISPMANX_VideoQuit(_THIS); ++ ++/* Hardware surface functions */ ++static void DISPMANX_WaitVBL(_THIS); ++static void DISPMANX_WaitIdle(_THIS); ++static void DISPMANX_DirectUpdate(_THIS, int numrects, SDL_Rect *rects); ++static void DISPMANX_BlankBackground(void); ++static void DISPMANX_FreeResources(void); ++static void DISPMANX_FreeBackground (void); ++ ++typedef struct { ++ DISPMANX_DISPLAY_HANDLE_T display; ++ DISPMANX_MODEINFO_T amode; ++ void *pixmem; ++ DISPMANX_UPDATE_HANDLE_T update; ++ DISPMANX_RESOURCE_HANDLE_T resources[2]; ++ DISPMANX_ELEMENT_HANDLE_T element; ++ VC_IMAGE_TYPE_T pix_format; ++ uint32_t vc_image_ptr; ++ VC_DISPMANX_ALPHA_T *alpha; ++ VC_RECT_T src_rect; ++ VC_RECT_T dst_rect; ++ VC_RECT_T bmp_rect; ++ int bits_per_pixel; ++ int pitch; ++ ++ DISPMANX_RESOURCE_HANDLE_T b_resource; ++ DISPMANX_ELEMENT_HANDLE_T b_element; ++ DISPMANX_UPDATE_HANDLE_T b_update; ++ ++ int ignore_ratio; ++ ++} __DISPMAN_VARIABLES_T; ++ ++ ++static __DISPMAN_VARIABLES_T _DISPMAN_VARS; ++static __DISPMAN_VARIABLES_T *dispvars = &_DISPMAN_VARS; ++ ++static int DISPMANX_Available(void) ++{ ++ return (1); ++} ++ ++static void DISPMANX_DeleteDevice(SDL_VideoDevice *device) ++{ ++ SDL_free(device->hidden); ++ SDL_free(device); ++} ++ ++static SDL_VideoDevice *DISPMANX_CreateDevice(int devindex) ++{ ++ SDL_VideoDevice *this; ++ ++ /* Initialize all variables that we clean on shutdown */ ++ this = (SDL_VideoDevice *)SDL_malloc(sizeof(SDL_VideoDevice)); ++ if ( this ) { ++ SDL_memset(this, 0, (sizeof *this)); ++ this->hidden = (struct SDL_PrivateVideoData *) ++ SDL_malloc((sizeof *this->hidden)); ++ } ++ if ( (this == NULL) || (this->hidden == NULL) ) { ++ SDL_OutOfMemory(); ++ if ( this ) { ++ SDL_free(this); ++ } ++ return(0); ++ } ++ SDL_memset(this->hidden, 0, (sizeof *this->hidden)); ++ wait_vbl = DISPMANX_WaitVBL; ++ wait_idle = DISPMANX_WaitIdle; ++ mouse_fd = -1; ++ keyboard_fd = -1; ++ ++ /* Set the function pointers */ ++ this->VideoInit = DISPMANX_VideoInit; ++ this->ListModes = DISPMANX_ListModes; ++ this->SetVideoMode = DISPMANX_SetVideoMode; ++ this->SetColors = DISPMANX_SetColors; ++ this->UpdateRects = DISPMANX_DirectUpdate; ++ this->VideoQuit = DISPMANX_VideoQuit; ++ this->CheckHWBlit = NULL; ++ this->FillHWRect = NULL; ++ this->SetHWColorKey = NULL; ++ this->SetHWAlpha = NULL; ++ this->SetCaption = NULL; ++ this->SetIcon = NULL; ++ this->IconifyWindow = NULL; ++ this->GrabInput = NULL; ++ this->GetWMInfo = NULL; ++ this->InitOSKeymap = FB_InitOSKeymap; ++ this->PumpEvents = FB_PumpEvents; ++ this->CreateYUVOverlay = NULL; ++ ++ this->free = DISPMANX_DeleteDevice; ++ ++ return this; ++} ++ ++VideoBootStrap DISPMANX_bootstrap = { ++ "dispmanx", "Dispmanx Raspberry Pi VC", ++ DISPMANX_Available, DISPMANX_CreateDevice ++}; ++ ++static int DISPMANX_VideoInit(_THIS, SDL_PixelFormat *vformat) ++{ ++#if !SDL_THREADS_DISABLED ++ /* Create the hardware surface lock mutex */ ++ hw_lock = SDL_CreateMutex(); ++ if ( hw_lock == NULL ) { ++ SDL_SetError("Unable to create lock mutex"); ++ DISPMANX_VideoQuit(this); ++ return(-1); ++ } ++#endif ++ ++ /* Enable mouse and keyboard support */ ++ if ( FB_OpenKeyboard(this) < 0 ) { ++ DISPMANX_VideoQuit(this); ++ return(-1); ++ } ++ if ( FB_OpenMouse(this) < 0 ) { ++ const char *sdl_nomouse; ++ ++ sdl_nomouse = SDL_getenv("SDL_NOMOUSE"); ++ if ( ! sdl_nomouse ) { ++ SDL_SetError("Unable to open mouse"); ++ DISPMANX_VideoQuit(this); ++ return(-1); ++ } ++ } ++ ++ vformat->BitsPerPixel = 16; ++ vformat->Rmask = 0; ++ vformat->Gmask = 0; ++ vformat->Bmask = 0; ++ ++ /* We're done! */ ++ return(0); ++} ++ ++static SDL_Surface *DISPMANX_SetVideoMode(_THIS, SDL_Surface *current, int width, int height, int bpp, Uint32 flags) ++{ ++ if ((width == 0) | (height == 0)) goto go_video_console; ++ ++ uint32_t screen = 0; ++ ++ bcm_host_init(); ++ ++ dispvars->display = vc_dispmanx_display_open( screen ); ++ ++ vc_dispmanx_display_get_info( dispvars->display, &(dispvars->amode)); ++ printf( "Dispmanx: Physical video mode is %d x %d\n", ++ dispvars->amode.width, dispvars->amode.height ); ++ ++ DISPMANX_BlankBackground(); ++ ++ Uint32 Rmask; ++ Uint32 Gmask; ++ Uint32 Bmask; ++ ++ dispvars->bits_per_pixel = bpp; ++ dispvars->pitch = ( ALIGN_UP( width, 16 ) * (bpp/8) ); ++ ++ height = ALIGN_UP( height, 16); ++ ++ switch (bpp) { ++ case 8: ++ dispvars->pix_format = VC_IMAGE_8BPP; ++ break; ++ case 16: ++ dispvars->pix_format = VC_IMAGE_RGB565; ++ break; ++ case 32: ++ dispvars->pix_format = VC_IMAGE_XRGB8888; ++ break; ++ default: ++ printf ("Dispmanx: [ERROR] - wrong bpp: %d\n",bpp); ++ return (NULL); ++ } ++ ++ printf ("Dispmanx: Using internal program mode: %d x %d %d bpp\n", ++ width, height, dispvars->bits_per_pixel); ++ ++ printf ("Dispmanx: Using physical mode: %d x %d %d bpp\n", ++ dispvars->amode.width, dispvars->amode.height, ++ dispvars->bits_per_pixel); ++ ++ dispvars->ignore_ratio = (int) SDL_getenv("SDL_DISPMANX_IGNORE_RATIO"); ++ ++ if (dispvars->ignore_ratio) ++ vc_dispmanx_rect_set( &(dispvars->dst_rect), 0, 0, dispvars->amode.width , dispvars->amode.height ); ++ else { ++ float width_scale, height_scale; ++ width_scale = (float) dispvars->amode.width / width; ++ height_scale = (float) dispvars->amode.height / height; ++ float scale = min(width_scale, height_scale); ++ int dst_width = width * scale; ++ int dst_height = height * scale; ++ ++ int dst_xpos = (dispvars->amode.width - dst_width) / 2; ++ int dst_ypos = (dispvars->amode.height - dst_height) / 2; ++ ++ printf ("Dispmanx: Scaling to %d x %d", dst_width, dst_height); ++ ++ vc_dispmanx_rect_set( &(dispvars->dst_rect), dst_xpos, dst_ypos, ++ dst_width , dst_height ); ++ } ++ ++ vc_dispmanx_rect_set (&(dispvars->bmp_rect), 0, 0, width, height); ++ ++ vc_dispmanx_rect_set (&(dispvars->src_rect), 0, 0, width << 16, height << 16); ++ ++ VC_DISPMANX_ALPHA_T layerAlpha; ++ ++ layerAlpha.flags = DISPMANX_FLAGS_ALPHA_FIXED_ALL_PIXELS; ++ layerAlpha.opacity = 255; ++ layerAlpha.mask = 0; ++ dispvars->alpha = &layerAlpha; ++ ++ dispvars->resources[0] = vc_dispmanx_resource_create( dispvars->pix_format, width, height, &(dispvars->vc_image_ptr) ); ++ dispvars->resources[1] = vc_dispmanx_resource_create( dispvars->pix_format, width, height, &(dispvars->vc_image_ptr) ); ++ ++ dispvars->pixmem = calloc( 1, dispvars->pitch * height); ++ ++ Rmask = 0; ++ Gmask = 0; ++ Bmask = 0; ++ if ( ! SDL_ReallocFormat(current, bpp, Rmask, Gmask, Bmask, 0) ) { ++ return(NULL); ++ } ++ ++ current->w = width; ++ current->h = height; ++ ++ current->pitch = dispvars->pitch; ++ current->pixels = dispvars->pixmem; ++ ++ dispvars->update = vc_dispmanx_update_start( 0 ); ++ ++ dispvars->element = vc_dispmanx_element_add( dispvars->update, ++ dispvars->display, 0 /*layer*/, &(dispvars->dst_rect), ++ dispvars->resources[flip_page], &(dispvars->src_rect), ++ DISPMANX_PROTECTION_NONE, dispvars->alpha, 0 /*clamp*/, ++ /*VC_IMAGE_ROT0*/ 0 ); ++ ++ vc_dispmanx_update_submit_sync( dispvars->update ); ++ ++ go_video_console: ++ if ( FB_EnterGraphicsMode(this) < 0 ) ++ return(NULL); ++ ++ return(current); ++} ++ ++static void DISPMANX_BlankBackground(void) ++{ ++ VC_IMAGE_TYPE_T type = VC_IMAGE_RGB565; ++ uint32_t vc_image_ptr; ++ uint16_t image = 0x0000; // black ++ ++ VC_RECT_T dst_rect, src_rect; ++ ++ dispvars->b_resource = vc_dispmanx_resource_create( type, 1 /*width*/, 1 /*height*/, &vc_image_ptr ); ++ ++ vc_dispmanx_rect_set( &dst_rect, 0, 0, 1, 1); ++ ++ vc_dispmanx_resource_write_data( dispvars->b_resource, type, sizeof(image), &image, &dst_rect ); ++ ++ vc_dispmanx_rect_set( &src_rect, 0, 0, 1<<16, 1<<16); ++ vc_dispmanx_rect_set( &dst_rect, 0, 0, 0, 0); ++ ++ dispvars->b_update = vc_dispmanx_update_start(0); ++ ++ dispvars->b_element = vc_dispmanx_element_add(dispvars->b_update, dispvars->display, -1 /*layer*/, &dst_rect, ++ dispvars->b_resource, &src_rect, DISPMANX_PROTECTION_NONE, NULL, NULL, (DISPMANX_TRANSFORM_T)0 ); ++ ++ vc_dispmanx_update_submit_sync( dispvars->b_update ); ++} ++ ++static void DISPMANX_WaitVBL(_THIS) ++{ ++ return; ++} ++ ++static void DISPMANX_WaitIdle(_THIS) ++{ ++ return; ++} ++ ++static void DISPMANX_DirectUpdate(_THIS, int numrects, SDL_Rect *rects) ++{ ++ vc_dispmanx_resource_write_data( dispvars->resources[flip_page], ++ dispvars->pix_format, dispvars->pitch, dispvars->pixmem, ++ &(dispvars->bmp_rect) ); ++ ++ dispvars->update = vc_dispmanx_update_start( 0 ); ++ ++ vc_dispmanx_element_change_source(dispvars->update, dispvars->element, dispvars->resources[flip_page]); ++ ++ vc_dispmanx_update_submit_sync( dispvars->update ); ++ ++ flip_page = !flip_page; ++ ++ return; ++} ++ ++static int DISPMANX_SetColors(_THIS, int firstcolor, int ncolors, SDL_Color *colors) ++{ ++ int i; ++ static unsigned short pal[256]; ++ ++ //Set up the colormap ++ for (i = 0; i < ncolors; i++) { ++ pal[i] = RGB565 ((colors[i]).r, (colors[i]).g, (colors[i]).b); ++ } ++ vc_dispmanx_resource_set_palette( dispvars->resources[flip_page], pal, 0, sizeof pal ); ++ vc_dispmanx_resource_set_palette( dispvars->resources[!flip_page], pal, 0, sizeof pal ); ++ ++ return(1); ++} ++ ++static SDL_Rect **DISPMANX_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags) ++{ ++ return((SDL_Rect **)-1); ++} ++ ++static void DISPMANX_FreeResources(void){ ++ dispvars->update = vc_dispmanx_update_start( 0 ); ++ vc_dispmanx_element_remove(dispvars->update, dispvars->element); ++ vc_dispmanx_update_submit_sync( dispvars->update ); ++ ++ vc_dispmanx_resource_delete( dispvars->resources[0] ); ++ vc_dispmanx_resource_delete( dispvars->resources[1] ); ++ ++ vc_dispmanx_display_close( dispvars->display ); ++} ++ ++static void DISPMANX_FreeBackground (void) { ++ dispvars->b_update = vc_dispmanx_update_start( 0 ); ++ ++ vc_dispmanx_resource_delete( dispvars->b_resource ); ++ vc_dispmanx_element_remove ( dispvars->b_update, dispvars->b_element); ++ ++ vc_dispmanx_update_submit_sync( dispvars->b_update ); ++} ++ ++static void DISPMANX_VideoQuit(_THIS) ++{ ++ /* Clear the lock mutex */ ++ if ( hw_lock ) { ++ SDL_DestroyMutex(hw_lock); ++ hw_lock = NULL; ++ } ++ ++ if (dispvars->pixmem != NULL){ ++ DISPMANX_FreeBackground(); ++ DISPMANX_FreeResources(); ++ } ++ ++ FB_CloseMouse(this); ++ FB_CloseKeyboard(this); ++} +-- +1.9.1 + diff --git a/recipes-graphics/libsdl/libsdl/rpi/0003-added-missing-n.patch b/recipes-graphics/libsdl/libsdl/rpi/0003-added-missing-n.patch new file mode 100644 index 0000000..3e9a13d --- /dev/null +++ b/recipes-graphics/libsdl/libsdl/rpi/0003-added-missing-n.patch @@ -0,0 +1,25 @@ +From 73de49cf128921344e1c95a49f272047fd499747 Mon Sep 17 00:00:00 2001 +From: Jools Wills +Date: Thu, 12 Feb 2015 17:51:13 +0000 +Subject: [PATCH 3/5] added missing \n + +--- + src/video/dispmanx/SDL_dispmanxvideo.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/video/dispmanx/SDL_dispmanxvideo.c b/src/video/dispmanx/SDL_dispmanxvideo.c +index 5daf76325bf3..e4a2c580730b 100644 +--- a/src/video/dispmanx/SDL_dispmanxvideo.c ++++ b/src/video/dispmanx/SDL_dispmanxvideo.c +@@ -245,7 +245,7 @@ static SDL_Surface *DISPMANX_SetVideoMode(_THIS, SDL_Surface *current, int width + int dst_xpos = (dispvars->amode.width - dst_width) / 2; + int dst_ypos = (dispvars->amode.height - dst_height) / 2; + +- printf ("Dispmanx: Scaling to %d x %d", dst_width, dst_height); ++ printf ("Dispmanx: Scaling to %d x %d\n", dst_width, dst_height); + + vc_dispmanx_rect_set( &(dispvars->dst_rect), dst_xpos, dst_ypos, + dst_width , dst_height ); +-- +1.9.1 + diff --git a/recipes-graphics/libsdl/libsdl/rpi/0004-only-initialise-once-SetVideoMode-can-be-called-mult.patch b/recipes-graphics/libsdl/libsdl/rpi/0004-only-initialise-once-SetVideoMode-can-be-called-mult.patch new file mode 100644 index 0000000..273129a --- /dev/null +++ b/recipes-graphics/libsdl/libsdl/rpi/0004-only-initialise-once-SetVideoMode-can-be-called-mult.patch @@ -0,0 +1,65 @@ +From 7eef820b58afbe0c2e702005ccd1fc77cc5f4983 Mon Sep 17 00:00:00 2001 +From: Jools Wills +Date: Fri, 13 Feb 2015 00:20:40 +0000 +Subject: [PATCH 4/5] only initialise once - SetVideoMode can be called + multiple times. + +--- + src/video/dispmanx/SDL_dispmanxvideo.c | 23 +++++++++++++---------- + 1 file changed, 13 insertions(+), 10 deletions(-) + +diff --git a/src/video/dispmanx/SDL_dispmanxvideo.c b/src/video/dispmanx/SDL_dispmanxvideo.c +index e4a2c580730b..cf3a6c7e6815 100644 +--- a/src/video/dispmanx/SDL_dispmanxvideo.c ++++ b/src/video/dispmanx/SDL_dispmanxvideo.c +@@ -189,15 +189,18 @@ static SDL_Surface *DISPMANX_SetVideoMode(_THIS, SDL_Surface *current, int width + + uint32_t screen = 0; + +- bcm_host_init(); ++ if ( ! dispvars->display ) { ++ bcm_host_init(); + +- dispvars->display = vc_dispmanx_display_open( screen ); ++ dispvars->display = vc_dispmanx_display_open( screen ); + +- vc_dispmanx_display_get_info( dispvars->display, &(dispvars->amode)); +- printf( "Dispmanx: Physical video mode is %d x %d\n", +- dispvars->amode.width, dispvars->amode.height ); +- +- DISPMANX_BlankBackground(); ++ vc_dispmanx_display_get_info( dispvars->display, &(dispvars->amode)); ++ printf( "Dispmanx: Physical video mode is %d x %d\n", dispvars->amode.width, dispvars->amode.height ); ++ DISPMANX_BlankBackground(); ++ } else { ++ free(dispvars->pixmem); ++ DISPMANX_FreeResources(); ++ } + + Uint32 Rmask; + Uint32 Gmask; +@@ -376,8 +379,6 @@ static void DISPMANX_FreeResources(void){ + + vc_dispmanx_resource_delete( dispvars->resources[0] ); + vc_dispmanx_resource_delete( dispvars->resources[1] ); +- +- vc_dispmanx_display_close( dispvars->display ); + } + + static void DISPMANX_FreeBackground (void) { +@@ -397,9 +398,11 @@ static void DISPMANX_VideoQuit(_THIS) + hw_lock = NULL; + } + +- if (dispvars->pixmem != NULL){ ++ if (dispvars->display) { + DISPMANX_FreeBackground(); + DISPMANX_FreeResources(); ++ vc_dispmanx_display_close( dispvars->display ); ++ dispvars->display = NULL; + } + + FB_CloseMouse(this); +-- +1.9.1 + diff --git a/recipes-graphics/libsdl/libsdl/rpi/0005-should-be-0-not-NULL.patch b/recipes-graphics/libsdl/libsdl/rpi/0005-should-be-0-not-NULL.patch new file mode 100644 index 0000000..59e9ecc --- /dev/null +++ b/recipes-graphics/libsdl/libsdl/rpi/0005-should-be-0-not-NULL.patch @@ -0,0 +1,25 @@ +From d983127916367c4f87592b4dab1230c5bc8ba9ac Mon Sep 17 00:00:00 2001 +From: Jools Wills +Date: Sun, 22 Feb 2015 01:04:01 +0000 +Subject: [PATCH 5/5] should be 0 not NULL + +--- + src/video/dispmanx/SDL_dispmanxvideo.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/video/dispmanx/SDL_dispmanxvideo.c b/src/video/dispmanx/SDL_dispmanxvideo.c +index cf3a6c7e6815..3d743adcc9ee 100644 +--- a/src/video/dispmanx/SDL_dispmanxvideo.c ++++ b/src/video/dispmanx/SDL_dispmanxvideo.c +@@ -402,7 +402,7 @@ static void DISPMANX_VideoQuit(_THIS) + DISPMANX_FreeBackground(); + DISPMANX_FreeResources(); + vc_dispmanx_display_close( dispvars->display ); +- dispvars->display = NULL; ++ dispvars->display = 0; + } + + FB_CloseMouse(this); +-- +1.9.1 + diff --git a/recipes-graphics/libsdl/libsdl_1.2.15.bbappend b/recipes-graphics/libsdl/libsdl_1.2.15.bbappend new file mode 100644 index 0000000..21d8c91 --- /dev/null +++ b/recipes-graphics/libsdl/libsdl_1.2.15.bbappend @@ -0,0 +1,15 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI_append_rpi = " \ + file://0001-rpi-framebuffer-fixes-from-pssc-https-github.com-ras.patch \ + file://0002-added-dispmanx-support-to-sdl-enabled-by-changing-en.patch \ + file://0003-added-missing-n.patch \ + file://0004-only-initialise-once-SetVideoMode-can-be-called-mult.patch \ + file://0005-should-be-0-not-NULL.patch \ + " + +CFLAGS_append_rpi = " -I=/usr/include/interface/vcos/pthreads/ -I=/usr/include/interface/vmcs_host/linux/ " + +DEPENDS_rpi = "userland" + +EXTRA_OECONF += "--enable-video-fbcon" diff --git a/recipes-retroarch/retroarch/retroarch/0001-Fix-compiler_test_at_configure.patch b/recipes-retroarch/retroarch/retroarch/0001-Fix-compiler_test_at_configure.patch new file mode 100644 index 0000000..0710d96 --- /dev/null +++ b/recipes-retroarch/retroarch/retroarch/0001-Fix-compiler_test_at_configure.patch @@ -0,0 +1,77 @@ +From 5efee76b18c33dece3767ec69bb0af6b4d1fc6d3 Mon Sep 17 00:00:00 2001 +From: Romain Forlot +Date: Sun, 31 Dec 2017 15:12:39 +0000 +Subject: [PATCH] Fix-compiler_test_at_configure + +Change-Id: I5db45bcbda60794ef47abe05b65228bbee917cb3 +Signed-off-by: Romain Forlot +--- + qb/qb.comp.sh | 4 ++-- + qb/qb.libs.sh | 8 ++++---- + 2 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/qb/qb.comp.sh b/qb/qb.comp.sh +index 1477154..4766ae5 100644 +--- a/qb/qb.comp.sh ++++ b/qb/qb.comp.sh +@@ -12,7 +12,7 @@ EOF + + cc_works=0 + if [ "$CC" ]; then +- "$CC" -o "$TEMP_EXE" "$TEMP_C" >/dev/null 2>&1 && cc_works=1 ++ $CC -o "$TEMP_EXE" "$TEMP_C" && cc_works=1 + else + for cc in gcc cc clang; do + CC="$(exists "${CROSS_COMPILE}${cc}")" || CC="" +@@ -47,7 +47,7 @@ EOF + + cxx_works=0 + if [ "$CXX" ]; then +- "$CXX" -o "$TEMP_EXE" "$TEMP_CXX" >/dev/null 2>&1 && cxx_works=1 ++ $CXX -o "$TEMP_EXE" "$TEMP_CXX" >/dev/null 2>&1 && cxx_works=1 + else + for cxx in g++ c++ clang++; do + CXX="$(exists "${CROSS_COMPILE}${cxx}")" || CXX="" +diff --git a/qb/qb.libs.sh b/qb/qb.libs.sh +index 86868a3..dfea0bc 100644 +--- a/qb/qb.libs.sh ++++ b/qb/qb.libs.sh +@@ -50,7 +50,7 @@ check_lib() # $1 = language $2 = HAVE_$2 $3 = lib $4 = function in lib $5 = + error="${7:-}" + answer='no' + eval "set -- $INCLUDE_DIRS $LIBRARY_DIRS $5 $CFLAGS $LDFLAGS $3" +- "$COMPILER" -o "$TEMP_EXE" "$TEMP_CODE" "$@" >>config.log 2>&1 && answer='yes' ++ $COMPILER -o "$TEMP_EXE" "$TEMP_CODE" "$@" >>config.log 2>&1 && answer='yes' + eval "HAVE_$val=\"$answer\"" + printf %s\\n "$ECHOBUF ... $answer" + rm -f -- "$TEMP_CODE" "$TEMP_EXE" +@@ -114,7 +114,7 @@ check_header() #$1 = HAVE_$1 $2..$5 = header files + val="$1" + header="$2" + eval "set -- $INCLUDE_DIRS" +- "$CC" -o "$TEMP_EXE" "$TEMP_C" "$@" >>config.log 2>&1 && answer='yes' ++ $CC -o "$TEMP_EXE" "$TEMP_C" "$@" >>config.log 2>&1 && answer='yes' + eval "HAVE_$val=\"$answer\"" + printf %s\\n "Checking presence of header file $CHECKHEADER ... $answer" + rm -f -- "$TEMP_C" "$TEMP_EXE" +@@ -136,7 +136,7 @@ EOF + val="$1" + macro="$2" + eval "set -- $CFLAGS $INCLUDE_DIRS" +- "$CC" -o "$TEMP_EXE" "$TEMP_C" "$@" >>config.log 2>&1 && answer='yes' ++ $CC -o "$TEMP_EXE" "$TEMP_C" "$@" >>config.log 2>&1 && answer='yes' + eval "HAVE_$val=\"$answer\"" + printf %s\\n "$ECHOBUF ... $answer" + rm -f -- "$TEMP_C" "$TEMP_EXE" +@@ -150,7 +150,7 @@ check_switch() # $1 = language $2 = HAVE_$2 $3 = switch $4 = critical error m + ECHOBUF="Checking for availability of switch $3 in $COMPILER" + printf %s\\n 'int main(void) { return 0; }' > "$TEMP_CODE" + answer='no' +- "$COMPILER" -o "$TEMP_EXE" "$TEMP_CODE" "$3" >>config.log 2>&1 && answer='yes' ++ $COMPILER -o "$TEMP_EXE" "$TEMP_CODE" "$3" >>config.log 2>&1 && answer='yes' + eval "HAVE_$2=\"$answer\"" + printf %s\\n "$ECHOBUF ... $answer" + rm -f -- "$TEMP_CODE" "$TEMP_EXE" +-- +2.1.4 + diff --git a/recipes-retroarch/retroarch/retroarch/0001-Fix-initializer_element_is_not_constant.patch b/recipes-retroarch/retroarch/retroarch/0001-Fix-initializer_element_is_not_constant.patch new file mode 100644 index 0000000..e1a27b4 --- /dev/null +++ b/recipes-retroarch/retroarch/retroarch/0001-Fix-initializer_element_is_not_constant.patch @@ -0,0 +1,59 @@ +From 3b163726d546e5c6e3fb26a56cc53802c3f4483a Mon Sep 17 00:00:00 2001 +From: Romain Forlot +Date: Sun, 31 Dec 2017 15:50:43 +0000 +Subject: [PATCH] Fix-initializer_element_is_not_constant + +Change-Id: I3fca23aa53665518855ded1f86015d7d4a217838 +Signed-off-by: Romain Forlot +--- + input/connect/joypad_connection.h | 30 +++++++++++++++--------------- + qb/qb.comp.sh | 4 ++-- + qb/qb.libs.sh | 8 ++++---- + 3 files changed, 21 insertions(+), 21 deletions(-) + +diff --git a/input/connect/joypad_connection.h b/input/connect/joypad_connection.h +index ec78b3c..32922be 100644 +--- a/input/connect/joypad_connection.h ++++ b/input/connect/joypad_connection.h +@@ -26,23 +26,23 @@ + #include "../input_driver.h" + + #define VID_NONE 0x0000 +-#define VID_NINTENDO swap_if_big16(0x057e) +-#define VID_SONY swap_if_big16(0x054c) +-#define VID_MICRONTEK swap_if_big16(0x0079) +-#define VID_PCS swap_if_big16(0x0810) +-#define VID_PS3_CLONE swap_if_big16(0x0313) +-#define VID_SNES_CLONE swap_if_big16(0x081f) ++#define VID_NINTENDO 0x057e ++#define VID_SONY 0x054c ++#define VID_MICRONTEK 0x0079 ++#define VID_PCS 0x0810 ++#define VID_PS3_CLONE 0x0313 ++#define VID_SNES_CLONE 0x081f + + #define PID_NONE 0x0000 +-#define PID_NINTENDO_PRO swap_if_big16(0x0330) +-#define PID_SONY_DS3 swap_if_big16(0x0268) +-#define PID_SONY_DS4 swap_if_big16(0x05c4) +-#define PID_DS3_CLONE swap_if_big16(0x20d6) +-#define PID_SNES_CLONE swap_if_big16(0xe401) +-#define PID_MICRONTEK_NES swap_if_big16(0x0011) +-#define PID_NINTENDO_GCA swap_if_big16(0x0337) +-#define PID_PCS_PS2PSX swap_if_big16(0x0001) +-#define PID_PCS_PSX2PS3 swap_if_big16(0x0003) ++#define PID_NINTENDO_PRO 0x0330 ++#define PID_SONY_DS3 0x0268 ++#define PID_SONY_DS4 0x05c4 ++#define PID_DS3_CLONE 0x20d6 ++#define PID_SNES_CLONE 0xe401 ++#define PID_MICRONTEK_NES 0x0011 ++#define PID_NINTENDO_GCA 0x0337 ++#define PID_PCS_PS2PSX 0x0001 ++#define PID_PCS_PSX2PS3 0x0003 + + struct joypad_connection + { +-- +2.1.4 + diff --git a/recipes-retroarch/retroarch/retroarch_git.bb b/recipes-retroarch/retroarch/retroarch_git.bb new file mode 100644 index 0000000..c692ab8 --- /dev/null +++ b/recipes-retroarch/retroarch/retroarch_git.bb @@ -0,0 +1,27 @@ +SUMMARY = "RetroArch is a frontend for emulators, game engines and media players" +HOMEPAGE = "http://www.retroarch.com/" +SECTION = "emulators" + +LICENSE = "GPLv3" +LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/GPL-3.0;md5=c79ff39f19dfec6d293b95dea7b07891" + +FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:" + +SRC_URI = "git://github.com/libretro/RetroArch.git \ + file://0001-Fix-compiler_test_at_configure.patch \ + file://0001-Fix-initializer_element_is_not_constant.patch \ + " + +SRCREV = "${AUTOREV}" + +S = "${WORKDIR}/git" + +inherit autotools-brokensep pkgconfig + +PACKAGECONFIG[openal] = "--enable-openal,--disable-openal,openal-soft" +DEPENDS = "libx11 zlib libv4l libxkbcommon mesa freetype libxml2 ffmpeg libsdl libsdl2 libsdl pulseaudio libusb" + +do_configure() { +./configure --build=x86_64-linux --host=aarch64-poky-linux --prefix=/usr --enable-egl --enable-materialui --enable-sdl2 --enable-ffmpeg --enable-zlib +} + diff --git a/recipes-retroarch/snes9x2010/snes9x2010_1.53.bb b/recipes-retroarch/snes9x2010/snes9x2010_1.53.bb new file mode 100644 index 0000000..d5a9831 --- /dev/null +++ b/recipes-retroarch/snes9x2010/snes9x2010_1.53.bb @@ -0,0 +1,26 @@ +SUMMARY = "Multi-platform Super Nintendo emulator" +HOMEPAGE = "http://www.snes9x.com/" +SECTION = "emulators" + +LICENSE = "GPLv2 & LGPLv2.1" +LIC_FILES_CHKSUM = "file://docs/snes9x-license.txt;md5=4fcf43611f2ec3b56af71326e87f5e6b \ + file://docs/gpl-2.0.txt;md5=751419260aa954499f7abaabaa882bbe \ + file://docs/lgpl-2.1.txt;md5=243b725d71bb5df4a1e5920b344b86ad" + +SRC_URI = "git://github.com/libretro/snes9x2010.git;protocol=https" +SRCREV = "${AUTOREV}" + +S = "${WORKDIR}/git" + +inherit autotools-brokensep + +DEPENDS = "libice libx11 zlib libpng libxext libsm" + +TARGET_CC_ARCH += "${LDFLAGS}" + +do_install() { + install -d ${D}/usr/lib/libretro + install -m 0755 snes9x2010_libretro.so ${D}/usr/lib/libretro +} + +FILES_${PN} += " /usr/lib/libretro/snes9x2010_libretro.so" diff --git a/recipes-tests/images/core-image-emulators-base.bb b/recipes-tests/images/core-image-emulators-base.bb new file mode 100644 index 0000000..495f70f --- /dev/null +++ b/recipes-tests/images/core-image-emulators-base.bb @@ -0,0 +1,10 @@ +SUMMARY = "A base image to compile emulators" + +LICENSE = "MIT" + +CORE_IMAGE_EXTRA_INSTALL += " \ + alsa-utils \ + tslib-calibrate \ + " + +inherit core-image diff --git a/recipes-tests/images/core-image-emulators-full.bb b/recipes-tests/images/core-image-emulators-full.bb new file mode 100644 index 0000000..6994cf8 --- /dev/null +++ b/recipes-tests/images/core-image-emulators-full.bb @@ -0,0 +1,14 @@ +require core-image-emulators-base.bb + +SUMMARY = "An image with all videogame emulators enabled" + +LICENSE = "MIT" + +CORE_IMAGE_EXTRA_INSTALL += " \ + snes9x \ + snes9x-sdl \ + advancemame \ + stella \ + uae4all2 \ + mednafen \ + " diff --git a/recipes-tests/images/core-image-graphics-tests.bb b/recipes-tests/images/core-image-graphics-tests.bb new file mode 100644 index 0000000..85ca767 --- /dev/null +++ b/recipes-tests/images/core-image-graphics-tests.bb @@ -0,0 +1,12 @@ +require core-image-emulators-base.bb + +SUMMARY = "An image with audio, video and input test tools" + +LICENSE = "MIT" + +CORE_IMAGE_EXTRA_INSTALL += " \ + libsdl-tests \ + evtest \ + tslib-tests \ + strace \ + " diff --git a/recipes-tests/libsdl-tests/libsdl-tests-1.2.15/configure_fix.patch b/recipes-tests/libsdl-tests/libsdl-tests-1.2.15/configure_fix.patch new file mode 100644 index 0000000..6f8984e --- /dev/null +++ b/recipes-tests/libsdl-tests/libsdl-tests-1.2.15/configure_fix.patch @@ -0,0 +1,23 @@ +diff --git a/test/acinclude.m4 b/test/acinclude.m4 +index b6df43f080fe..385ab95cc996 100644 +--- a/test/acinclude.m4 ++++ b/test/acinclude.m4 +@@ -35,15 +35,15 @@ AC_ARG_ENABLE(sdltest, [ --disable-sdltest Do not try to compile and run + if test "x$prefix" != xNONE; then + PATH="$prefix/bin:$prefix/usr/bin:$PATH" + fi +- AC_PATH_PROG(SDL_CONFIG, sdl-config, no, [$PATH]) ++ AC_PATH_PROG(SDL_CONFIG, sdl-config, "", [$PATH]) + min_sdl_version=ifelse([$1], ,0.11.0,$1) + AC_MSG_CHECKING(for SDL - version >= $min_sdl_version) + no_sdl="" + if test "$SDL_CONFIG" = "no" ; then + no_sdl=yes + else +- SDL_CFLAGS=`$SDL_CONFIG $sdlconf_args --cflags` +- SDL_LIBS=`$SDL_CONFIG $sdlconf_args --libs` ++ SDL_CFLAGS=`pkg-config --cflags sdl` ++ SDL_LIBS=`pkg-config --libs sdl` + + sdl_major_version=`$SDL_CONFIG $sdl_args --version | \ + sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` diff --git a/recipes-tests/libsdl-tests/libsdl-tests_1.2.15.bb b/recipes-tests/libsdl-tests/libsdl-tests_1.2.15.bb new file mode 100644 index 0000000..7a116bb --- /dev/null +++ b/recipes-tests/libsdl-tests/libsdl-tests_1.2.15.bb @@ -0,0 +1,45 @@ +SUMMARY = "Simple DirectMedia Layer Test Applications" +DESCRIPTION = "Simple DirectMedia Layer is a cross-platform multimedia \ +library designed to provide low level access to audio, keyboard, mouse, \ +joystick, 3D hardware via OpenGL, and 2D video framebuffer." +HOMEPAGE = "http://www.libsdl.org" +BUGTRACKER = "http://bugzilla.libsdl.org/" + +SECTION = "tests" + +LICENSE = "LGPL-2.1" +LIC_FILES_CHKSUM = "file://COPYING;md5=77604414711055c1393ef261e94e5855" + +DEPENDS = "libsdl" + +SRC_URI = "http://www.libsdl.org/release/SDL-${PV}.tar.gz \ + file://configure_fix.patch;striplevel=2" + +S = "${WORKDIR}/SDL-${PV}/test" + +SRC_URI[md5sum] = "9d96df8417572a2afb781a7c4c811a85" +SRC_URI[sha256sum] = "d6d316a793e5e348155f0dd93b979798933fb98aa1edebcc108829d6474aad00" + +TARGET_CC_ARCH += "${LDFLAGS}" + +inherit autotools + +do_install() { + + SDL_TESTS_APPS="checkkeys graywin loopwave testalpha testbitmap testblitspeed \ + testcdrom testcursor testdyngl testerror testfile testgamma testgl testhread \ + testiconv testjoystick testkeys testloadso testlock testoverlay testoverlay2 \ + testpalette testplatform testsem testsprite testtimer testver testvidinfo \ + testwin testwm threadwin torturethread" + + SDL_TESTS_APPS_FILES="icon.bmp moose.dat picture.xbm sail.bmp sample.bmp \ + sample.wav utf8.txt" + + install -d ${D}${libexecdir} + for f in $SDL_TESTS_APPS; do + install -m 0755 $f ${D}${libexecdir} + done + for f in $SDL_TESTS_APPS_FILES; do + install -m 0644 ${S}/$f ${D}${libexecdir} + done +}